[CONJ-953] PreparedStatement.getGeneratedKeys() returns rows when no keys are generated in insert Created: 2022-04-06 Updated: 2022-06-22 Resolved: 2022-06-22 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | JDBC compatibility |
| Affects Version/s: | 3.0.3 |
| Fix Version/s: | 3.0.6 |
| Type: | Bug | Priority: | Major |
| Reporter: | John Doe | Assignee: | Diego Dupin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
In version 2.6.1 there is no problem. But with mariadb-java-client 3.0.3 there is. Here is a negative test to describe the problem. Mind you that you need a working connection for the test to work and this example code does not close anything to keep things simple. rs.next() should return false, because getGeneratedKeys() API documentation says Instead, with the new version it returns true, and value 0 is returned when no keys are generated.
|