Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
1.1.0, 1.1.1, 1.1.2
-
None
-
None
-
Server: MySQL 5.0.26, running on SLES10 SP4
Client: Windows 7, running Java 1.6.26, MariaDB version 1.1.1 OR 1.1.2
Description
The incorrect data is returned when executing a prepared statement (using the Statement.RETURN_GENERATED_KEYS flag) which inserts several new rows into a table with an auto Increment column.
For version 1.1.0:
Invoking the getGeneratedKeys() method after the execute() method will yield a result set with the correct number of records, however the values in the returned records are all equal to the first index of the inserted rows. For example, if the statement triggered the creation of 3 records, with indexes 1,2,3, the getGeneratedKeys() method would return a result set with 3 records, each containing the value "1".
For version 1.1.1/1.1.2:
When invoking the getGeneratedKeys() method after the execute() method will yield a result set with a single record, which contains the value of the first new index created. For example, if the statement triggered the creation of 3 records, with indexes 1,2,3, the getGeneratedKeys() method would return a result set with 1 record containing the value "1".
The expected result would be to receive a result set where the number of records is equal to the number of new keys generated, and that the values for these records will be the actual inserted keys.