mariadb/mysql-test/suite/galera/r/galera_log_bin_ext.result
sara 9b6f87b62a MDEV-30892 test galera.galera_log_bin is not deterministic
galera.galera_log_bin test created the test tables and executed initial DML into node 2
Then connection is switched to node 1, where ALTER TABLE was attempted. But there is no guarantee that the table to alter was yet replicated to node 1.

The fix in this commit, creates the test tables in node 1 instead, so it is guaranteed that they are available for the later ALTER

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
2023-05-03 04:25:22 +02:00

69 lines
2.4 KiB
Text

connection node_2;
connection node_1;
connection node_1;
connection node_2;
connection node_2;
set global wsrep_on=OFF;
reset master;
set global wsrep_on=ON;
connection node_1;
set global wsrep_on=OFF;
reset master;
set global wsrep_on=ON;
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
CREATE TABLE t2 (id INT) ENGINE=InnoDB;
INSERT INTO t2 VALUES (1);
INSERT INTO t2 VALUES (1);
connection node_2;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
SELECT COUNT(*) = 2 FROM t2;
COUNT(*) = 2
1
connection node_1;
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
hostname1-bin.000001 # Gtid # # GTID #-#-#
hostname1-bin.000001 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB
hostname1-bin.000001 # Gtid # # BEGIN GTID #-#-#
hostname1-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (1)
hostname1-bin.000001 # Table_map # # table_id: # (test.t1)
hostname1-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
hostname1-bin.000001 # Xid # # COMMIT /* XID */
hostname1-bin.000001 # Gtid # # GTID #-#-#
hostname1-bin.000001 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB
hostname1-bin.000001 # Gtid # # BEGIN GTID #-#-#
hostname1-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1)
hostname1-bin.000001 # Table_map # # table_id: # (test.t2)
hostname1-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
hostname1-bin.000001 # Xid # # COMMIT /* XID */
hostname1-bin.000001 # Gtid # # BEGIN GTID #-#-#
hostname1-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1)
hostname1-bin.000001 # Table_map # # table_id: # (test.t2)
hostname1-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
hostname1-bin.000001 # Xid # # COMMIT /* XID */
hostname1-bin.000001 # Gtid # # GTID #-#-#
hostname1-bin.000001 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER
connection node_2;
Shutting down server ...
connection node_1;
Cleaning var directory ...
connection node_2;
Starting server ...
connection node_2;
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
COUNT(*) = 2
1
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
hostname1-bin.000002 # Binlog_checkpoint # # hostname1-bin.000002
DROP TABLE t1;
DROP TABLE t2;
#cleanup
connection node_1;
SET GLOBAL wsrep_on=OFF;
RESET MASTER;
SET GLOBAL wsrep_on=ON;