Bug #81706 | NullPointerException in driver | ||
---|---|---|---|
Submitted: | 3 Jun 2016 9:22 | Modified: | 8 Feb 2017 19:56 |
Reporter: | Jurgen Voorneveld | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / J | Severity: | S2 (Serious) |
Version: | 5.1.39 to 5.1.30 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | cacheResultSetMetadata, NullPointerException, ping, PreparedStatement |
[3 Jun 2016 9:22]
Jurgen Voorneveld
[3 Jun 2016 9:28]
Jurgen Voorneveld
fixing the tags
[3 Jun 2016 10:39]
Jurgen Voorneveld
Narrowed down the version number. Version 5.1.30 is the earliest that exhibits this bug.
[6 Jun 2016 13:09]
Chiranjeevi Battula
Hello Jurgen Voorneveld, Thank you for the bug report and test case. Verified this behavior on MySQL Connector / J 5.1.30 to 5.1.39. Thanks, Chiranjeevi.
[6 Jun 2016 13:10]
Chiranjeevi Battula
run: Exception in thread "main" java.lang.NullPointerException at java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:70) at java.nio.ByteBuffer.wrap(ByteBuffer.java:373) at com.mysql.jdbc.StringUtils.toString(StringUtils.java:2195) at com.mysql.jdbc.Field.getStringFromBytes(Field.java:635) at com.mysql.jdbc.Field.getTableName(Field.java:662) at com.mysql.jdbc.Field.getFullName(Field.java:503) at com.mysql.jdbc.ResultSetImpl.buildIndexMapping(ResultSetImpl.java:699) at com.mysql.jdbc.ConnectionImpl.initializeResultsMetadataFromCache(ConnectionImpl.java:5283) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1972) at javaapplication3.bug_81706.main(bug_81706.java:33) C:\Users\cbattula\AppData\Local\NetBeans\Cache\8.1\executor-snippets\run.xml:53: Java returned: 1 BUILD FAILED (total time: 0 seconds)
[8 Feb 2017 19:56]
Daniel So
Posted by developer: Added the following entry to the Connector/J 5.1.41 changelog: "When the configuratino property cacheResultSetMetadata was set to true, a ping query using a PreparedStatement failed with a NullPointerException. This fix moves the ping query to an earlier stage of the statement execution, which prevents the exception."