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

getGeneratedKey implementation correction for multiple result for one query

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4.2
    • Component/s: batch
    • Labels:
      None

      Description

      When executing a single query, getGeneratedKey currently might return a resultset with multiple keys.

      example :
      INSERT INTO testMultiGeneratedKey (text) VALUES ('someValue'), ('someOtherValue');

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              diego dupin Diego Dupin
              Reporter:
              diego dupin Diego Dupin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration