[CONJ-1038] Regression - Prepared Statement executeBatch returns SUCCESS_NO_INFO Created: 2023-01-09 Updated: 2023-01-10 Resolved: 2023-01-10 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | 2.7 compatibility |
| Affects Version/s: | 3.0.0, 3.0.3, 3.0.5, 3.1.0 |
| Fix Version/s: | 3.2.0 |
| Type: | Bug | Priority: | Major |
| Reporter: | Arthur Borsboom | Assignee: | Diego Dupin |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | regression | ||
| Environment: |
Arch Linux, OpenJDK 18 |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
After upgrading the MariaDB Java connector in a web application from v2.7.5 to v3.1.0 one of the JUnit tests started failing. When the method 'executeBatch()' is called on a PreparedStatement, then it returns "SUCCESS_NO_INFO". I have created a reproducible Java application, see attachment. If this application is run with v2.7.7, then it returns an array of update counts. To me this looks like a regression where v3.1.0 breaks backwards compatibility. |
| Comments |
| Comment by Diego Dupin [ 2023-01-10 ] |
|
JDBC permit that, but yes this is a change of behavior that is discussed on https://jira.mariadb.org/browse/CONJ-920. These behavior can be disable setting option 'useBulkStmts' to false. Current behavior permit way better performance, but at this cost.
|
| Comment by Arthur Borsboom [ 2023-01-10 ] |
|
Hi Diego, I agree that the behavior is according to the JDBC specification. I understand that this is a choice between functionality (the row counts) and performance (faster inserts / updates). Nevertheless, the behavior has changed in a way that it breaks the application I am maintaining. So from that perspective, I still believe this is a regression, since it breaks backwards compatibility. I confirm that adding "?useBulkStmts=false" to the jdbcUrl restores the functionality for v3.1.0 Once v3.2.0 is released I will retest and might come back to see how the application can keep its functionality (at the cost of performance). Thanks for the quick response. |