Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
1.3.4, 1.3.5
-
None
-
Windows 7, MariaDB 5.5.47 serve
Description
The problem can be reproduced using this simple example, replacing the obvious bits with server location, port, etc.
package com.dms.mariadb; |
|
import java.sql.Connection; |
import java.sql.DriverManager; |
import java.sql.Statement; |
|
public class MariaDbNPETest |
{
|
public static void main(final String[] args) |
{
|
try (final Connection dbConnection = DriverManager.getConnection("jdbc:mariadb://<machine>:<port>/<dbName>", "<username>", "<password>")) |
{
|
Class.forName("org.mariadb.jdbc.Driver"); |
|
final Statement statement = dbConnection.createStatement(); |
|
// Make sure it is a streaming statement: |
statement.setFetchSize(Integer.MIN_VALUE);
|
|
for (int count = 1; count <= 10; count++) |
{
|
try |
{
|
System.out.println("Closing count: " + count); |
|
statement.close();
|
}
|
catch (final Exception ex) |
{
|
ex.printStackTrace();
|
break; |
}
|
}
|
}
|
catch (final Exception ex) |
{
|
ex.printStackTrace();
|
}
|
}
|
}
|
This is the output I get:
Closing count: 1 |
Closing count: 2 |
java.lang.NullPointerException
|
at org.mariadb.jdbc.MariaDbStatement.getInternalMoreResults(MariaDbStatement.java:908) |
at org.mariadb.jdbc.MariaDbStatement.close(MariaDbStatement.java:588) |
at com.dms.mariadb.MariaDbNPETest.main(MariaDbNPETest.java:31) |