Unfortunately, while comment parsing bug was real, it did not affect the parsing of scripts.

Which means that the only thing I can think of is that your script has suffered some form of corruption.

I have added some protection to ScriptReader for cases like this, which means that it will throw a nicer exception
in future, so you could try building from SVN.
At the very least, the code will now tell you what the first chunk of the broken statement looks like.

On 2013-09-27 09:50, Uli wrote:
The SQL script is created by the recover tool so I don't know which comments are in that file.

If you like I can search the script for a pattern. Which pattern?

Uli

On Friday, September 27, 2013 9:47:50 AM UTC+2, Noel Grandin wrote:

    Hi

    Interesting. At that point, that code is attempting to parse a single
    statement from the script file.
    The only way that exception can trigger is if the code thinks it
    needs a
    buffer size of more than 1G to hold the statement.

    Hmmm, do you perhaps have single line comments in that script file?

    I can see a bug in our current code where it might glitch if reading
    single line comments
    .e.g.
    // jhfjkshkjsdhf

    Regards, Noel.

    On 2013-09-27 08:58, Uli wrote:
    > I get an exception when I try to recover a large database with the
    > RunScript tool:
    >
    > Exception in thread "main" java.lang.NegativeArraySizeException
    >         at
    org.h2.util.ScriptReader.readBuffer(ScriptReader.java:232)
    >         at org.h2.util.ScriptReader.read(ScriptReader.java:219)
    >         at
    > org.h2.util.ScriptReader.readStatementLoop(ScriptReader.java:178)
    >         at
    org.h2.util.ScriptReader.readStatement(ScriptReader.java:64)
    >         at org.h2.tools.RunScript.process(RunScript.java:199)
    >         at org.h2.tools.RunScript.process(RunScript.java:188)
    >         at org.h2.tools.RunScript.process(RunScript.java:319)
    >         at org.h2.tools.RunScript.runTool(RunScript.java:142)
    >         at org.h2.tools.RunScript.main(RunScript.java:69)
    >
    >
    > The SQL script is 124GB and the error is thrown close to the end.
    >
    > I am using H2 1.3.173 on Linux.
    >
    > Uli
    >
    > --
    > You received this message because you are subscribed to the Google
    > Groups "H2 Database" group.
    > To unsubscribe from this group and stop receiving emails from
    it, send
    > an email to [email protected] <javascript:>.
    > To post to this group, send email to [email protected]
    <javascript:>.
    > Visit this group at http://groups.google.com/group/h2-database
    <http://groups.google.com/group/h2-database>.
    > For more options, visit https://groups.google.com/groups/opt_out
    <https://groups.google.com/groups/opt_out>.

--
You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to