[MDEV-6948] SET STATEMENT gtid_domain_id = ... FOR has no effect (same for gtid_seq_no and server_id) Created: 2014-10-27  Updated: 2015-03-12  Resolved: 2014-11-28

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

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Oleksandr Byelkin
Resolution: Duplicate 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   

Test case

--source include/have_log_bin.inc
 
create table t1 (i int);
set gtid_domain_id = 10;
insert into t1 values (1),(2);
set statement gtid_domain_id = 20 for insert into t1 values (3),(4);
show binlog events;
 
drop table t1;

Binary log

show binlog events;
Log_name	Pos	Event_type	Server_id	End_log_pos	Info
master-bin.000001	4	Format_desc	1	248	Server ver: 10.1.1-MariaDB-wsrep-debug-log, Binlog ver: 4
master-bin.000001	248	Gtid_list	1	273	[]
master-bin.000001	273	Binlog_checkpoint	1	313	master-bin.000001
master-bin.000001	313	Gtid	1	351	GTID 0-1-1
master-bin.000001	351	Query	1	437	use `test`; create table t1 (i int)
master-bin.000001	437	Gtid	1	475	BEGIN GTID 10-1-1
master-bin.000001	475	Query	1	567	use `test`; insert into t1 values (1),(2)
master-bin.000001	567	Query	1	636	COMMIT
master-bin.000001	636	Gtid	1	674	BEGIN GTID 10-1-2
master-bin.000001	674	Query	1	804	use `test`; set statement gtid_domain_id = 20 for insert into t1 values (3),(4)
master-bin.000001	804	Query	1	873	COMMIT

bb-10.1-set-statement tree

commit e64f5d8f758bcc1a8856ba9fba01780533f80747
Author: Oleksandr Byelkin <sanja@mariadb.com>
Date:   Sun Oct 26 16:27:54 2014 +0100
 
    Fixed test suite global variable saving

Same is true for other variables that participate in GTID generation – gtid_seq_no and server_id.



 Comments   
Comment by Oleksandr Byelkin [ 2014-10-29 ]

The variable is prohibited in SET STATEMENT for now.

Comment by Elena Stepanova [ 2014-11-03 ]

What about gtid_seq_no and server_id?

Interestingly, it works for DDL, but not for DML:

MariaDB [test]> set statement gtid_seq_no = 11, server_id = 111 for create table t1 (i int);
Query OK, 0 rows affected (1.07 sec)
 
MariaDB [test]> set statement gtid_seq_no = 22, server_id = 222 for insert into t1 values (1);
Query OK, 1 row affected (0.08 sec)

MariaDB [test]> show binlog events;
...
| wheezy-64-bin.000001 | 468 | Gtid              |       111 |         506 | GTID 0-111-11                                                                             |
| wheezy-64-bin.000001 | 506 | Query             |       111 |         644 | use `test`; set statement gtid_seq_no = 11, server_id = 111 for create table t1 (i int)   |
| wheezy-64-bin.000001 | 644 | Gtid              |         2 |         682 | BEGIN GTID 0-2-12                                                                         |
| wheezy-64-bin.000001 | 682 | Query             |       222 |         822 | use `test`; set statement gtid_seq_no = 22, server_id = 222 for insert into t1 values (1) |
| wheezy-64-bin.000001 | 822 | Xid               |         2 |         849 | COMMIT /* xid=465 */                                                                      |
...

Comment by Oleksandr Byelkin [ 2014-11-11 ]

Here (as well as all bugs connected to binlog) cause is that we write binlog after restoring variables values.

Comment by Oleksandr Byelkin [ 2014-11-28 ]

duplicate of 7006

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