util:item - java.lang.NullPointerException

Thursday, 21 May 2020 · 3 messages
SG
Sebastian Guerrero21 May 2020 03:04 #
Hi BaseX team! I have a database with a text-index for a node named "*serial-number"* with 2,164,980 occurrences of text '*0000000*'. *[1]* If I execute : *util:item(db:text("US02", "0000000"), 1)* I get '0000000', as expected. But, If I execute: * util:item(db:text("US02", "0000000"), 2) * I get the error message in *[2]* The same happens with *db:text("US02", "0000000")[2]* *subsequence(db:text("US02", "0000000"),2,1)* I recorded everything on this video *[3]* Is this a bug?, I optimized the database before executing the queries. Best regards, Sebastian. *[1] *https://imgur.com/UDgXYPY
*[2] *Stack Trace:
java.lang.NullPointerException
at org.basex.query.expr.ParseExpr.iter(ParseExpr.java:46)
at org.basex.query.scope.MainModule.iter(MainModule.java:97)
at org.basex.query.QueryContext.iter(QueryContext.java:333)
at org.basex.query.QueryContext.cache(QueryContext.java:630)
at org.basex.query.QueryProcessor.cache(QueryProcessor.java:113)
at org.basex.core.cmd.AQuery.query(AQuery.java:101)
at org.basex.core.cmd.XQuery.run(XQuery.java:22)
at org.basex.core.Command.run(Command.java:257)
at org.basex.core.Command.execute(Command.java:93)
at org.basex.gui.GUI.exec(GUI.java:416)
at org.basex.gui.GUI.lambda$4(GUI.java:359)
at java.lang.Thread.run(Unknown Source)
CG
Christian Grün21 May 2020 10:05 #
…fixed [1]. Thanks for the easily reproducible test case and the kudos. [1] http://files.basex.org/releases/latest/
Quoted text · Sebastian Guerrero · 51 lines
On Thu, May 21, 2020 at 1:04 AM Sebastian Guerrero <chapeti at gmail.com> wrote: > > Hi BaseX team! > > I have a database with a text-index for a node named "serial-number" with 2,164,980 occurrences of text '0000000'. [1] > > If I execute : > > util:item(db:text("US02", "0000000"), 1) > > I get '0000000', as expected. > > But, If I execute: > > util:item(db:text("US02", "0000000"), 2) > > I get the error message in [2] > > The same happens with > > db:text("US02", "0000000")[2] > > subsequence(db:text("US02", "0000000"),2,1) > > > I recorded everything on this video [3] > > Is this a bug?, I optimized the database before executing the queries. > > Best regards, > Sebastian. > > > [1] https://imgur.com/UDgXYPY > > [2] Stack Trace: > java.lang.NullPointerException > at org.basex.query.expr.ParseExpr.iter(ParseExpr.java:46) > at org.basex.query.scope.MainModule.iter(MainModule.java:97) > at org.basex.query.QueryContext.iter(QueryContext.java:333) > at org.basex.query.QueryContext.cache(QueryContext.java:630) > at org.basex.query.QueryProcessor.cache(QueryProcessor.java:113) > at org.basex.core.cmd.AQuery.query(AQuery.java:101) > at org.basex.core.cmd.XQuery.run(XQuery.java:22) > at org.basex.core.Command.run(Command.java:257) > at org.basex.core.Command.execute(Command.java:93) > at org.basex.gui.GUI.exec(GUI.java:416) > at org.basex.gui.GUI.lambda$4(GUI.java:359) > at java.lang.Thread.run(Unknown Source) > > [3] https://youtu.be/gXYpBNd7iJc
SG
Sebastian Guerrero21 May 2020 15:50 #
Thank you very much, Christian. I confirm that it's working now. [1] Bests regards, Sebastian [1] https://imgur.com/NjUqqvF
Quoted text · Christian Grün · 62 lines
On Thu, May 21, 2020 at 5:06 AM Christian Grün <christian.gruen at gmail.com> wrote: > …fixed [1]. Thanks for the easily reproducible test case and the kudos. > > [1] http://files.basex.org/releases/latest/ > > > > On Thu, May 21, 2020 at 1:04 AM Sebastian Guerrero <chapeti at gmail.com> > wrote: > > > > Hi BaseX team! > > > > I have a database with a text-index for a node named "serial-number" > with 2,164,980 occurrences of text '0000000'. [1] > > > > If I execute : > > > > util:item(db:text("US02", "0000000"), 1) > > > > I get '0000000', as expected. > > > > But, If I execute: > > > > util:item(db:text("US02", "0000000"), 2) > > > > I get the error message in [2] > > > > The same happens with > > > > db:text("US02", "0000000")[2] > > > > subsequence(db:text("US02", "0000000"),2,1) > > > > > > I recorded everything on this video [3] > > > > Is this a bug?, I optimized the database before executing the queries. > > > > Best regards, > > Sebastian. > > > > > > [1] https://imgur.com/UDgXYPY > > > > [2] Stack Trace: > > java.lang.NullPointerException > > at org.basex.query.expr.ParseExpr.iter(ParseExpr.java:46) > > at org.basex.query.scope.MainModule.iter(MainModule.java:97) > > at org.basex.query.QueryContext.iter(QueryContext.java:333) > > at org.basex.query.QueryContext.cache(QueryContext.java:630) > > at org.basex.query.QueryProcessor.cache(QueryProcessor.java:113) > > at org.basex.core.cmd.AQuery.query(AQuery.java:101) > > at org.basex.core.cmd.XQuery.run(XQuery.java:22) > > at org.basex.core.Command.run(Command.java:257) > > at org.basex.core.Command.execute(Command.java:93) > > at org.basex.gui.GUI.exec(GUI.java:416) > > at org.basex.gui.GUI.lambda$4(GUI.java:359) > > at java.lang.Thread.run(Unknown Source) > > > > [3] https://youtu.be/gXYpBNd7iJc >

⚡Generated with XQuery