Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-16593

mysql_stmt_insert_id returns first generated id when using MYSQL_TYPE_NULL

    XMLWordPrintable

    Details

      Description

      When inserting values into a table with auto_increment column via bulk operation, the result of mysql_stmt_insert_id() differs:
      In case buffer_type MYSQL_TYPE_NULL is used, or indicator variable was set to STMT_INDICATOR_IGNORE the values of first inserted row will be returned.

      Output from attached test case:

       Insert id with buffer_type MYSQL_TYPE_LONG: 2
       Max value for t1.a=2
       Insert id with buffer_type MYSQL_TYPE_NULL: 1
       Max value for t1.a=2
       Insert id with buffer_type STMT_INDICATOR_NULL: 1
       Max value for t1.a=2
      

        Attachments

          Activity

            People

            • Assignee:
              sanja Oleksandr Byelkin
              Reporter:
              georg Georg Richter
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: