1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-26: Global Transaction ID.

Improvements to record_gtid():

 - Check for correct table definition of mysql.rpl_slave_state
 - Use autocommit, to save one call to ha_commit_trans()
 - Slightly more efficient way to set table->write_set
 - Use ha_index_read_map() to locate rows to support any storage engine.
This commit is contained in:
unknown
2013-03-11 12:07:09 +01:00
parent 1baa0a57df
commit 320863530f
4 changed files with 155 additions and 15 deletions

View File

@ -0,0 +1,56 @@
--source include/have_innodb.inc
--source include/master-slave.inc
--echo *** Test that we check against incorrect table definition for mysql.rpl_slave_state ***
--connection master
CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
--sync_slave_with_master
--connection slave
--source include/stop_slave.inc
ALTER TABLE mysql.rpl_slave_state CHANGE seq_no seq_no VARCHAR(20);
START SLAVE;
--connection master
INSERT INTO t1 VALUES (1);
--connection slave
CALL mtr.add_suppression("Slave: Failed to open mysql.rpl_slave_state");
--let $slave_sql_errno=1942
--source include/wait_for_slave_sql_error.inc
--source include/stop_slave.inc
ALTER TABLE mysql.rpl_slave_state CHANGE seq_no seq_no BIGINT UNSIGNED NOT NULL;
ALTER TABLE mysql.rpl_slave_state DROP PRIMARY KEY;
ALTER TABLE mysql.rpl_slave_state ADD PRIMARY KEY (sub_id, domain_id);
START SLAVE;
--let $slave_sql_errno=1942
--source include/wait_for_slave_sql_error.inc
--source include/stop_slave.inc
ALTER TABLE mysql.rpl_slave_state DROP PRIMARY KEY;
START SLAVE;
--let $slave_sql_errno=1942
--source include/wait_for_slave_sql_error.inc
--source include/stop_slave.inc
ALTER TABLE mysql.rpl_slave_state ADD PRIMARY KEY (sub_id);
START SLAVE;
--let $slave_sql_errno=1942
--source include/wait_for_slave_sql_error.inc
--source include/stop_slave.inc
ALTER TABLE mysql.rpl_slave_state DROP PRIMARY KEY;
ALTER TABLE mysql.rpl_slave_state ADD PRIMARY KEY (domain_id, sub_id);
--source include/start_slave.inc
--connection master
--sync_slave_with_master
--connection slave
SELECT * FROM t1;
--connection master
DROP TABLE t1;
--source include/rpl_end.inc