Commit 5a5fc343 authored by unknown's avatar unknown
Browse files

Last part of fix for BUG#7998 "Replication should be more clever about when to...

Last part of fix for BUG#7998 "Replication should be more clever about when to replicate RELEASE_LOCK()" + fixes after merge


mysql-test/r/drop_temp_table.result:
  result update
mysql-test/r/mix_innodb_myisam_binlog.result:
  result update
mysql-test/r/rpl000001.result:
  result update
mysql-test/r/rpl_change_master.result:
  result update
mysql-test/r/rpl_deadlock.result:
  result update (merge)
mysql-test/t/rpl000001.test:
  can't rely on GET_LOCK() to do slave synchro (use table lock instead)
mysql-test/t/rpl_change_master.test:
  changing the test as we can't use GET_LOCK() for slave synchro
mysql-test/t/rpl_deadlock.test:
  update (merge) binlog positions
mysql-test/t/rpl_get_lock.test:
  comment
parent 1972aa7d
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -18,5 +18,4 @@ master-bin.000001 # Query 1 # use `drop-temp+table-test`; create temporary table
master-bin.000001	#	Query	1	#	use `drop-temp+table-test`; create temporary table `table:name` (a int)
master-bin.000001	#	Query	1	#	use `drop-temp+table-test`; create temporary table shortn2 (a int)
master-bin.000001	#	Query	1	#	use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`shortn2`,`drop-temp+table-test`.`table:name`,`drop-temp+table-test`.`shortn1`
master-bin.000001	#	Query	1	#	use `drop-temp+table-test`; DO RELEASE_LOCK("a")
drop database `drop-temp+table-test`;
+0 −1
Original line number Diff line number Diff line
@@ -93,7 +93,6 @@ master-bin.000001 96 Query 1 # use `test`; BEGIN
master-bin.000001	165	Query	1	#	use `test`; insert into t1 values(8)
master-bin.000001	253	Query	1	#	use `test`; insert into t2 select * from t1
master-bin.000001	348	Query	1	#	use `test`; ROLLBACK
master-bin.000001	420	Query	1	#	use `test`; DO RELEASE_LOCK("a")
delete from t1;
delete from t2;
reset master;
+2 −17
Original line number Diff line number Diff line
@@ -33,27 +33,12 @@ select sum(length(word)) from t1;
sum(length(word))
1022
drop table t1,t3;
create table t1 (n int) engine=myisam;
reset master;
stop slave;
reset slave;
create table t1(n int);
select get_lock("hold_slave",10);
get_lock("hold_slave",10)
1
explain extended select get_lock("hold_slave",10);
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
Warnings:
Note	1003	select sql_no_cache get_lock(_latin1'hold_slave',10) AS `get_lock("hold_slave",10)`
lock tables t1 read;
start slave;
select release_lock("hold_slave");
release_lock("hold_slave")
1
explain extended select release_lock("hold_slave");
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
Warnings:
Note	1003	select sql_no_cache release_lock(_latin1'hold_slave') AS `release_lock("hold_slave")`
unlock tables;
create table t2(id int);
insert into t2 values(connection_id());
+6 −12
Original line number Diff line number Diff line
@@ -4,26 +4,20 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
select get_lock("a",5);
get_lock("a",5)
1
create table t1(n int);
insert into t1 values(1+get_lock("a",15)*0);
insert into t1 values(2);
stop slave;
select * from t1;
n
1
stop slave sql_thread;
insert into t1 values(1);
insert into t1 values(2);
stop slave;
show slave status;
Slave_IO_State	Master_Host	Master_User	Master_Port	Connect_Retry	Master_Log_File	Read_Master_Log_Pos	Relay_Log_File	Relay_Log_Pos	Relay_Master_Log_File	Slave_IO_Running	Slave_SQL_Running	Replicate_Do_DB	Replicate_Ignore_DB	Replicate_Do_Table	Replicate_Ignore_Table	Replicate_Wild_Do_Table	Replicate_Wild_Ignore_Table	Last_Errno	Last_Error	Skip_Counter	Exec_Master_Log_Pos	Relay_Log_Space	Until_Condition	Until_Log_File	Until_Log_Pos	Master_SSL_Allowed	Master_SSL_CA_File	Master_SSL_CA_Path	Master_SSL_Cert	Master_SSL_Cipher	Master_SSL_Key	Seconds_Behind_Master
#	127.0.0.1	root	MASTER_MYPORT	1	master-bin.000001	377	#	#	master-bin.000001	No	No							0		0	289	#	None		0	No						#
#	127.0.0.1	root	MASTER_MYPORT	1	master-bin.000001	358	#	#	master-bin.000001	No	No							0		0	182	#	None		0	No						#
change master to master_user='root';
show slave status;
Slave_IO_State	Master_Host	Master_User	Master_Port	Connect_Retry	Master_Log_File	Read_Master_Log_Pos	Relay_Log_File	Relay_Log_Pos	Relay_Master_Log_File	Slave_IO_Running	Slave_SQL_Running	Replicate_Do_DB	Replicate_Ignore_DB	Replicate_Do_Table	Replicate_Ignore_Table	Replicate_Wild_Do_Table	Replicate_Wild_Ignore_Table	Last_Errno	Last_Error	Skip_Counter	Exec_Master_Log_Pos	Relay_Log_Space	Until_Condition	Until_Log_File	Until_Log_Pos	Master_SSL_Allowed	Master_SSL_CA_File	Master_SSL_CA_Path	Master_SSL_Cert	Master_SSL_Cipher	Master_SSL_Key	Seconds_Behind_Master
#	127.0.0.1	root	MASTER_MYPORT	1	master-bin.000001	289	#	#	master-bin.000001	No	No							0		0	289	#	None		0	No						#
select release_lock("a");
release_lock("a")
1
#	127.0.0.1	root	MASTER_MYPORT	1	master-bin.000001	182	#	#	master-bin.000001	No	No							0		0	182	#	None		0	No						#
start slave;
select * from t1;
n
+7 −7
Original line number Diff line number Diff line
@@ -11,13 +11,13 @@ create table t4 (a int) engine=innodb;
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` int(11) NOT NULL default '0',
  `a` int(11) NOT NULL,
  KEY `a` (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
show create table t2;
Table	Create Table
t2	CREATE TABLE `t2` (
  `a` int(11) NOT NULL default '0',
  `a` int(11) NOT NULL,
  KEY `a` (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
stop slave;
@@ -39,9 +39,9 @@ a
22
show slave status;
Slave_IO_State	Master_Host	Master_User	Master_Port	Connect_Retry	Master_Log_File	Read_Master_Log_Pos	Relay_Log_File	Relay_Log_Pos	Relay_Master_Log_File	Slave_IO_Running	Slave_SQL_Running	Replicate_Do_DB	Replicate_Ignore_DB	Replicate_Do_Table	Replicate_Ignore_Table	Replicate_Wild_Do_Table	Replicate_Wild_Ignore_Table	Last_Errno	Last_Error	Skip_Counter	Exec_Master_Log_Pos	Relay_Log_Space	Until_Condition	Until_Log_File	Until_Log_Pos	Master_SSL_Allowed	Master_SSL_CA_File	Master_SSL_CA_Path	Master_SSL_Cert	Master_SSL_Cipher	Master_SSL_Key	Seconds_Behind_Master
#	127.0.0.1	root	MASTER_MYPORT	1	master-bin.000001	13110	#	#	master-bin.000001	Yes	Yes							0		0	13110	#	None		0	No						#
#	127.0.0.1	root	MASTER_MYPORT	1	master-bin.000001	19116	#	#	master-bin.000001	Yes	Yes							0		0	19116	#	None		0	No						#
stop slave;
change master to master_log_pos=401;
change master to master_log_pos=534;
begin;
select * from t2 for update;
a
@@ -57,10 +57,10 @@ a
22
show slave status;
Slave_IO_State	Master_Host	Master_User	Master_Port	Connect_Retry	Master_Log_File	Read_Master_Log_Pos	Relay_Log_File	Relay_Log_Pos	Relay_Master_Log_File	Slave_IO_Running	Slave_SQL_Running	Replicate_Do_DB	Replicate_Ignore_DB	Replicate_Do_Table	Replicate_Ignore_Table	Replicate_Wild_Do_Table	Replicate_Wild_Ignore_Table	Last_Errno	Last_Error	Skip_Counter	Exec_Master_Log_Pos	Relay_Log_Space	Until_Condition	Until_Log_File	Until_Log_Pos	Master_SSL_Allowed	Master_SSL_CA_File	Master_SSL_CA_Path	Master_SSL_Cert	Master_SSL_Cipher	Master_SSL_Key	Seconds_Behind_Master
#	127.0.0.1	root	MASTER_MYPORT	1	master-bin.000001	13110	#	#	master-bin.000001	Yes	Yes							0		0	13110	#	None		0	No						#
#	127.0.0.1	root	MASTER_MYPORT	1	master-bin.000001	19116	#	#	master-bin.000001	Yes	Yes							0		0	19116	#	None		0	No						#
set global max_relay_log_size=0;
stop slave;
change master to master_log_pos=401;
change master to master_log_pos=534;
begin;
select * from t2 for update;
a
@@ -77,5 +77,5 @@ a
22
show slave status;
Slave_IO_State	Master_Host	Master_User	Master_Port	Connect_Retry	Master_Log_File	Read_Master_Log_Pos	Relay_Log_File	Relay_Log_Pos	Relay_Master_Log_File	Slave_IO_Running	Slave_SQL_Running	Replicate_Do_DB	Replicate_Ignore_DB	Replicate_Do_Table	Replicate_Ignore_Table	Replicate_Wild_Do_Table	Replicate_Wild_Ignore_Table	Last_Errno	Last_Error	Skip_Counter	Exec_Master_Log_Pos	Relay_Log_Space	Until_Condition	Until_Log_File	Until_Log_Pos	Master_SSL_Allowed	Master_SSL_CA_File	Master_SSL_CA_Path	Master_SSL_Cert	Master_SSL_Cipher	Master_SSL_Key	Seconds_Behind_Master
#	127.0.0.1	root	MASTER_MYPORT	1	master-bin.000001	13110	#	#	master-bin.000001	Yes	Yes							0		0	13110	#	None		0	No						#
#	127.0.0.1	root	MASTER_MYPORT	1	master-bin.000001	19116	#	#	master-bin.000001	Yes	Yes							0		0	19116	#	None		0	No						#
drop table t1,t2;
Loading