[CONJ-532] Statement.getMoreResults() incorrect after CREATE TABLE multiquery Created: 2017-09-27  Updated: 2017-10-04  Resolved: 2017-10-04

Status: Closed
Project: MariaDB Connector/J
Component/s: Other
Affects Version/s: 2.0.2, 2.1.2
Fix Version/s: 2.2.0, 1.7.0

Type: Bug Priority: Major
Reporter: Colin Chambers Assignee: Diego Dupin
Resolution: Fixed Votes: 0
Labels: None
Environment:

Ubuntu 17.04
MariaDB Server 10.2.8


Attachments: Java Source File mariadb_bug.java    
Issue Links:
Relates
relates to CONJ-179 Statement.getMoreResults() returns wr... Closed

 Description   

After a query containing multiple CREATE TABLE statements Statement.getMoreResults() returns true
for second result (indicating the result is a result set) and Statement.getResultSet() then returns null. The getMoreResults() should be false and a getUpdateCount() should then return 0 (indicating an update count of 0 is the result).

The attached program demonstrates the bug. Correct output should show two update counts of zero. Actual output shows an update count of zero followed by a result set which is null.

Attached program works correctly with mysql-connector-java-5.1.42.

The problem also occurs for DROP TABLE statements.



 Comments   
Comment by Diego Dupin [ 2017-10-04 ]

correction done in 2.2.0-SNAPSHOT and 1.6.6-SNAPSHOT :

<repositories>
    <repository>
        <id>sonatype-nexus-snapshots</id>
        <name>Sonatype Nexus Snapshots</name>
        <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
</repositories>
 
<dependencies>
    <dependency>
        <groupId>org.mariadb.jdbc</groupId>
        <artifactId>mariadb-java-client</artifactId>
        <version>2.2.0-SNAPSHOT</version>
    </dependency>
</dependencies>

Generated at Thu Feb 08 03:16:22 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.