[CONJ-1132] Inconsistency in getUpdateCount() Return Value for CREATE Statements Created: 2023-12-05 Updated: 2023-12-13 Resolved: 2023-12-13 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | batch |
| Affects Version/s: | 3.3.1 |
| Fix Version/s: | 3.3.2 |
| Type: | Bug | Priority: | Major |
| Reporter: | Wenqian Deng | Assignee: | Diego Dupin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
When CREATE statements are executed through executeBatch(), the subsequent call to getUpdateCount() returns -1, which is inconsistent with the behavior observed when executing CREATE statements using the execute() method, where getUpdateCount() returns 0. This behavior is also inconsistent with the MySQL Connector/J, which returns 0 in both scenarios.
|
| Comments |
| Comment by Diego Dupin [ 2023-12-05 ] | |||||||||||||||||||
|
Just to confirm, the example you indicate return the expected behavior (javadoc)
The problem reside in executeX when an error occur, updateCount not being reset:
(the example is the expected returns, but would return wrong result with current implementation, correction will be done) | |||||||||||||||||||
| Comment by Wenqian Deng [ 2023-12-06 ] | |||||||||||||||||||
|
Yes, your example is more reasonable than my description. |