Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-39

When using the getGeneratedKeys() method, incorrent data is returned (depeneds on version)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.0, 1.1.1, 1.1.2
    • Fix Version/s: 1.1.3
    • Component/s: None
    • Labels:
      None
    • Environment:
      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.

        Attachments

          Activity

            People

            • Assignee:
              wlad Vladislav Vaintroub
              Reporter:
              amir@csl-int.com Amir Glaser (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 6 hours
                6h