[CONJ-706] getGeneratedKey implementation correction for multiple result for one query Created: 2019-06-03 Updated: 2019-10-08 Resolved: 2019-08-02 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | batch |
| Affects Version/s: | None |
| Fix Version/s: | 2.4.2 |
| Type: | Bug | Priority: | Major |
| Reporter: | Diego Dupin | Assignee: | Diego Dupin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
When executing a single query, getGeneratedKey currently might return a resultset with multiple keys. example : But MariaDB protocol returns only one OK_Packet indicating first automatically generated Id and number of affected rows. This can cause alternate issues like INSERT ...ON DUPLICATE KEY that return 2 affected rows in case of existing ID. (And so returning 2 rows in getGeneratedKey) Driver must not trying to be better than what server returns. |
| Comments |
| Comment by Iwao AVE! [ 2019-08-02 ] |
|
Hi Diego, I noticed that your closed this issue, but the fix was reverted in [this commit](https://github.com/MariaDB/mariadb-connector-j/commit/fc4a288a5af34b48a4bd57d8d8abfe46dc70cd81) (which, I thought, was reasonable, BTW). |