mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-31 02:46:29 +01:00 
			
		
		
		
	 9b6f87b62a
			
		
	
	
	9b6f87b62a
	
	
	
		
			
			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>
		
			
				
	
	
		
			81 lines
		
	
	
	
		
			3.3 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			81 lines
		
	
	
	
		
			3.3 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
| connection node_2;
 | |
| connection node_1;
 | |
| 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
 | |
| mysqld-bin.000001	#	Gtid	#	#	GTID #-#-#
 | |
| mysqld-bin.000001	#	Query	#	#	use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB
 | |
| mysqld-bin.000001	#	Gtid	#	#	BEGIN GTID #-#-#
 | |
| mysqld-bin.000001	#	Annotate_rows	#	#	INSERT INTO t1 VALUES (1)
 | |
| mysqld-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
 | |
| mysqld-bin.000001	#	Write_rows_v1	#	#	table_id: # flags: STMT_END_F
 | |
| mysqld-bin.000001	#	Xid	#	#	COMMIT /* XID */
 | |
| mysqld-bin.000001	#	Gtid	#	#	GTID #-#-#
 | |
| mysqld-bin.000001	#	Query	#	#	use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB
 | |
| mysqld-bin.000001	#	Gtid	#	#	BEGIN GTID #-#-#
 | |
| mysqld-bin.000001	#	Annotate_rows	#	#	INSERT INTO t2 VALUES (1)
 | |
| mysqld-bin.000001	#	Table_map	#	#	table_id: # (test.t2)
 | |
| mysqld-bin.000001	#	Write_rows_v1	#	#	table_id: # flags: STMT_END_F
 | |
| mysqld-bin.000001	#	Xid	#	#	COMMIT /* XID */
 | |
| mysqld-bin.000001	#	Gtid	#	#	BEGIN GTID #-#-#
 | |
| mysqld-bin.000001	#	Annotate_rows	#	#	INSERT INTO t2 VALUES (1)
 | |
| mysqld-bin.000001	#	Table_map	#	#	table_id: # (test.t2)
 | |
| mysqld-bin.000001	#	Write_rows_v1	#	#	table_id: # flags: STMT_END_F
 | |
| mysqld-bin.000001	#	Xid	#	#	COMMIT /* XID */
 | |
| mysqld-bin.000001	#	Gtid	#	#	GTID #-#-#
 | |
| mysqld-bin.000001	#	Query	#	#	use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER
 | |
| 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
 | |
| mysqld-bin.000001	#	Gtid	#	#	GTID #-#-#
 | |
| mysqld-bin.000001	#	Query	#	#	use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB
 | |
| mysqld-bin.000001	#	Gtid	#	#	BEGIN GTID #-#-#
 | |
| mysqld-bin.000001	#	Annotate_rows	#	#	INSERT INTO t1 VALUES (1)
 | |
| mysqld-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
 | |
| mysqld-bin.000001	#	Write_rows_v1	#	#	table_id: # flags: STMT_END_F
 | |
| mysqld-bin.000001	#	Xid	#	#	COMMIT /* XID */
 | |
| mysqld-bin.000001	#	Gtid	#	#	GTID #-#-#
 | |
| mysqld-bin.000001	#	Query	#	#	use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB
 | |
| mysqld-bin.000001	#	Gtid	#	#	BEGIN GTID #-#-#
 | |
| mysqld-bin.000001	#	Annotate_rows	#	#	INSERT INTO t2 VALUES (1)
 | |
| mysqld-bin.000001	#	Table_map	#	#	table_id: # (test.t2)
 | |
| mysqld-bin.000001	#	Write_rows_v1	#	#	table_id: # flags: STMT_END_F
 | |
| mysqld-bin.000001	#	Xid	#	#	COMMIT /* XID */
 | |
| mysqld-bin.000001	#	Gtid	#	#	BEGIN GTID #-#-#
 | |
| mysqld-bin.000001	#	Annotate_rows	#	#	INSERT INTO t2 VALUES (1)
 | |
| mysqld-bin.000001	#	Table_map	#	#	table_id: # (test.t2)
 | |
| mysqld-bin.000001	#	Write_rows_v1	#	#	table_id: # flags: STMT_END_F
 | |
| mysqld-bin.000001	#	Xid	#	#	COMMIT /* XID */
 | |
| mysqld-bin.000001	#	Gtid	#	#	GTID #-#-#
 | |
| mysqld-bin.000001	#	Query	#	#	use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER
 | |
| DROP TABLE t1;
 | |
| DROP TABLE t2;
 | |
| #cleanup
 | |
| connection node_1;
 | |
| SET GLOBAL wsrep_on=OFF;
 | |
| RESET MASTER;
 | |
| SET GLOBAL wsrep_on=ON;
 |