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

SET STATEMENT last_insert_id FOR ... does not affect the value written to the binlog

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: N/A
    • Fix Version/s: 10.1.4
    • Component/s: Admin statements
    • Labels:
      None

      Description

      MariaDB [test]> set statement last_insert_id = 112 for create table tmp as select last_insert_id();
      Query OK, 1 row affected (1.30 sec)
      Records: 1  Duplicates: 0  Warnings: 0
      
      MariaDB [test]> show binlog events;
      ...
      | wheezy-64-bin.000001 | 316 | Gtid              |         1 |         354 | GTID 0-1-1                                                                                     |
      | wheezy-64-bin.000001 | 354 | Intvar            |         1 |         382 | LAST_INSERT_ID=0                                                                               |
      | wheezy-64-bin.000001 | 382 | Query             |         1 |         527 | use `test`; set statement last_insert_id = 112 for create table tmp as select last_insert_id() |
      +----------------------+-----+-------------------+-----------+-------------+------------------------------------------------------------------------------------------------+
      
      commit d6981391eb8f904135dfdedb5b90a7592b35e648
      Author: Oleksandr Byelkin <sanja@mariadb.com>
      Date:   Thu Oct 30 19:34:54 2014 +0100
      
          MDEV_6976: Assertion `! is_set() || m_can_overwrite_status' failed in Diagnostics_area::set_error_status on SET STATEMENT debug_sync
          
          DEBUG_SYNC has complex logic of using different from other variables so it is prohibited in SEt STATENT
      

      Percona server works okay.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              sanja Oleksandr Byelkin added a comment -

              The variable prohibited as a workaround.

              Show
              sanja Oleksandr Byelkin added a comment - The variable prohibited as a workaround.
              Hide
              sanja Oleksandr Byelkin added a comment - - edited

              Problem was in reinitialization of first_successful_insert_id_in_prev_stmt_for_binlog after setting variables.

              Show
              sanja Oleksandr Byelkin added a comment - - edited Problem was in reinitialization of first_successful_insert_id_in_prev_stmt_for_binlog after setting variables.
              Hide
              sanja Oleksandr Byelkin added a comment -

              Fixed test commit:

              revision-id: 60c1dc1ab24bfe9b3f4a898fe5e7cb070ee02cf7
              parent(s): d0d6284cab70af148269d95744f615454cac24bb
              committer: Oleksandr Byelkin
              branch nick: work-maria-10.1-MDEV-6997-real
              timestamp: 2015-02-25 19:00:57 +0100
              message:

              MDEV-6997: SET STATEMENT last_insert_id FOR ... does not affect the value written to the binlog

              Show
              sanja Oleksandr Byelkin added a comment - Fixed test commit: revision-id: 60c1dc1ab24bfe9b3f4a898fe5e7cb070ee02cf7 parent(s): d0d6284cab70af148269d95744f615454cac24bb committer: Oleksandr Byelkin branch nick: work-maria-10.1- MDEV-6997 -real timestamp: 2015-02-25 19:00:57 +0100 message: MDEV-6997 : SET STATEMENT last_insert_id FOR ... does not affect the value written to the binlog
              Hide
              sanja Oleksandr Byelkin added a comment -

              Checked with stored functions everything is OK.

              Show
              sanja Oleksandr Byelkin added a comment - Checked with stored functions everything is OK.
              Hide
              sanja Oleksandr Byelkin added a comment -

              revision-id: b7237786f5b8e74ba9558db8325d29a64f1a1d9b
              parent(s): ba3573cae8f0d269452cc6213f1a8243e455830e
              committer: Oleksandr Byelkin
              branch nick: server
              timestamp: 2015-03-13 16:32:47 +0100
              message:

              MDEV-6997: SET STATEMENT last_insert_id FOR ... does not affect the value written to the binlog

              Problem was in reinitialization of first_successful_insert_id_in_prev_stmt_for_binlog after setting variables.

              Show
              sanja Oleksandr Byelkin added a comment - revision-id: b7237786f5b8e74ba9558db8325d29a64f1a1d9b parent(s): ba3573cae8f0d269452cc6213f1a8243e455830e committer: Oleksandr Byelkin branch nick: server timestamp: 2015-03-13 16:32:47 +0100 message: MDEV-6997 : SET STATEMENT last_insert_id FOR ... does not affect the value written to the binlog Problem was in reinitialization of first_successful_insert_id_in_prev_stmt_for_binlog after setting variables.

                People

                • Assignee:
                  sanja Oleksandr Byelkin
                  Reporter:
                  elenst Elena Stepanova
                • 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 - 1 hour, 30 minutes
                    1h 30m