1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-31723: Crash on SET SESSION gtid_seq_no= DEFAULT

A simple "SET SESSION gtid_seq_no= DEFAULT" did not work, it would straight
up crash the server! Also, explicitly setting gtid_seq_no to 0 gave an error
in --gtid-strict-mode=1.

Setting to DEFAULT or 0 should disable any prior setting of
gtid_seq_no, so that the next transaction is allocated the next GTID
in sequence, as normal.

Reviewed-by: Monty <monty@mariadb.org>
Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
This commit is contained in:
Kristian Nielsen
2023-07-17 15:06:50 +02:00
parent 9854fb6fa7
commit d632c85bb7
6 changed files with 176 additions and 7 deletions

View File

@ -555,6 +555,62 @@ a
32
33
34
*** MDEV-31723: Crash on SET SESSION gtid_seq_no= DEFAULT
connection server_1;
SET SESSION gtid_seq_no= 2000;
SELECT @@SESSION.gtid_seq_no;
@@SESSION.gtid_seq_no
2000
INSERT INTO t1 VALUES (40);
SELECT @@SESSION.gtid_seq_no;
@@SESSION.gtid_seq_no
0
SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
dom0_pos
0-1-2000
INSERT INTO t1 VALUES (41);
SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
dom0_pos
0-1-2001
SET SESSION gtid_seq_no= 2010;
INSERT INTO t1 VALUES (42);
SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
dom0_pos
0-1-2010
SET @old_strict= @@GLOBAL.gtid_strict_mode;
SET GLOBAL gtid_strict_mode= 1;
SET SESSION gtid_seq_no= 0;
INSERT INTO t1 VALUES (43);
SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
dom0_pos
0-1-2011
SET GLOBAL gtid_strict_mode= @old_strict;
INSERT INTO t1 VALUES (44);
SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
dom0_pos
0-1-2012
SET SESSION gtid_seq_no= 2020;
SET SESSION gtid_seq_no= 2030;
INSERT INTO t1 VALUES (45);
SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
dom0_pos
0-1-2030
SET SESSION gtid_seq_no= 2040;
SET SESSION gtid_seq_no= DEFAULT;
INSERT INTO t1 VALUES (46);
SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
dom0_pos
0-1-2031
INSERT INTO t1 VALUES (47);
SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
dom0_pos
0-1-2032
SET SESSION gtid_seq_no= 2050;
SET SESSION gtid_seq_no= 0;
INSERT INTO t1 VALUES (48);
SELECT REGEXP_REPLACE(@@gtid_binlog_pos, ".*\\b(0-1-[0-9]+)\\b.*", "\\1") AS dom0_pos;
dom0_pos
0-1-2033
connection server_1;
DROP TABLE t1;
include/rpl_end.inc