lbehnke / h2database

Automatically exported from code.google.com/p/h2database
0 stars 0 forks source link

NPE in TraceObject.toString when using TCP connection #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run the attached Main class

What is the expected output? What do you see instead?
It should run successfully, instead I get:
Exception in thread "main" java.lang.NullPointerException
    at org.h2.message.TraceObject.toString(TraceObject.java:214)
    at org.h2.command.CommandRemote.toString(CommandRemote.java:231)
    at org.h2.jdbc.JdbcPreparedStatement.toString(JdbcPreparedStatement.java:1417)
    at H2Test.main(H2Test.java:13)

What version of the product are you using? On what operating system, file
system, and virtual machine?
I'm using the latest h2 version (h2-2008-03-15.zip Version 1.0.68)

Do you know a workaround?
The problem doesn't occurred if I use the embedded mode.

How important/urgent is the problem for you?
This bug prevent the usage of H2 TCP mode with XAPool.

In your view, is this a defect or a feature request?
It's clearly a bug.

Please provide any additional information below.
I modified the method org.h2.message.TraceObject.toString to check if
p.getParamValue() is null, but the problem is maybe in
org.h2.expression.ParameterRemote.getParamValue().
In case of embedded mode the method
org.h2.expression.Parameter.getParamValue() is called and this method check
if value is null but there is not check in
org.h2.expression.ParameterRemote.getParamValue()

Original issue reported on code.google.com by carpenti...@gmail.com on 23 Mar 2008 at 10:19

Attachments:

GoogleCodeExporter commented 9 years ago
This bug will be fixed in the next release.
Thanks for your help!
Thomas

Original comment by thomas.t...@gmail.com on 23 Mar 2008 at 5:06

GoogleCodeExporter commented 9 years ago

Original comment by thomas.t...@gmail.com on 23 Mar 2008 at 5:06

GoogleCodeExporter commented 9 years ago
Fixed in version 1.0.69 (2008-03-29)

Original comment by thomas.t...@gmail.com on 29 Mar 2008 at 12:32

GoogleCodeExporter commented 9 years ago
Fixed in version 1.0.69 (2008-03-29)

Original comment by thomas.t...@gmail.com on 29 Mar 2008 at 12:33

GoogleCodeExporter commented 9 years ago
It's not fixed in 1.0.69, if you run the test:
Exception in thread "main" java.lang.NullPointerException
    at org.h2.message.TraceObject.toString(TraceObject.java:222)
    at org.h2.command.CommandRemote.toString(CommandRemote.java:231)
    at org.h2.jdbc.JdbcPreparedStatement.toString(JdbcPreparedStatement.java:1417)
    at H2Test.main(H2Test.java:13)

the problem is on p.getParamValue() that returns null.

Original comment by carpenti...@gmail.com on 11 Apr 2008 at 8:50

GoogleCodeExporter commented 9 years ago
Thanks! I will correctly fix this for the next release.

Original comment by thomas.t...@gmail.com on 11 Apr 2008 at 3:09

GoogleCodeExporter commented 9 years ago
Fixed in version 1.0.70 (2008-04-20)

Original comment by thomas.t...@gmail.com on 21 Apr 2008 at 5:47

GoogleCodeExporter commented 9 years ago
It's fixed, thanks.

Original comment by carpenti...@gmail.com on 23 Apr 2008 at 7:28