[MDEV-6997] SET STATEMENT last_insert_id FOR ... does not affect the value written to the binlog Created: 2014-11-01  Updated: 2015-03-14  Resolved: 2015-03-14

Status: Closed
Project: MariaDB Server
Component/s: Admin statements
Affects Version/s: N/A
Fix Version/s: 10.1.4

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Oleksandr Byelkin
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-5231 Per query variables from Percona Serv... Closed
relates to MDEV-6923 Testing for SET STATEMENT .. FOR (MDE... Closed

 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.



 Comments   
Comment by Oleksandr Byelkin [ 2014-11-05 ]

The variable prohibited as a workaround.

Comment by Oleksandr Byelkin [ 2014-11-11 ]

Problem was in reinitialization of first_successful_insert_id_in_prev_stmt_for_binlog after setting variables.

Comment by Oleksandr Byelkin [ 2015-02-25 ]

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

Comment by Oleksandr Byelkin [ 2015-03-06 ]

Checked with stored functions everything is OK.

Comment by Oleksandr Byelkin [ 2015-03-13 ]

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.

Generated at Thu Feb 08 07:16:10 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.