rpl_deadlock.result
来自「视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.」· RESULT 代码 · 共 191 行
RESULT
191 行
stop slave;drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;reset master;reset slave;drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;start slave;create table t1 (a int not null, key(a)) engine=innodb;create table t2 (a int not null, key(a)) engine=innodb;create table t3 (a int unique) engine=innodb;create table t4 (a int) engine=innodb;show variables like 'slave_transaction_retries';Variable_name Valueslave_transaction_retries 10show create table t1;Table Create Tablet1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, KEY `a` (`a`)) ENGINE=InnoDB DEFAULT CHARSET=latin1show create table t2;Table Create Tablet2 CREATE TABLE `t2` ( `a` int(11) NOT NULL, KEY `a` (`a`)) ENGINE=InnoDB DEFAULT CHARSET=latin1show variables like 'slave_transaction_retries';Variable_name Valueslave_transaction_retries 2stop slave;begin;insert into t3 select * from t2 for update;insert into t1 values(1);commit;begin;select * from t1 for update;astart slave;insert into t2 values(201);commit;select * from t1;a1select * from t2;a201show slave status;Slave_IO_State #Master_Host 127.0.0.1Master_User rootMaster_Port MASTER_MYPORTConnect_Retry 1Master_Log_File master-bin.000001Read_Master_Log_Pos 18918Relay_Log_File #Relay_Log_Pos #Relay_Master_Log_File master-bin.000001Slave_IO_Running YesSlave_SQL_Running YesReplicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno 0Last_Error Skip_Counter 0Exec_Master_Log_Pos 18918Relay_Log_Space #Until_Condition NoneUntil_Log_File Until_Log_Pos 0Master_SSL_Allowed NoMaster_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master #stop slave;delete from t3;change master to master_log_pos=539;begin;select * from t2 for update;a201start slave;select count(*) from t3 /* must be zero */;count(*)0commit;select * from t1;a11select * from t2;a201show slave status;Slave_IO_State #Master_Host 127.0.0.1Master_User rootMaster_Port MASTER_MYPORTConnect_Retry 1Master_Log_File master-bin.000001Read_Master_Log_Pos 18918Relay_Log_File #Relay_Log_Pos #Relay_Master_Log_File master-bin.000001Slave_IO_Running #Slave_SQL_Running YesReplicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno 0Last_Error Skip_Counter 0Exec_Master_Log_Pos 18918Relay_Log_Space #Until_Condition NoneUntil_Log_File Until_Log_Pos 0Master_SSL_Allowed NoMaster_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master #set @my_max_relay_log_size= @@global.max_relay_log_size;set global max_relay_log_size=0;stop slave;delete from t3;change master to master_log_pos=539;begin;select * from t2 for update;a201start slave;select count(*) from t3 /* must be zero */;count(*)0commit;select * from t1;a111select * from t2;a201show slave status;Slave_IO_State #Master_Host 127.0.0.1Master_User rootMaster_Port MASTER_MYPORTConnect_Retry 1Master_Log_File master-bin.000001Read_Master_Log_Pos 18918Relay_Log_File #Relay_Log_Pos #Relay_Master_Log_File master-bin.000001Slave_IO_Running #Slave_SQL_Running YesReplicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno 0Last_Error Skip_Counter 0Exec_Master_Log_Pos 18918Relay_Log_Space #Until_Condition NoneUntil_Log_File Until_Log_Pos 0Master_SSL_Allowed NoMaster_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master #drop table t1,t2,t3,t4;set global max_relay_log_size= @my_max_relay_log_size;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?