Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
1.2.0
-
None
-
Debian Jessie, Oracle JDK 8u51, MySQL 5.5.44-0+deb8u1
Description
When executing the code below the getMoreResults() method returns true instead of false, while the getResultSet() method returns null and the second call of the getUpdateCount() method returns 1. The used table test has two columns, one "integer" and one "text".
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/database?allowMultiQueries=true"); |
Statement stmt = connection.createStatement();
|
stmt.execute("insert into test values (1, 'one'); insert into test values (2, 'two');"); |
int firstCount = stmt.getUpdateCount(); |
boolean more = stmt.getMoreResults(); |
int secondCount = stmt.getUpdateCount(); |
ResultSet secondSet = stmt.getResultSet();
|
So in this case firstCount=1, more=true, secondCount=1 and secondSet=null. However, more=false is the correct result. When run using the MySQL Connector/J driver getMoreResults behaves as expected.
Attachments
Issue Links
- relates to
-
CONJ-532 Statement.getMoreResults() incorrect after CREATE TABLE multiquery
- Closed