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

SET STATEMENT gtid_domain_id = ... FOR has no effect (same for gtid_seq_no and server_id)

    Details

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

      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.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              sanja Oleksandr Byelkin added a comment -

              The variable is prohibited in SET STATEMENT for now.

              Show
              sanja Oleksandr Byelkin added a comment - The variable is prohibited in SET STATEMENT for now.
              Hide
              elenst Elena Stepanova added a comment -

              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 */                                                                      |
              ...
              
              Show
              elenst Elena Stepanova added a comment - 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 */ | ...
              Hide
              sanja Oleksandr Byelkin added a comment -

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

              Show
              sanja Oleksandr Byelkin added a comment - Here (as well as all bugs connected to binlog) cause is that we write binlog after restoring variables values.
              Hide
              sanja Oleksandr Byelkin added a comment -

              duplicate of 7006

              Show
              sanja Oleksandr Byelkin added a comment - duplicate of 7006

                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: