Commit ee12b055 authored by Alice Sherepa's avatar Alice Sherepa

reenable tests from engines/funcs

parent 4020e4ae
# List of disabled tests # List of disabled tests
# test name : comment # test name : comment
rpl_redirect : Fails due to bug#49978
crash_manycolumns_string : Bug#50495 'Row size too large' for plugin, but works for built-in innodb
ix_unique_lob : Bug#52283 Innodb reports extra warnings when SELECT/WHERE is performed using invalid value
ix_unique_string_length : Bug#52283 Innodb reports extra warnings when SELECT/WHERE is performed using invalid value
rpl_empty_master_crash : Test not applicable in 5.5+
rpl_REDIRECT : Test not applicable in 5.5+
rpl_create_database : Result Difference Due To Change In .inc file crash_manycolumns_string : Bug#50495 'Row size too large' for plugin, but works for built-in innodb [ERROR] InnoDB: Cannot add field `c726` in table `test`.`t1` because after adding it, the row size is 8135 which is greater than maximum allowed size (8126 bytes) for a record on index leaf page
rpl_loaddata_m : Result Difference Due To Change In .inc file
rpl_sp_effects : Result Difference Due To Change In .inc file
rpl_variables : Result Difference Due To Change In .inc file
rpl_loaddata_s : Result Difference Due To Change In .inc file
rpl_dual_pos_advance : Result Difference Due To Change In .inc file
rpl000011 : Result Difference Due To Change In .inc file
rpl000013 : Result Difference Due To Change In .inc file
rpl_000015 : Result Difference Due To Change In .inc file
rpl_LD_INFILE : Result Difference Due To Change In .inc file
rpl_alter : Result Difference Due To Change In .inc file
rpl_alter_db : Result Difference Due To Change In .inc file
rpl_alter_db : Result Difference Due To Change In .inc file
rpl_bit : Result Difference Due To Change In .inc file
rpl_bit_npk : Result Difference Due To Change In .inc file
rpl_change_master : Result Difference Due To Change In .inc file
rpl_do_grant : Result Difference Due To Change In .inc file
rpl_drop : Result Difference Due To Change In .inc file
rpl_drop_db : Result Difference Due To Change In .inc file
rpl_flushlog_loop : Result Difference Due To Change In .inc file
rpl_get_lock : Result Difference Due To Change In .inc file
rpl_get_lock : Result Difference Due To Change In .inc file
rpl_insert : Result Difference Due To Change In .inc file
rpl_insert_select : Result Difference Due To Change In .inc file
rpl_loaddata2 : Result Difference Due To Change In .inc file
rpl_loaddatalocal : Result Difference Due To Change In .inc file
rpl_loadfile : Result Difference Due To Change In .inc file
rpl_log_pos : Result Difference Due To Change In .inc file
rpl_many_optimize : Result Difference Due To Change In .inc file
rpl_master_pos_wait : Result Difference Due To Change In .inc file
rpl_misc_functions : Result Difference Due To Change In .inc file
rpl_ps : Result Difference Due To Change In .inc file
rpl_server_id1 : Result Difference Due To Change In .inc file
rpl_session_var : Result Difference Due To Change In .inc file
rpl_sf : Result Difference Due To Change In .inc file
rpl_slave_status : Result Difference Due To Change In .inc file
rpl_sp004 : Result Difference Due To Change In .inc file
rpl_start_stop_slave : Result Difference Due To Change In .inc file
rpl_stm_max_relay_size : Result Difference Due To Change In .inc file
rpl_stm_mystery22 : Result Difference Due To Change In .inc file
rpl_stm_no_op : Result Difference Due To Change In .inc file
rpl_stm_reset_slave : Result Difference Due To Change In .inc file
rpl_temp_table : Result Difference Due To Change In .inc file
rpl_temporary : Result Difference Due To Change In .inc file
rpl_trigger : Result Difference Due To Change In .inc file
rpl_trunc_temp : Result Difference Due To Change In .inc file
rpl_user_variables : Result Difference Due To Change In .inc file
rpl_server_id2 : Result Difference Due To Change In .inc file
rpl000010 : Result Difference Due To Change In .inc file
rpl_init_slave : Result Difference Due To Change In .inc file
rpl_multi_delete2 : Result Difference Due To Change In .inc file
rpl_view : Result Difference Due To Change In .inc file
rpl_ignore_table_update : Result Difference Due To Change In .inc file
rpl_err_ignoredtable : Result Difference Due To Change In .inc file
rpl_multi_update4 : Result Difference Due To Change In .inc file
rpl_multi_delete : Result Difference Due To Change In .inc file
rpl_ignore_grant : Result Difference Due To Change In .inc file
rpl_ignore_revoke : Result Difference Due To Change In .inc file
rpl_free_items : Result Difference Due To Change In .inc file
rpl_replicate_ignore_db : Result Difference Due To Change In .inc file
rpl000017 : Result Difference Due To Change In .inc file
rpl_skip_error : Result Difference Due To Change In .inc file
rpl_loaddata_s : Test Present in rpl suite as well . Test Fails due to bin log truncation.
rpl_log_pos : Test Present in rpl suite as well . Test Fails due to bin log truncation.
rpl_row_NOW : Result Difference Due To Change In .inc file
rpl_row_USER : Result Difference Due To Change In .inc file
rpl_row_drop : Result Difference Due To Change In .inc file
rpl_row_func001 : Result Difference Due To Change In .inc file
rpl_row_max_relay_size : Result Difference Due To Change In .inc file
rpl_row_reset_slave : Result Difference Due To Change In .inc file
rpl_row_sp001 : Result Difference Due To Change In .inc file
rpl_row_sp005 : Result Difference Due To Change In .inc file
rpl_row_sp008 : Result Difference Due To Change In .inc file
rpl_row_sp009 : Result Difference Due To Change In .inc file
rpl_row_sp010 : Result Difference Due To Change In .inc file
rpl_row_sp011 : Result Difference Due To Change In .inc file
rpl_row_sp012 : Result Difference Due To Change In .inc file
rpl_row_stop_middle : Result Difference Due To Change In .inc file
rpl_row_trig001 : Result Difference Due To Change In .inc file
rpl_row_trig002 : Result Difference Due To Change In .inc file
rpl_row_trig003 : Result Difference Due To Change In .inc file
rpl_row_view01 : Result Difference Due To Change In .inc file
rpl_switch_stm_row_mixed : Result Difference Due To Change In .inc file
rpl_relayspace : Result Difference Due To Change In .inc file
rpl_row_inexist_tbl : Result Difference Due To Change In .inc file
rpl_sp : Result Difference Due To Change In .inc file
rpl_rbr_to_sbr : Result Difference Due To Change In .inc file
...@@ -7,7 +7,7 @@ t4 ...@@ -7,7 +7,7 @@ t4
SHOW CREATE TABLE t4; SHOW CREATE TABLE t4;
Table Create Table Table Create Table
t4 CREATE TABLE `t4` ( t4 CREATE TABLE `t4` (
`c1` tinyblob, `c1` tinyblob DEFAULT NULL,
UNIQUE KEY `i1` (`c1`(100)) UNIQUE KEY `i1` (`c1`(100))
) ENGINE=ENGINE DEFAULT CHARSET=latin1 ) ENGINE=ENGINE DEFAULT CHARSET=latin1
DROP TABLE t4; DROP TABLE t4;
...@@ -21,7 +21,7 @@ t4 ...@@ -21,7 +21,7 @@ t4
SHOW CREATE TABLE t4; SHOW CREATE TABLE t4;
Table Create Table Table Create Table
t4 CREATE TABLE `t4` ( t4 CREATE TABLE `t4` (
`c1` blob, `c1` blob DEFAULT NULL,
UNIQUE KEY `i1` (`c1`(100)) UNIQUE KEY `i1` (`c1`(100))
) ENGINE=ENGINE DEFAULT CHARSET=latin1 ) ENGINE=ENGINE DEFAULT CHARSET=latin1
DROP TABLE t4; DROP TABLE t4;
...@@ -35,7 +35,7 @@ t4 ...@@ -35,7 +35,7 @@ t4
SHOW CREATE TABLE t4; SHOW CREATE TABLE t4;
Table Create Table Table Create Table
t4 CREATE TABLE `t4` ( t4 CREATE TABLE `t4` (
`c1` mediumblob, `c1` mediumblob DEFAULT NULL,
UNIQUE KEY `i1` (`c1`(100)) UNIQUE KEY `i1` (`c1`(100))
) ENGINE=ENGINE DEFAULT CHARSET=latin1 ) ENGINE=ENGINE DEFAULT CHARSET=latin1
DROP TABLE t4; DROP TABLE t4;
...@@ -49,7 +49,7 @@ t4 ...@@ -49,7 +49,7 @@ t4
SHOW CREATE TABLE t4; SHOW CREATE TABLE t4;
Table Create Table Table Create Table
t4 CREATE TABLE `t4` ( t4 CREATE TABLE `t4` (
`c1` longblob, `c1` longblob DEFAULT NULL,
UNIQUE KEY `i1` (`c1`(100)) UNIQUE KEY `i1` (`c1`(100))
) ENGINE=ENGINE DEFAULT CHARSET=latin1 ) ENGINE=ENGINE DEFAULT CHARSET=latin1
DROP TABLE t4; DROP TABLE t4;
...@@ -63,7 +63,7 @@ t4 ...@@ -63,7 +63,7 @@ t4
SHOW CREATE TABLE t4; SHOW CREATE TABLE t4;
Table Create Table Table Create Table
t4 CREATE TABLE `t4` ( t4 CREATE TABLE `t4` (
`c1` tinytext, `c1` tinytext DEFAULT NULL,
UNIQUE KEY `i1` (`c1`(100)) UNIQUE KEY `i1` (`c1`(100))
) ENGINE=ENGINE DEFAULT CHARSET=latin1 ) ENGINE=ENGINE DEFAULT CHARSET=latin1
DROP TABLE t4; DROP TABLE t4;
...@@ -77,7 +77,7 @@ t4 ...@@ -77,7 +77,7 @@ t4
SHOW CREATE TABLE t4; SHOW CREATE TABLE t4;
Table Create Table Table Create Table
t4 CREATE TABLE `t4` ( t4 CREATE TABLE `t4` (
`c1` text, `c1` text DEFAULT NULL,
UNIQUE KEY `i1` (`c1`(100)) UNIQUE KEY `i1` (`c1`(100))
) ENGINE=ENGINE DEFAULT CHARSET=latin1 ) ENGINE=ENGINE DEFAULT CHARSET=latin1
DROP TABLE t4; DROP TABLE t4;
...@@ -91,7 +91,7 @@ t4 ...@@ -91,7 +91,7 @@ t4
SHOW CREATE TABLE t4; SHOW CREATE TABLE t4;
Table Create Table Table Create Table
t4 CREATE TABLE `t4` ( t4 CREATE TABLE `t4` (
`c1` mediumtext, `c1` mediumtext DEFAULT NULL,
UNIQUE KEY `i1` (`c1`(100)) UNIQUE KEY `i1` (`c1`(100))
) ENGINE=ENGINE DEFAULT CHARSET=latin1 ) ENGINE=ENGINE DEFAULT CHARSET=latin1
DROP TABLE t4; DROP TABLE t4;
...@@ -105,7 +105,7 @@ t4 ...@@ -105,7 +105,7 @@ t4
SHOW CREATE TABLE t4; SHOW CREATE TABLE t4;
Table Create Table Table Create Table
t4 CREATE TABLE `t4` ( t4 CREATE TABLE `t4` (
`c1` longtext, `c1` longtext DEFAULT NULL,
UNIQUE KEY `i1` (`c1`(100)) UNIQUE KEY `i1` (`c1`(100))
) ENGINE=ENGINE DEFAULT CHARSET=latin1 ) ENGINE=ENGINE DEFAULT CHARSET=latin1
DROP TABLE t4; DROP TABLE t4;
......
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;
stop slave;
grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab';
grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab';
start slave;
drop table if exists t1;
create table t1(n int);
insert into t1 values(24);
select * from t1;
n
24
drop table t1;
delete from mysql.user where user="replicate";
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1 (n int not null auto_increment primary key); create table t1 (n int not null auto_increment primary key);
insert into t1 values(NULL); insert into t1 values(NULL);
insert into t1 values(2); insert into t1 values(2);
connection slave;
select n from t1; select n from t1;
n n
1 1
2 2
connection master;
drop table t1; drop table t1;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1 (n int); create table t1 (n int);
insert into t1 values(1); insert into t1 values(1);
stop slave; connection slave;
start slave; include/stop_slave.inc
include/start_slave.inc
connection master;
insert into t1 values(2); insert into t1 values(2);
connection slave;
select * from t1; select * from t1;
n n
1 1
2 2
connection master;
drop table t1; drop table t1;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t2(n int); create table t2(n int);
create temporary table t1 (n int); create temporary table t1 (n int);
insert into t1 values(1),(2),(3); insert into t1 values(1),(2),(3);
insert into t2 select * from t1; insert into t2 select * from t1;
connection master1;
create temporary table t1 (n int); create temporary table t1 (n int);
insert into t1 values (4),(5); insert into t1 values (4),(5);
insert into t2 select * from t1 as t10; insert into t2 select * from t1 as t10;
disconnect master;
connection slave;
connection master1;
insert into t2 values(6); insert into t2 values(6);
disconnect master1;
connection slave;
select * from t2; select * from t2;
n n
1 1
...@@ -23,6 +25,9 @@ n ...@@ -23,6 +25,9 @@ n
show status like 'Slave_open_temp_tables'; show status like 'Slave_open_temp_tables';
Variable_name Value Variable_name Value
Slave_open_temp_tables 0 Slave_open_temp_tables 0
connect master2,localhost,root,,;
connection master2;
drop table if exists t1,t2; drop table if exists t1,t2;
Warnings: Warnings:
Note 1051 Unknown table 't1' Note 1051 Unknown table 'test.t1'
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
reset master; reset master;
show master status; show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 107 master-bin.000001 329
stop slave; connection slave;
include/stop_slave.inc
reset slave; reset slave;
show slave status; show slave status;
Slave_IO_State # Slave_IO_State #
...@@ -51,6 +48,16 @@ Last_SQL_Errno 0 ...@@ -51,6 +48,16 @@ Last_SQL_Errno 0
Last_SQL_Error Last_SQL_Error
Replicate_Ignore_Server_Ids Replicate_Ignore_Server_Ids
Master_Server_Id 1 Master_Server_Id 1
Master_SSL_Crl
Master_SSL_Crlpath
Using_Gtid No
Gtid_IO_Pos
Replicate_Do_Domain_Ids
Replicate_Ignore_Domain_Ids
Parallel_Mode conservative
SQL_Delay 0
SQL_Remaining_Delay NULL
Slave_SQL_Running_State
change master to master_host='127.0.0.1'; change master to master_host='127.0.0.1';
show slave status; show slave status;
Slave_IO_State # Slave_IO_State #
...@@ -93,6 +100,16 @@ Last_SQL_Errno 0 ...@@ -93,6 +100,16 @@ Last_SQL_Errno 0
Last_SQL_Error Last_SQL_Error
Replicate_Ignore_Server_Ids Replicate_Ignore_Server_Ids
Master_Server_Id 1 Master_Server_Id 1
Master_SSL_Crl
Master_SSL_Crlpath
Using_Gtid No
Gtid_IO_Pos
Replicate_Do_Domain_Ids
Replicate_Ignore_Domain_Ids
Parallel_Mode conservative
SQL_Delay 0
SQL_Remaining_Delay NULL
Slave_SQL_Running_State
change master to master_host='127.0.0.1',master_user='root', change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=MASTER_PORT; master_password='',master_port=MASTER_PORT;
show slave status; show slave status;
...@@ -136,7 +153,17 @@ Last_SQL_Errno 0 ...@@ -136,7 +153,17 @@ Last_SQL_Errno 0
Last_SQL_Error Last_SQL_Error
Replicate_Ignore_Server_Ids Replicate_Ignore_Server_Ids
Master_Server_Id 1 Master_Server_Id 1
start slave; Master_SSL_Crl
Master_SSL_Crlpath
Using_Gtid No
Gtid_IO_Pos
Replicate_Do_Domain_Ids
Replicate_Ignore_Domain_Ids
Parallel_Mode conservative
SQL_Delay 0
SQL_Remaining_Delay NULL
Slave_SQL_Running_State
include/start_slave.inc
show slave status; show slave status;
Slave_IO_State Waiting for master to send event Slave_IO_State Waiting for master to send event
Master_Host 127.0.0.1 Master_Host 127.0.0.1
...@@ -144,9 +171,9 @@ Master_User root ...@@ -144,9 +171,9 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 1 Connect_Retry 1
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos 107 Read_Master_Log_Pos 329
Relay_Log_File slave-relay-bin.000002 Relay_Log_File slave-relay-bin.000002
Relay_Log_Pos 254 Relay_Log_Pos 629
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes Slave_IO_Running Yes
Slave_SQL_Running Yes Slave_SQL_Running Yes
...@@ -159,8 +186,8 @@ Replicate_Wild_Ignore_Table ...@@ -159,8 +186,8 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 107 Exec_Master_Log_Pos 329
Relay_Log_Space 410 Relay_Log_Space 938
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
Until_Log_Pos 0 Until_Log_Pos 0
...@@ -178,15 +205,31 @@ Last_SQL_Errno 0 ...@@ -178,15 +205,31 @@ Last_SQL_Errno 0
Last_SQL_Error Last_SQL_Error
Replicate_Ignore_Server_Ids Replicate_Ignore_Server_Ids
Master_Server_Id 1 Master_Server_Id 1
Master_SSL_Crl
Master_SSL_Crlpath
Using_Gtid No
Gtid_IO_Pos
Replicate_Do_Domain_Ids
Replicate_Ignore_Domain_Ids
Parallel_Mode conservative
SQL_Delay 0
SQL_Remaining_Delay NULL
Slave_SQL_Running_State Slave has read all relay log; waiting for the slave I/O thread to update it
connection master;
drop table if exists t1; drop table if exists t1;
create table t1 (n int, PRIMARY KEY(n)); create table t1 (n int, PRIMARY KEY(n));
insert into t1 values (10),(45),(90); insert into t1 values (10),(45),(90);
connection slave;
connection slave;
SELECT * FROM t1 ORDER BY n; SELECT * FROM t1 ORDER BY n;
n 10 n 10
n 45 n 45
n 90 n 90
connection master;
SELECT * FROM t1 ORDER BY n; SELECT * FROM t1 ORDER BY n;
n 10 n 10
n 45 n 45
n 90 n 90
drop table t1; drop table t1;
connection slave;
include/rpl_end.inc
source include/master-slave.inc; include/master-slave.inc
[connection master]
connection slave; connection slave;
stop slave;
connection master; connection master;
grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab'; grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab';
grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab'; grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab';
connection slave; connection slave;
start slave; include/start_slave.inc
connection master; connection master;
--disable_warnings
drop table if exists t1;
--enable_warnings
create table t1(n int); create table t1(n int);
insert into t1 values(24); insert into t1 values(24);
sync_slave_with_master; connection slave;
select * from t1; select * from t1;
n
24
connection master; connection master;
drop table t1; drop table t1;
delete from mysql.user where user="replicate"; delete from mysql.user where user="replicate";
sync_slave_with_master; include/rpl_end.inc
# End of 4.1 tests
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (a VARCHAR(255), PRIMARY KEY(a)); CREATE TABLE test.t1 (a VARCHAR(255), PRIMARY KEY(a));
LOAD DATA INFILE '../../std_data/words2.dat' INTO TABLE test.t1; LOAD DATA INFILE '../../std_data/words2.dat' INTO TABLE test.t1;
...@@ -62,6 +59,8 @@ abasements ...@@ -62,6 +59,8 @@ abasements
abasement abasement
abased abased
abase abase
connection slave;
connection slave;
SELECT * FROM test.t1 ORDER BY a DESC; SELECT * FROM test.t1 ORDER BY a DESC;
a a
aberration aberration
...@@ -114,4 +113,7 @@ abasements ...@@ -114,4 +113,7 @@ abasements
abasement abasement
abased abased
abase abase
connection master;
DROP TABLE test.t1; DROP TABLE test.t1;
connection slave;
include/rpl_end.inc
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;
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 Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error
SHOW SLAVE HOSTS;
Server_id Host Port Rpl_recovery_rank Master_id
2 127.0.0.1 SLAVE_PORT 0 1
create table t1 ( n int);
insert into t1 values (1),(2),(3),(4);
insert into t1 values(5);
SELECT * FROM t1 ORDER BY n;
n
1
2
3
4
5
SELECT * FROM t1 ORDER BY n;
n
1
2
3
4
SELECT * FROM t1 ORDER BY n;
n
1
2
3
4
SELECT * FROM t1 ORDER BY n;
n
1
2
3
4
5
drop table t1;
@@ -29,7 +29,7 @@
`a` int(10) unsigned NOT NULL,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
insert into t1 (a) values (1),((1<<32)-1);
select * from t1;
a b
@@ -42,7 +42,7 @@
`a` bigint(20) NOT NULL,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
select * from t1;
a b
1 NULL
@@ -54,7 +54,7 @@
`a` int(10) unsigned NOT NULL,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
select * from t1;
a b
1 NULL
@@ -66,7 +66,7 @@
`a` bigint(20) unsigned NOT NULL,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
select * from t1;
a b
1 NULL
@@ -83,7 +83,7 @@
`a` bigint(20) unsigned NOT NULL,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
connection master;
create table t2 (a int unsigned auto_increment primary key, b int);
show create table t2;
@@ -92,7 +92,7 @@
`a` int(10) unsigned NOT NULL AUTO_INCREMENT,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
alter table t2 modify a bigint;
show create table t2;
Table Create Table
@@ -100,7 +100,7 @@
`a` bigint(20) NOT NULL,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
alter table t2 modify a bigint auto_increment;
show create table t2;
Table Create Table
@@ -108,7 +108,7 @@
`a` bigint(20) NOT NULL AUTO_INCREMENT,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1,t2;
#
# MDEV-8432: Slave cannot replicate signed integer-type values
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop database if exists mysqltest;
create database mysqltest; create database mysqltest;
create table mysqltest.t1 ( n int); create table mysqltest.t1 ( n int);
alter table mysqltest.t1 add m int; alter table mysqltest.t1 add m int;
...@@ -12,10 +7,126 @@ insert into mysqltest.t1 values (1,2); ...@@ -12,10 +7,126 @@ insert into mysqltest.t1 values (1,2);
create table mysqltest.t2 (n int); create table mysqltest.t2 (n int);
insert into mysqltest.t2 values (45); insert into mysqltest.t2 values (45);
rename table mysqltest.t2 to mysqltest.t3, mysqltest.t1 to mysqltest.t2; rename table mysqltest.t2 to mysqltest.t3, mysqltest.t1 to mysqltest.t2;
connection slave;
select * from mysqltest.t2; select * from mysqltest.t2;
n m n m
1 2 1 2
select * from mysqltest.t3; select * from mysqltest.t3;
n n
45 45
connection master;
drop database mysqltest; drop database mysqltest;
connection slave;
connection master;
use test;
#
# Test bug where ALTER TABLE MODIFY didn't replicate properly
#
create table t1 (a int unsigned primary key, b int);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(10) unsigned NOT NULL,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 (a) values (1),((1<<32)-1);
select * from t1;
a b
1 NULL
4294967295 NULL
alter table t1 modify a bigint;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bigint(20) NOT NULL,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t1;
a b
1 NULL
4294967295 NULL
alter table t1 modify a int unsigned;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(10) unsigned NOT NULL,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t1;
a b
1 NULL
4294967295 NULL
alter table t1 modify a bigint unsigned;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bigint(20) unsigned NOT NULL,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t1;
a b
1 NULL
4294967295 NULL
connection slave;
use test;
select * from t1;
a b
1 NULL
4294967295 NULL
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bigint(20) unsigned NOT NULL,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
connection master;
create table t2 (a int unsigned auto_increment primary key, b int);
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` int(10) unsigned NOT NULL AUTO_INCREMENT,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
alter table t2 modify a bigint;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` bigint(20) NOT NULL,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
alter table t2 modify a bigint auto_increment;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` bigint(20) NOT NULL AUTO_INCREMENT,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1,t2;
#
# MDEV-8432: Slave cannot replicate signed integer-type values
# with high bit set to 1
# Test replication when we have int on master and bigint on slave
#
create table t1 (a int unsigned primary key, b int);
connection slave;
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
alter table t1 modify a bigint unsigned;
connection master;
insert into t1 (a) values (1),((1<<32)-1);
connection slave;
select * from t1;
a b
1 NULL
4294967295 NULL
SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
connection master;
drop table t1;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; ==== Verify that alter database does not stop replication ====
reset slave; create database temp_db;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; use temp_db;
start slave;
use mysql;
alter database collate latin1_bin; alter database collate latin1_bin;
alter database collate latin1_swedish_ci; connection slave;
==== Clean up ====
connection master;
drop database temp_db;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 ( CREATE TABLE test.t1 (
dummyKey INTEGER NOT NULL, dummyKey INTEGER NOT NULL,
...@@ -95,6 +92,7 @@ hex(bit3) ...@@ -95,6 +92,7 @@ hex(bit3)
15 15
24 24
35 35
connection slave;
SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1; SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1;
oSupp sSuppD GSuppDf VNotSupp x034 oSupp sSuppD GSuppDf VNotSupp x034
5 5 3 2 1 5 5 3 2 1
...@@ -135,4 +133,7 @@ hex(bit3) ...@@ -135,4 +133,7 @@ hex(bit3)
15 15
24 24
35 35
connection master;
DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t1;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 ( CREATE TABLE test.t1 (
dummyKey INTEGER NOT NULL, dummyKey INTEGER NOT NULL,
...@@ -98,6 +95,7 @@ hex(bit3) ...@@ -98,6 +95,7 @@ hex(bit3)
15 15
24 24
35 35
connection slave;
SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034
FROM test.t1 FROM test.t1
ORDER BY oSupp, sSuppD, GSuppDf, VNotSupp, x034; ORDER BY oSupp, sSuppD, GSuppDf, VNotSupp, x034;
...@@ -140,6 +138,7 @@ hex(bit3) ...@@ -140,6 +138,7 @@ hex(bit3)
15 15
24 24
35 35
connection master;
CREATE TABLE test.t2 (a INT, b BIT(1)); CREATE TABLE test.t2 (a INT, b BIT(1));
INSERT INTO test.t2 VALUES (1, b'0'); INSERT INTO test.t2 VALUES (1, b'0');
INSERT INTO test.t2 VALUES (1, b'1'); INSERT INTO test.t2 VALUES (1, b'1');
...@@ -156,6 +155,7 @@ SELECT * FROM test.t3 ORDER BY a,b; ...@@ -156,6 +155,7 @@ SELECT * FROM test.t3 ORDER BY a,b;
a b a b
1 NULL 1 NULL
2 0 2 0
connection slave;
SELECT a, hex(b) FROM test.t2 ORDER BY a,b; SELECT a, hex(b) FROM test.t2 ORDER BY a,b;
a hex(b) a hex(b)
1 0 1 0
...@@ -164,6 +164,9 @@ SELECT * FROM test.t3 ORDER BY a,b; ...@@ -164,6 +164,9 @@ SELECT * FROM test.t3 ORDER BY a,b;
a b a b
1 NULL 1 NULL
2 0 2 0
connection master;
DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2; DROP TABLE IF EXISTS test.t2;
DROP TABLE IF EXISTS test.t3; DROP TABLE IF EXISTS test.t3;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; call mtr.add_suppression("Slave I/O: The slave I/O thread stops because a fatal error is encountered when it tried to SET @master_binlog_checksum");
reset slave; connection master;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1(n int); create table t1(n int);
connection slave;
select * from t1; select * from t1;
n n
stop slave sql_thread; stop slave sql_thread;
connection master;
insert into t1 values(1); insert into t1 values(1);
insert into t1 values(2); insert into t1 values(2);
stop slave; connection slave;
show slave status; include/wait_for_slave_param.inc [Read_Master_Log_Pos]
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 Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id include/stop_slave.inc
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 192 # None 0 No # No 0 0 1
change master to master_user='root'; 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 Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 192 # None 0 No # No 0 0 1
start slave; start slave;
select * from t1; select * from t1;
n n
1 1
2 2
connection master;
drop table t1; drop table t1;
connection slave;
connection master;
CHANGE MASTER TO MASTER_USER='root', MASTER_SSL=0, MASTER_SSL_CA='', MASTER_SSL_CERT='',
MASTER_SSL_KEY='', MASTER_SSL_CRL='', MASTER_SSL_CRLPATH='';
CHANGE MASTER TO MASTER_USER='root', MASTER_PASSWORD='', MASTER_SSL=0;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
DROP DATABASE IF EXISTS mysqltest_prometheus; DROP DATABASE IF EXISTS mysqltest_prometheus;
DROP DATABASE IF EXISTS mysqltest_sisyfos; DROP DATABASE IF EXISTS mysqltest_sisyfos;
DROP DATABASE IF EXISTS mysqltest_bob; DROP DATABASE IF EXISTS mysqltest_bob;
connection slave;
DROP DATABASE IF EXISTS mysqltest_bob; DROP DATABASE IF EXISTS mysqltest_bob;
connection master;
CREATE DATABASE mysqltest_prometheus; CREATE DATABASE mysqltest_prometheus;
CREATE DATABASE mysqltest_sisyfos; CREATE DATABASE mysqltest_sisyfos;
CREATE DATABASE mysqltest_bob; CREATE DATABASE mysqltest_bob;
...@@ -20,25 +18,19 @@ INSERT INTO t2 VALUES(2); ...@@ -20,25 +18,19 @@ INSERT INTO t2 VALUES(2);
ALTER DATABASE mysqltest_sisyfos CHARACTER SET latin1; ALTER DATABASE mysqltest_sisyfos CHARACTER SET latin1;
USE mysqltest_sisyfos; USE mysqltest_sisyfos;
ALTER DATABASE mysqltest_bob CHARACTER SET latin1; ALTER DATABASE mysqltest_bob CHARACTER SET latin1;
SHOW DATABASES; SHOW DATABASES LIKE 'mysql%';
Database Database (mysql%)
information_schema
mtr
mysql mysql
mysqltest_bob mysqltest_bob
mysqltest_prometheus mysqltest_prometheus
mysqltest_sisyfos mysqltest_sisyfos
performance_schema connection slave;
test SHOW DATABASES LIKE 'mysql%';
SHOW DATABASES; Database (mysql%)
Database
information_schema
mtr
mysql mysql
mysqltest_prometheus mysqltest_prometheus
mysqltest_sisyfos mysqltest_sisyfos
performance_schema connection master;
test
DROP DATABASE IF EXISTS mysqltest_sisyfos; DROP DATABASE IF EXISTS mysqltest_sisyfos;
USE mysqltest_prometheus; USE mysqltest_prometheus;
CREATE TABLE t1 (a INT); CREATE TABLE t1 (a INT);
...@@ -46,25 +38,18 @@ INSERT INTO t1 VALUES (1); ...@@ -46,25 +38,18 @@ INSERT INTO t1 VALUES (1);
CREATE DATABASE mysqltest_sisyfos; CREATE DATABASE mysqltest_sisyfos;
USE mysqltest_sisyfos; USE mysqltest_sisyfos;
CREATE TABLE t2 (a INT); CREATE TABLE t2 (a INT);
SHOW DATABASES; SHOW DATABASES LIKE 'mysql%';
Database Database (mysql%)
information_schema
mtr
mysql mysql
mysqltest_bob mysqltest_bob
mysqltest_prometheus mysqltest_prometheus
mysqltest_sisyfos mysqltest_sisyfos
performance_schema connection slave;
test SHOW DATABASES LIKE 'mysql%';
SHOW DATABASES; Database (mysql%)
Database
information_schema
mtr
mysql mysql
mysqltest_prometheus mysqltest_prometheus
mysqltest_sisyfos mysqltest_sisyfos
performance_schema
test
USE mysqltest_prometheus; USE mysqltest_prometheus;
SHOW TABLES; SHOW TABLES;
Tables_in_mysqltest_prometheus Tables_in_mysqltest_prometheus
...@@ -73,6 +58,9 @@ USE mysqltest_sisyfos; ...@@ -73,6 +58,9 @@ USE mysqltest_sisyfos;
SHOW TABLES; SHOW TABLES;
Tables_in_mysqltest_sisyfos Tables_in_mysqltest_sisyfos
t2 t2
connection master;
DROP DATABASE IF EXISTS mysqltest_prometheus; DROP DATABASE IF EXISTS mysqltest_prometheus;
DROP DATABASE IF EXISTS mysqltest_sisyfos; DROP DATABASE IF EXISTS mysqltest_sisyfos;
DROP DATABASE IF EXISTS mysqltest_bob; DROP DATABASE IF EXISTS mysqltest_bob;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop table if exists t1, t2;
create table t1 (a int); create table t1 (a int);
drop table t1, t2; drop table t1, t2;
ERROR 42S02: Unknown table 't2' ERROR 42S02: Unknown table 'test.t2'
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop database if exists mysqltest1; drop database if exists mysqltest1;
create database mysqltest1; create database mysqltest1;
create table mysqltest1.t1 (n int); create table mysqltest1.t1 (n int);
...@@ -12,18 +9,20 @@ select * from mysqltest1.t1 into outfile 'mysqltest1/f1.txt'; ...@@ -12,18 +9,20 @@ select * from mysqltest1.t1 into outfile 'mysqltest1/f1.txt';
create table mysqltest1.t2 (n int); create table mysqltest1.t2 (n int);
create table mysqltest1.t3 (n int); create table mysqltest1.t3 (n int);
drop database mysqltest1; drop database mysqltest1;
ERROR HY000: Error dropping database (can't rmdir './mysqltest1/', errno: 17) ERROR HY000: Error dropping database (can't rmdir './mysqltest1', errno: 39 "Directory not empty")
use mysqltest1; use mysqltest1;
show tables; show tables;
Tables_in_mysqltest1 Tables_in_mysqltest1
drop database mysqltest1; drop database mysqltest1;
ERROR HY000: Error dropping database (can't rmdir './mysqltest1/', errno: 17) ERROR HY000: Error dropping database (can't rmdir './mysqltest1', errno: 39 "Directory not empty")
use mysqltest1; use mysqltest1;
show tables; show tables;
Tables_in_mysqltest1 Tables_in_mysqltest1
use test; use test;
create table t1 (n int); create table t1 (n int);
insert into t1 values (1234); insert into t1 values (1234);
connection slave;
connection slave;
use mysqltest1; use mysqltest1;
show tables; show tables;
Tables_in_mysqltest1 Tables_in_mysqltest1
...@@ -31,9 +30,9 @@ use test; ...@@ -31,9 +30,9 @@ use test;
select * from t1; select * from t1;
n n
1234 1234
drop table t1; connection master;
stop slave;
drop database mysqltest1;
drop database mysqltest1;
use test; use test;
drop table t1; drop table t1;
drop database mysqltest1;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection slave;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
reset master; reset master;
connection master;
change master to master_host="127.0.0.1",master_port=SLAVE_PORT,master_user="root"; change master to master_host="127.0.0.1",master_port=SLAVE_PORT,master_user="root";
start slave; include/start_slave.inc
connection slave;
create table t1 (n int); create table t1 (n int);
connection master;
connection master;
create table t4 (n int); create table t4 (n int);
create table t5 (n int); create table t5 (n int);
create table t6 (n int); create table t6 (n int);
connection slave;
connection slave;
connection master;
show tables; show tables;
Tables_in_test Tables_in_test
t1 t1
t4 t4
t5 t5
t6 t6
stop slave; include/stop_slave.inc
reset slave; reset slave;
drop table t1,t4,t5,t6; drop table t1,t4,t5,t6;
connection slave;
include/rpl_end.inc
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;
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 Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error
load table t1 from master;
ERROR 08S01: Error connecting to master: Master is not configured
load table t1 from master;
ERROR HY000: Error from master: 'Table 'test.t1' doesn't exist'
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1 (a int primary key); create table t1 (a int primary key);
create table t4 (a int primary key); create table t4 (a int primary key);
insert into t1 values (1),(1); insert into t1 values (1),(1);
Got one of the listed errors Got one of the listed errors
insert into t4 values (1),(2); insert into t4 values (1),(2);
connection slave;
show tables like 't1'; show tables like 't1';
Tables_in_test (t1) Tables_in_test (t1)
show tables like 't4'; show tables like 't4';
...@@ -18,25 +16,36 @@ SELECT * FROM test.t4 ORDER BY a; ...@@ -18,25 +16,36 @@ SELECT * FROM test.t4 ORDER BY a;
a a
1 1
2 2
connection master;
drop table t1; drop table t1;
connection slave;
connection master1;
select get_lock('crash_lock%20C', 10); select get_lock('crash_lock%20C', 10);
get_lock('crash_lock%20C', 10) get_lock('crash_lock%20C', 10)
1 1
connection master;
create table t2 (a int primary key); create table t2 (a int primary key);
insert into t2 values(1); insert into t2 values(1);
create table t3 (id int); create table t3 (id int);
insert into t3 values(connection_id()); insert into t3 values(connection_id());
update t2 set a = a + 1 + get_lock('crash_lock%20C', 10); update t2 set a = a + 1 + get_lock('crash_lock%20C', 10);
connection master1;
select (@id := id) - id from t3; select (@id := id) - id from t3;
(@id := id) - id (@id := id) - id
0 0
kill @id; kill @id;
drop table t2,t3; drop table t2,t3;
insert into t4 values (3),(4); insert into t4 values (3),(4);
connection master;
connection master1;
connection slave;
SELECT * FROM test.t4 ORDER BY a; SELECT * FROM test.t4 ORDER BY a;
a a
1 1
2 2
3 3
4 4
connection master1;
DROP TABLE test.t4; DROP TABLE test.t4;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection slave;
reset slave; include/stop_slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
stop slave;
change master to master_host='127.0.0.1',master_user='root', change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=MASTER_PORT; master_password='',master_port=MASTER_PORT;
start slave; include/start_slave.inc
stop slave; connection master;
change master to master_host='127.0.0.1',master_user='root', change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=SLAVE_PORT; master_password='',master_port=SLAVE_PORT;
start slave; include/start_slave.inc
let $result_pattern= '%127.0.0.1%root%slave-bin.000001%slave-bin.000001%Yes%Yes%0%0%None%' ;
--source include/wait_slave_status.inc
flush logs; flush logs;
SHOW SLAVE STATUS; SHOW SLAVE STATUS;
Slave_IO_State # Slave_IO_State #
...@@ -24,7 +17,7 @@ Master_User root ...@@ -24,7 +17,7 @@ Master_User root
Master_Port SLAVE_PORT Master_Port SLAVE_PORT
Connect_Retry 60 Connect_Retry 60
Master_Log_File slave-bin.000001 Master_Log_File slave-bin.000001
Read_Master_Log_Pos 107 Read_Master_Log_Pos 328
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File slave-bin.000001 Relay_Master_Log_File slave-bin.000001
...@@ -39,7 +32,7 @@ Replicate_Wild_Ignore_Table ...@@ -39,7 +32,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 107 Exec_Master_Log_Pos 328
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
...@@ -58,4 +51,15 @@ Last_SQL_Errno 0 ...@@ -58,4 +51,15 @@ Last_SQL_Errno 0
Last_SQL_Error Last_SQL_Error
Replicate_Ignore_Server_Ids Replicate_Ignore_Server_Ids
Master_Server_Id 2 Master_Server_Id 2
STOP SLAVE; Master_SSL_Crl
Master_SSL_Crlpath
Using_Gtid No
Gtid_IO_Pos
Replicate_Do_Domain_Ids
Replicate_Ignore_Domain_Ids
Parallel_Mode conservative
SQL_Delay 0
SQL_Remaining_Delay NULL
Slave_SQL_Running_State Slave has read all relay log; waiting for the slave I/O thread to update it
stop slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1 (a int); create table t1 (a int);
create table t2 (a int); create table t2 (a int);
connection slave;
connection master;
drop table t1; drop table t1;
drop table t2; drop table t2;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1(n int); create table t1(n int);
insert into t1 values(get_lock("lock",2)); insert into t1 values(get_lock("lock",2));
disconnect master;
connection master1;
select get_lock("lock",2); select get_lock("lock",2);
get_lock("lock",2) get_lock("lock",2)
1 1
select release_lock("lock"); select release_lock("lock");
release_lock("lock") release_lock("lock")
1 1
connection slave;
select get_lock("lock",3); select get_lock("lock",3);
get_lock("lock",3) get_lock("lock",3)
1 1
...@@ -32,4 +32,7 @@ is_free_lock("lock2") ...@@ -32,4 +32,7 @@ is_free_lock("lock2")
select is_free_lock(NULL); select is_free_lock(NULL);
is_free_lock(NULL) is_free_lock(NULL)
NULL NULL
connection master1;
drop table t1; drop table t1;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection master;
reset slave; set sql_mode="";
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
delete from mysql.user where user=_binary'rpl_ignore_grant'; delete from mysql.user where user=_binary'rpl_ignore_grant';
delete from mysql.db where user=_binary'rpl_ignore_grant'; delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges; flush privileges;
connection slave;
set sql_mode="";
delete from mysql.user where user=_binary'rpl_ignore_grant'; delete from mysql.user where user=_binary'rpl_ignore_grant';
delete from mysql.db where user=_binary'rpl_ignore_grant'; delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges; flush privileges;
connection master;
grant select on *.* to rpl_ignore_grant@localhost; grant select on *.* to rpl_ignore_grant@localhost;
grant drop on test.* to rpl_ignore_grant@localhost; grant drop on test.* to rpl_ignore_grant@localhost;
show grants for rpl_ignore_grant@localhost; show grants for rpl_ignore_grant@localhost;
Grants for rpl_ignore_grant@localhost Grants for rpl_ignore_grant@localhost
GRANT SELECT ON *.* TO 'rpl_ignore_grant'@'localhost' GRANT SELECT ON *.* TO 'rpl_ignore_grant'@'localhost'
GRANT DROP ON `test`.* TO 'rpl_ignore_grant'@'localhost' GRANT DROP ON `test`.* TO 'rpl_ignore_grant'@'localhost'
connection slave;
show grants for rpl_ignore_grant@localhost; show grants for rpl_ignore_grant@localhost;
ERROR 42000: There is no such grant defined for user 'rpl_ignore_grant' on host 'localhost' ERROR 42000: There is no such grant defined for user 'rpl_ignore_grant' on host 'localhost'
select count(*) from mysql.user where user=_binary'rpl_ignore_grant'; select count(*) from mysql.user where user=_binary'rpl_ignore_grant';
...@@ -25,13 +27,19 @@ select count(*) from mysql.db where user=_binary'rpl_ignore_grant'; ...@@ -25,13 +27,19 @@ select count(*) from mysql.db where user=_binary'rpl_ignore_grant';
count(*) count(*)
0 0
grant select on *.* to rpl_ignore_grant@localhost; grant select on *.* to rpl_ignore_grant@localhost;
connection master;
set password for rpl_ignore_grant@localhost=password("does it work?"); set password for rpl_ignore_grant@localhost=password("does it work?");
connection slave;
select password<>_binary'' from mysql.user where user=_binary'rpl_ignore_grant'; select password<>_binary'' from mysql.user where user=_binary'rpl_ignore_grant';
password<>_binary'' password<>_binary''
0 0
connection master;
delete from mysql.user where user=_binary'rpl_ignore_grant'; delete from mysql.user where user=_binary'rpl_ignore_grant';
delete from mysql.db where user=_binary'rpl_ignore_grant'; delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges; flush privileges;
connection slave;
delete from mysql.user where user=_binary'rpl_ignore_grant'; delete from mysql.user where user=_binary'rpl_ignore_grant';
delete from mysql.db where user=_binary'rpl_ignore_grant'; delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges; flush privileges;
connection master;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
grant select on *.* to 'user_foo'@'%' identified by 'user_foopass'; grant select on *.* to 'user_foo'@'%' identified by 'user_foopass';
revoke select on *.* from 'user_foo'@'%'; revoke select on *.* from 'user_foo'@'%';
select select_priv from mysql.user where user='user_foo' /* master:must be N */; select select_priv from mysql.user where user='user_foo' /* master:must be N */;
select_priv select_priv
N N
connection slave;
grant select on *.* to 'user_foo'@'%' identified by 'user_foopass'; grant select on *.* to 'user_foo'@'%' identified by 'user_foopass';
revoke select on *.* from 'user_foo'@'%'; revoke select on *.* from 'user_foo'@'%';
select select_priv from mysql.user where user='user_foo' /* slave:must be N */; select select_priv from mysql.user where user='user_foo' /* slave:must be N */;
...@@ -18,13 +16,19 @@ grant select on *.* to 'user_foo'@'%' identified by 'user_foopass'; ...@@ -18,13 +16,19 @@ grant select on *.* to 'user_foo'@'%' identified by 'user_foopass';
select select_priv from mysql.user where user='user_foo' /* slave:must be Y */; select select_priv from mysql.user where user='user_foo' /* slave:must be Y */;
select_priv select_priv
Y Y
connection master;
revoke select on *.* from 'user_foo'; revoke select on *.* from 'user_foo';
select select_priv from mysql.user where user='user_foo' /* master:must be N */; select select_priv from mysql.user where user='user_foo' /* master:must be N */;
select_priv select_priv
N N
connection slave;
select select_priv from mysql.user where user='user_foo' /* slave:must get Y */; select select_priv from mysql.user where user='user_foo' /* slave:must get Y */;
select_priv select_priv
Y Y
connection slave;
revoke select on *.* FROM 'user_foo'; revoke select on *.* FROM 'user_foo';
connection master;
delete from mysql.user where user="user_foo"; delete from mysql.user where user="user_foo";
connection slave;
delete from mysql.user where user="user_foo"; delete from mysql.user where user="user_foo";
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection slave;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
use test; use test;
drop table if exists mysqltest_foo; drop table if exists mysqltest_foo;
drop table if exists mysqltest_bar; drop table if exists mysqltest_bar;
create table mysqltest_foo (n int); create table mysqltest_foo (n int);
insert into mysqltest_foo values(4); insert into mysqltest_foo values(4);
connection master;
use test; use test;
create table mysqltest_foo (n int); create table mysqltest_foo (n int);
insert into mysqltest_foo values(5); insert into mysqltest_foo values(5);
...@@ -16,8 +14,12 @@ create table mysqltest_bar (m int); ...@@ -16,8 +14,12 @@ create table mysqltest_bar (m int);
insert into mysqltest_bar values(15); insert into mysqltest_bar values(15);
create table t1 (k int); create table t1 (k int);
insert into t1 values(55); insert into t1 values(55);
connection slave;
select mysqltest_foo.n,mysqltest_bar.m,t1.k from mysqltest_foo,mysqltest_bar,t1; select mysqltest_foo.n,mysqltest_bar.m,t1.k from mysqltest_foo,mysqltest_bar,t1;
n m k n m k
4 15 55 4 15 55
connection master;
drop table mysqltest_foo,mysqltest_bar,t1; drop table mysqltest_foo,mysqltest_bar,t1;
connection slave;
drop table mysqltest_foo,mysqltest_bar,t1; drop table mysqltest_foo,mysqltest_bar,t1;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; set global max_connections=151;
reset slave; connection slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; include/stop_slave.inc
start slave; include/start_slave.inc
connection master;
connection slave;
show variables like 'init_slave'; show variables like 'init_slave';
Variable_name Value Variable_name Value
init_slave set global max_connections=500 init_slave set global max_connections=500
...@@ -11,17 +13,21 @@ show variables like 'max_connections'; ...@@ -11,17 +13,21 @@ show variables like 'max_connections';
Variable_name Value Variable_name Value
max_connections 500 max_connections 500
reset master; reset master;
connection master;
show variables like 'init_slave'; show variables like 'init_slave';
Variable_name Value Variable_name Value
init_slave init_slave
show variables like 'max_connections'; show variables like 'max_connections';
Variable_name Value Variable_name Value
max_connections 151 max_connections 151
connection slave;
set @my_global_init_connect= @@global.init_connect; set @my_global_init_connect= @@global.init_connect;
set global init_connect="set @c=1"; set global init_connect="set @c=1";
show variables like 'init_connect'; show variables like 'init_connect';
Variable_name Value Variable_name Value
init_connect set @c=1 init_connect set @c=1
stop slave; connection master;
connection slave;
set global init_connect= @my_global_init_connect; set global init_connect= @my_global_init_connect;
set global max_connections= default; set global max_connections= default;
include/rpl_end.inc
# #
# Bug#20821: INSERT DELAYED fails to write some rows to binlog # Bug#20821: INSERT DELAYED fails to write some rows to binlog
# #
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
CREATE SCHEMA IF NOT EXISTS mysqlslap; CREATE SCHEMA IF NOT EXISTS mysqlslap;
USE mysqlslap; USE mysqlslap;
CREATE TABLE t1 (id INT, name VARCHAR(64)); CREATE TABLE t1 (id INT, name VARCHAR(64)) ENGINE=MyISAM;
connection slave;
connection master;
SELECT COUNT(*) FROM mysqlslap.t1; SELECT COUNT(*) FROM mysqlslap.t1;
COUNT(*) COUNT(*)
5000 5000
connection slave;
SELECT COUNT(*) FROM mysqlslap.t1; SELECT COUNT(*) FROM mysqlslap.t1;
COUNT(*) COUNT(*)
5000 5000
# #
# Cleanup # Cleanup
# #
connection master;
USE test; USE test;
DROP SCHEMA mysqlslap; DROP SCHEMA mysqlslap;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1 (n int not null primary key); create table t1 (n int not null primary key);
insert into t1 values (1); insert into t1 values (1);
create table t2 (n int); create table t2 (n int);
insert into t2 values (1); insert into t2 values (1);
insert ignore into t1 select * from t2; insert ignore into t1 select * from t2;
Warnings:
Warning 1062 Duplicate entry '1' for key 'PRIMARY'
insert into t1 values (2); insert into t1 values (2);
connection slave;
connection slave;
select * from t1; select * from t1;
n n
1 1
2 2
connection master;
drop table t1,t2; drop table t1,t2;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
CREATE TABLE t1 (word CHAR(20) NOT NULL); CREATE TABLE t1 (word CHAR(20) NOT NULL);
LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1; LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
SELECT * FROM t1 ORDER BY word; SELECT * FROM t1 ORDER BY word;
...@@ -78,6 +74,7 @@ Aberdeen ...@@ -78,6 +74,7 @@ Aberdeen
Abernathy Abernathy
aberrant aberrant
aberration aberration
connection slave;
SELECT * FROM t1 ORDER BY word; SELECT * FROM t1 ORDER BY word;
word word
Aarhus Aarhus
...@@ -150,4 +147,7 @@ Aberdeen ...@@ -150,4 +147,7 @@ Aberdeen
Abernathy Abernathy
aberrant aberrant
aberration aberration
connection master;
drop table t1; drop table t1;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop database if exists mysqltest; drop database if exists mysqltest;
connection master;
USE test; USE test;
CREATE TABLE t1(a INT, b INT, UNIQUE(b)); CREATE TABLE t1(a INT, b INT, UNIQUE(b));
LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE test.t1; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE test.t1;
...@@ -18,6 +15,7 @@ LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE mysqltest.t1; ...@@ -18,6 +15,7 @@ LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE mysqltest.t1;
SELECT COUNT(*) FROM mysqltest.t1; SELECT COUNT(*) FROM mysqltest.t1;
COUNT(*) COUNT(*)
2 2
connection slave;
SHOW DATABASES; SHOW DATABASES;
Database Database
information_schema information_schema
...@@ -36,5 +34,8 @@ t1 ...@@ -36,5 +34,8 @@ t1
SELECT COUNT(*) FROM mysqltest.t1; SELECT COUNT(*) FROM mysqltest.t1;
COUNT(*) COUNT(*)
2 2
connection master;
DROP DATABASE mysqltest; DROP DATABASE mysqltest;
DROP TABLE test.t1; DROP TABLE IF EXISTS test.t1;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection slave;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
reset master; reset master;
connection master;
create table test.t1(a int, b int, unique(b)); create table test.t1(a int, b int, unique(b));
load data infile '../../std_data/rpl_loaddata.dat' into table test.t1; load data infile '../../std_data/rpl_loaddata.dat' into table test.t1;
connection slave;
select count(*) from test.t1; select count(*) from test.t1;
count(*) count(*)
2 2
show binlog events from 107; include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info connection master;
drop table test.t1; drop table test.t1;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1(a int); create table t1(a int);
select * into outfile 'MYSQLTEST_VARDIR/tmp/rpl_loaddatalocal.select_outfile' from t1; select * into outfile 'MYSQLTEST_VARDIR/tmp/rpl_loaddatalocal.select_outfile' from t1;
truncate table t1; truncate table t1;
load data local infile 'MYSQLTEST_VARDIR/tmp/rpl_loaddatalocal.select_outfile' into table t1; load data local infile 'MYSQLTEST_VARDIR/tmp/rpl_loaddatalocal.select_outfile' into table t1;
connection slave;
select a,count(*) from t1 group by a; select a,count(*) from t1 group by a;
a count(*) a count(*)
1 10000 1 10000
connection master;
drop table t1; drop table t1;
connection slave;
connection master;
create table t1(a int); create table t1(a int);
insert into t1 values (1), (2), (2), (3); insert into t1 values (1), (2), (2), (3);
select * into outfile 'MYSQLTEST_VARDIR/tmp/rpl_loaddatalocal.select_outfile' from t1; select * into outfile 'MYSQLTEST_VARDIR/tmp/rpl_loaddatalocal.select_outfile' from t1;
drop table t1; drop table t1;
create table t1(a int primary key); create table t1(a int primary key);
load data local infile 'MYSQLTEST_VARDIR/tmp/rpl_loaddatalocal.select_outfile' into table t1; load data local infile 'MYSQLTEST_VARDIR/tmp/rpl_loaddatalocal.select_outfile' into table t1;
Warnings:
Warning 1062 Duplicate entry '2' for key 'PRIMARY'
SELECT * FROM t1 ORDER BY a; SELECT * FROM t1 ORDER BY a;
a a
1 1
2 2
3 3
connection slave;
SELECT * FROM t1 ORDER BY a; SELECT * FROM t1 ORDER BY a;
a a
1 1
2 2
3 3
connection master;
drop table t1; drop table t1;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, PRIMARY KEY(a)); CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, PRIMARY KEY(a));
...@@ -119,6 +116,8 @@ Abernathy ...@@ -119,6 +116,8 @@ Abernathy
aberrant aberrant
aberration aberration
connection slave;
connection slave;
SELECT * FROM test.t1 ORDER BY blob_column; SELECT * FROM test.t1 ORDER BY blob_column;
a blob_column a blob_column
1 abase 1 abase
...@@ -223,5 +222,8 @@ Abernathy ...@@ -223,5 +222,8 @@ Abernathy
aberrant aberrant
aberration aberration
connection master;
DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE test.t1; DROP TABLE test.t1;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; create table if not exists t1 (n int);
reset slave; drop table t1;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; call mtr.add_suppression ("Slave I/O: Got fatal error 1236 from master when reading data from binary");
start slave; call mtr.add_suppression ("Error in Log_event::read_log_event");
show master status; show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 107 <Binlog_Ignore_DB> master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
show slave status; connection slave;
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 Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id include/stop_slave.inc
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 107 # # master-bin.000001 Yes Yes 0 0 107 # None 0 No # No 0 0 1 change master to master_log_pos=MASTER_LOG_POS;
stop slave;
change master to master_log_pos=107;
start slave;
stop slave;
change master to master_log_pos=107;
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 Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 107 # # master-bin.000001 No No 0 0 107 # None 0 No # No 0 0 1
start 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 Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 107 # # master-bin.000001 Yes Yes 0 0 107 # None 0 No # No 0 0 1
stop slave;
change master to master_log_pos=178;
start slave; start slave;
show slave status; include/wait_for_slave_io_error.inc [errno=1236]
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 Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event; consider out of disk space on master; the first event 'master-bin.000001' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.''
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 178 # # master-bin.000001 No Yes 0 0 178 # None 0 No # No 1236 Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position' 0 1 include/stop_slave_sql.inc
connection master;
show master status; show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 107 <Binlog_Ignore_DB> master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
create table if not exists t1 (n int); create table if not exists t1 (n int);
drop table if exists t1; drop table if exists t1;
create table t1 (n int); create table t1 (n int);
insert into t1 values (1),(2),(3); insert into t1 values (1),(2),(3);
stop slave; connection slave;
change master to master_log_pos=207; change master to master_log_pos=MASTER_LOG_POS;
start slave; start slave;
select * from t1 ORDER BY n; select * from t1 ORDER BY n;
n n
1 1
2 2
3 3
connection master;
drop table t1; drop table t1;
connection slave;
End of 5.0 tests
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
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 auto_increment primary key, b int, key(b)); create table t1 (a int not null auto_increment primary key, b int, key(b));
INSERT INTO t1 (a) VALUES (1),(2); INSERT INTO t1 (a) VALUES (1),(2);
drop table t1; drop table t1;
connection slave;
include/rpl_end.inc
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;
select master_pos_wait('master-bin.999999',0,2);
master_pos_wait('master-bin.999999',0,2)
-1
explain extended select master_pos_wait('master-bin.999999',0,2);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select master_pos_wait('master-bin.999999',0,2) AS `master_pos_wait('master-bin.999999',0,2)`
select master_pos_wait('master-bin.999999',0);
stop slave sql_thread;
master_pos_wait('master-bin.999999',0)
NULL
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; CALL mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT');
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1(id int, i int, r1 int, r2 int, p varchar(100)); create table t1(id int, i int, r1 int, r2 int, p varchar(100));
insert into t1 values(1, connection_id(), 0, 0, ""); insert into t1 values(1, connection_id(), 0, 0, "");
insert into t1 values(2, 0, rand()*1000, rand()*1000, ""); insert into t1 values(2, 0, rand()*1000, rand()*1000, "");
...@@ -13,12 +10,50 @@ delete from t1 where id=6; ...@@ -13,12 +10,50 @@ delete from t1 where id=6;
set sql_log_bin=1; set sql_log_bin=1;
insert into t1 values(3, 0, 0, 0, password('does_this_work?')); insert into t1 values(3, 0, 0, 0, password('does_this_work?'));
insert into t1 values(4, connection_id(), rand()*1000, rand()*1000, password('does_this_still_work?')); insert into t1 values(4, connection_id(), rand()*1000, rand()*1000, password('does_this_still_work?'));
select * into outfile '../../tmp/rpl_misc_functions.outfile' from t1; select * into outfile 'rpl_misc_functions.outfile' from t1;
create table t2 like t1; connection slave;
load data local infile 'MYSQLTEST_VARDIR/tmp/rpl_misc_functions.outfile' into table t2; create temporary table t2 like t1;
load data local infile 'MYSQLD_DATADIR/test/rpl_misc_functions.outfile' into table t2;
select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p); select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p);
id i r1 r2 p id i r1 r2 p id i r1 r2 p id i r1 r2 p
stop slave; connection master;
drop table t1;
drop table t2;
drop table t1; drop table t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
col_a DOUBLE DEFAULT NULL);
CREATE PROCEDURE test_replication_sp1()
BEGIN
INSERT INTO t1 (col_a) VALUES (rand()), (rand());
INSERT INTO t1 (col_a) VALUES (rand());
END|
CREATE PROCEDURE test_replication_sp2()
BEGIN
CALL test_replication_sp1();
CALL test_replication_sp1();
END|
CREATE FUNCTION test_replication_sf() RETURNS DOUBLE DETERMINISTIC
BEGIN
RETURN (rand() + rand());
END|
CALL test_replication_sp1();
CALL test_replication_sp2();
INSERT INTO t1 (col_a) VALUES (test_replication_sf());
INSERT INTO t1 (col_a) VALUES (test_replication_sf());
INSERT INTO t1 (col_a) VALUES (test_replication_sf());
connection slave;
select * from t1 into outfile "../../tmp/t1_slave.txt";
connection master;
create temporary table t1_slave select * from t1 where 1=0;
load data infile '../../tmp/t1_slave.txt' into table t1_slave;
select count(*) into @aux from t1 join t1_slave using (id)
where ABS(t1.col_a - t1_slave.col_a) < 0.0000001 ;
SELECT @aux;
@aux
12
connection master;
DROP TABLE t1, t1_slave;
DROP PROCEDURE test_replication_sp1;
DROP PROCEDURE test_replication_sp2;
DROP FUNCTION test_replication_sf;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1 (a int primary key); create table t1 (a int primary key);
create table t2 (a int); create table t2 (a int);
insert into t1 values (1); insert into t1 values (1);
...@@ -14,9 +10,13 @@ a ...@@ -14,9 +10,13 @@ a
select * from t2; select * from t2;
a a
1 1
connection slave;
select * from t1; select * from t1;
a a
select * from t2; select * from t2;
a a
1 1
connection master;
drop table t1,t2; drop table t1,t2;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
set sql_log_bin=0; set sql_log_bin=0;
create database mysqltest_from; create database mysqltest_from;
set sql_log_bin=1; set sql_log_bin=1;
connection slave;
create database mysqltest_to; create database mysqltest_to;
connection master;
use mysqltest_from; use mysqltest_from;
drop table if exists a; drop table if exists a;
CREATE TABLE a (i INT); CREATE TABLE a (i INT);
...@@ -20,10 +19,12 @@ delete alias FROM a alias where alias.i=2; ...@@ -20,10 +19,12 @@ delete alias FROM a alias where alias.i=2;
select * from a; select * from a;
i i
3 3
connection slave;
use mysqltest_to; use mysqltest_to;
select * from a; select * from a;
i i
3 3
connection master;
create table t1 (a int primary key); create table t1 (a int primary key);
create table t2 (a int); create table t2 (a int);
insert into t1 values (1); insert into t1 values (1);
...@@ -34,11 +35,15 @@ a ...@@ -34,11 +35,15 @@ a
select * from t2; select * from t2;
a a
1 1
connection slave;
select * from t1; select * from t1;
ERROR 42S02: Table 'mysqltest_to.t1' doesn't exist ERROR 42S02: Table 'mysqltest_to.t1' doesn't exist
select * from t2; select * from t2;
ERROR 42S02: Table 'mysqltest_to.t2' doesn't exist ERROR 42S02: Table 'mysqltest_to.t2' doesn't exist
connection master;
set sql_log_bin=0; set sql_log_bin=0;
drop database mysqltest_from; drop database mysqltest_from;
set sql_log_bin=1; set sql_log_bin=1;
connection slave;
drop database mysqltest_to; drop database mysqltest_to;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop database if exists d1; drop database if exists d1;
drop database if exists d2; drop database if exists d2;
connection slave;
drop database if exists d2; drop database if exists d2;
connection master;
create database d1; create database d1;
create table d1.t0 (id int); create table d1.t0 (id int);
create database d2; create database d2;
...@@ -17,9 +16,13 @@ insert into t1 values (1), (2), (3), (4), (5); ...@@ -17,9 +16,13 @@ insert into t1 values (1), (2), (3), (4), (5);
insert into t2 select id + 3 from t1; insert into t2 select id + 3 from t1;
update t1 join t2 using (id) set t1.id = 0; update t1 join t2 using (id) set t1.id = 0;
insert into d1.t0 values (0); insert into d1.t0 values (0);
connection slave;
use d1; use d1;
select * from t0 where id=0; select * from t0 where id=0;
id id
0 0
connection master;
drop database d1; drop database d1;
drop database d2; drop database d2;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop table if exists t1; drop table if exists t1;
create table t1(n char(30)); create table t1(n char(30));
prepare stmt1 from 'insert into t1 values (?)'; prepare stmt1 from 'insert into t1 values (?)';
...@@ -19,12 +15,40 @@ set @var2= 'insert into t1 values (concat("from-var-", ?))'; ...@@ -19,12 +15,40 @@ set @var2= 'insert into t1 values (concat("from-var-", ?))';
prepare stmt2 from @var2; prepare stmt2 from @var2;
set @var1='from-master-3'; set @var1='from-master-3';
execute stmt2 using @var1; execute stmt2 using @var1;
connection slave;
SELECT * FROM t1 ORDER BY n; SELECT * FROM t1 ORDER BY n;
n n
from-master-1 from-master-1
from-master-2-'', from-master-2-'',
from-var-from-master-3 from-var-from-master-3
connection master;
drop table t1; drop table t1;
connection slave;
stop slave; stop slave;
reset master; include/wait_for_slave_to_stop.inc
reset slave;
########################################################################
#
# BUG#25843: Changing default database between PREPARE and EXECUTE of
# statement breaks binlog.
#
########################################################################
connection slave;
START SLAVE;
connection master;
CREATE DATABASE mysqltest1;
CREATE TABLE t1(db_name CHAR(32), db_col_name CHAR(32));
PREPARE stmt_d_1 FROM 'INSERT INTO t1 VALUES(DATABASE(), @@collation_database)';
EXECUTE stmt_d_1;
use mysqltest1;
EXECUTE stmt_d_1;
connection slave;
SELECT * FROM t1;
db_name db_col_name
test latin1_swedish_ci
test latin1_swedish_ci
connection master;
DROP DATABASE mysqltest1;
use test;
DROP TABLE t1;
include/rpl_end.inc
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;
**** On Master ****
CREATE TABLE t1 (a INT, b LONG);
INSERT INTO t1 VALUES (1,1), (2,2);
INSERT INTO t1 VALUES (3,UUID()), (4,UUID());
SHOW BINLOG EVENTS;
**** On Slave ****
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
Replicate_Ignore_Server_Ids
Master_Server_Id 1
SHOW BINLOG EVENTS;
DROP TABLE IF EXISTS t1;
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection slave;
reset slave; include/stop_slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; connection master;
start slave;
stop slave;
create table t1 (a int); create table t1 (a int);
drop table t1; drop table t1;
create table t1 (a int); create table t1 (a int);
drop table t1; drop table t1;
connection slave;
reset slave; reset slave;
start slave io_thread; start slave io_thread;
stop slave io_thread; include/wait_for_slave_param.inc [Slave_IO_State]
include/stop_slave_io.inc
reset slave; reset slave;
start slave; include/start_slave.inc
select master_pos_wait('master-bin.001',200,6)=-1; include/assert.inc [Assert that master_pos_wait does not timeout nor it returns NULL]
master_pos_wait('master-bin.001',200,6)=-1 include/rpl_end.inc
0
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop database if exists mysqltest1; drop database if exists mysqltest1;
drop database if exists mysqltest2; drop database if exists mysqltest2;
create database mysqltest1; create database mysqltest1;
...@@ -11,13 +7,19 @@ create database mysqltest2; ...@@ -11,13 +7,19 @@ create database mysqltest2;
use mysqltest1; use mysqltest1;
create table t1 (a int); create table t1 (a int);
insert into t1 values(1); insert into t1 values(1);
connection slave;
select * from mysqltest1.t1; select * from mysqltest1.t1;
ERROR 42S02: Table 'mysqltest1.t1' doesn't exist ERROR 42S02: Table 'mysqltest1.t1' doesn't exist
connection master;
use mysqltest2; use mysqltest2;
create table t1 (a int); create table t1 (a int);
insert into t1 values(1); insert into t1 values(1);
connection slave;
select * from mysqltest2.t1; select * from mysqltest2.t1;
a a
1 1
connection master;
drop database mysqltest1; drop database mysqltest1;
drop database mysqltest2; drop database mysqltest2;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create database if not exists mysqltest1; create database if not exists mysqltest1;
DROP TABLE IF EXISTS mysqltest1.t1; DROP TABLE IF EXISTS mysqltest1.t1;
CREATE TABLE mysqltest1.t1 (n MEDIUMINT NOT NULL AUTO_INCREMENT, CREATE TABLE mysqltest1.t1 (n MEDIUMINT NOT NULL AUTO_INCREMENT,
...@@ -24,6 +21,10 @@ FOR EACH ROW BEGIN ...@@ -24,6 +21,10 @@ FOR EACH ROW BEGIN
SET new.b = mysqltest1.f1(); SET new.b = mysqltest1.f1();
END| END|
INSERT INTO mysqltest1.t1 SET n = NULL, a = now(); INSERT INTO mysqltest1.t1 SET n = NULL, a = now();
connection slave;
connection master;
DROP TABLE IF EXISTS mysqltest1.t1; DROP TABLE IF EXISTS mysqltest1.t1;
DROP FUNCTION mysqltest1.f1; DROP FUNCTION mysqltest1.f1;
DROP DATABASE mysqltest1; DROP DATABASE mysqltest1;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; set local sql_mode="";
reset slave; connection master;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
DROP DATABASE IF EXISTS mysqltest1; DROP DATABASE IF EXISTS mysqltest1;
CREATE DATABASE mysqltest1; CREATE DATABASE mysqltest1;
CREATE USER tester IDENTIFIED BY 'test'; CREATE USER tester IDENTIFIED BY 'test';
GRANT ALL ON mysqltest1.* TO 'tester'@'%' IDENTIFIED BY 'test'; GRANT ALL ON mysqltest1.* TO 'tester'@'%' IDENTIFIED BY 'test';
GRANT ALL ON mysqltest1.* TO ''@'localhost%'; GRANT ALL ON mysqltest1.* TO ''@'localhost%';
FLUSH PRIVILEGES; FLUSH PRIVILEGES;
connect m_1,localhost,tester,,mysqltest1;
connection m_1;
CREATE TABLE mysqltest1.t1 (a INT, users VARCHAR(255), PRIMARY KEY(a)); CREATE TABLE mysqltest1.t1 (a INT, users VARCHAR(255), PRIMARY KEY(a));
INSERT INTO mysqltest1.t1 VALUES(1,USER()); INSERT INTO mysqltest1.t1 VALUES(1,USER());
INSERT INTO mysqltest1.t1 VALUES(2,CURRENT_USER()); INSERT INTO mysqltest1.t1 VALUES(2,CURRENT_USER());
...@@ -19,21 +19,26 @@ INSERT INTO mysqltest1.t1 VALUES(3,USER()); ...@@ -19,21 +19,26 @@ INSERT INTO mysqltest1.t1 VALUES(3,USER());
INSERT INTO mysqltest1.t1 VALUES(4,CURRENT_USER()); INSERT INTO mysqltest1.t1 VALUES(4,CURRENT_USER());
end| end|
CALL mysqltest1.p1(); CALL mysqltest1.p1();
connection master;
SELECT * FROM mysqltest1.t1 ORDER BY a; SELECT * FROM mysqltest1.t1 ORDER BY a;
a users a users
1 tester@localhost 1 tester@localhost
2 @localhost% 2 @localhost%
3 tester@localhost 3 tester@localhost
4 @localhost% 4 @localhost%
connection slave;
SELECT * FROM mysqltest1.t1 ORDER BY a; SELECT * FROM mysqltest1.t1 ORDER BY a;
a users a users
1 tester@localhost 1 tester@localhost
2 @localhost% 2 @localhost%
3 tester@localhost 3 tester@localhost
4 @localhost% 4 @localhost%
connection master;
DROP DATABASE mysqltest1;
REVOKE ALL ON mysqltest1.* FROM 'tester'@'%'; REVOKE ALL ON mysqltest1.* FROM 'tester'@'%';
REVOKE ALL ON mysqltest1.* FROM ''@'localhost%'; REVOKE ALL ON mysqltest1.* FROM ''@'localhost%';
DROP DATABASE mysqltest1; DROP USER tester@'%';
DROP USER 'tester';
DROP USER ''@'localhost%'; DROP USER ''@'localhost%';
FLUSH PRIVILEGES; FLUSH PRIVILEGES;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
**** On Master ****
CREATE TABLE t1 (a int); CREATE TABLE t1 (a int);
CREATE TABLE t2 (a int); CREATE TABLE t2 (a int);
CREATE TEMPORARY TABLE t2 (a int, b int); CREATE TEMPORARY TABLE t2 (a int, b int);
...@@ -12,47 +8,48 @@ SHOW TABLES; ...@@ -12,47 +8,48 @@ SHOW TABLES;
Tables_in_test Tables_in_test
t1 t1
t2 t2
**** On Slave **** connection slave;
SHOW TABLES; SHOW TABLES;
Tables_in_test Tables_in_test
t1 t1
t2 t2
**** On Master **** connection master;
DROP TABLE t2; DROP TABLE t2;
SHOW TABLES; SHOW TABLES;
Tables_in_test Tables_in_test
t1 t1
t2 t2
**** On Slave **** connection slave;
SHOW TABLES; SHOW TABLES;
Tables_in_test Tables_in_test
t1 t1
t2 t2
**** On Master **** connection master;
CREATE TEMPORARY TABLE t2 (a int, b int); CREATE TEMPORARY TABLE t2 (a int, b int);
SHOW TABLES; SHOW TABLES;
Tables_in_test Tables_in_test
t1 t1
t2 t2
**** On Slave **** connection slave;
SHOW TABLES; SHOW TABLES;
Tables_in_test Tables_in_test
t1 t1
t2 t2
**** On Master **** connection master;
DROP TABLE t1,t2; DROP TABLE t1,t2;
SHOW BINLOG EVENTS; include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 107 Server ver: VERSION, Binlog ver: 4 master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 107 Query 1 193 use `test`; CREATE TABLE t1 (a int) master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int)
master-bin.000001 193 Query 1 279 use `test`; CREATE TABLE t2 (a int) master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 279 Query 1 403 use `test`; DROP TEMPORARY TABLE IF EXISTS `t2` /* generated by server */ master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a int)
master-bin.000001 403 Query 1 527 use `test`; DROP TEMPORARY TABLE IF EXISTS `t2` /* generated by server */ master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 527 Query 1 631 use `test`; DROP TABLE `t1` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
SHOW TABLES; SHOW TABLES;
Tables_in_test Tables_in_test
t2 t2
**** On Slave **** connection slave;
SHOW TABLES; SHOW TABLES;
Tables_in_test Tables_in_test
t2 t2
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
DROP FUNCTION test.f1; DROP FUNCTION test.f1;
DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t1;
create table test.t1 (a int, PRIMARY KEY(a)); create table test.t1 (a int, PRIMARY KEY(a));
...@@ -22,9 +19,14 @@ select * from test.t1; ...@@ -22,9 +19,14 @@ select * from test.t1;
a a
1 1
2 2
connection slave;
connection slave;
select * from test.t1; select * from test.t1;
a a
1 1
2 2
connection master;
DROP FUNCTION test.f1; DROP FUNCTION test.f1;
DROP TABLE test.t1; DROP TABLE test.t1;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection 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 primary key); create table t1 (a int not null primary key);
insert into t1 values (1); insert into t1 values (1);
create table t2 (a int); create table t2 (a int);
insert into t2 values (1); insert into t2 values (1);
update t1, t2 set t1.a = 0 where t1.a = t2.a; update t1, t2 set t1.a = 0 where t1.a = t2.a;
connection slave;
show tables; show tables;
Tables_in_test Tables_in_test
t1 t1
...@@ -16,46 +14,14 @@ select * from t1; ...@@ -16,46 +14,14 @@ select * from t1;
a a
0 0
drop table t1; drop table t1;
connection master;
insert into t1 values (1); insert into t1 values (1);
show slave status; connection slave;
Slave_IO_State # call mtr.add_suppression("Slave SQL.*Error executing row event: .Table .test.t1. doesn.t exist., error.* 1146");
Master_Host 127.0.0.1 include/wait_for_slave_sql_error.inc [errno=1146]
Master_User root ==== Clean up ====
Master_Port MASTER_MYPORT include/stop_slave_io.inc
Connect_Retry 1 RESET SLAVE;
Master_Log_File master-bin.000001 connection master;
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table test.t2
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1146
Last_Error Error executing row event: 'Table 'test.t1' doesn't exist'
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 1146
Last_SQL_Error Error executing row event: 'Table 'test.t1' doesn't exist'
Replicate_Ignore_Server_Ids
Master_Server_Id 1
drop table t1, t2; drop table t1, t2;
include/rpl_end.inc
include/master-slave.inc
[connection master]
connection slave;
stop slave; stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; connection master;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
stop slave;
# #
# Generate a big enough master's binlog to cause relay log rotations # Generate a big enough master's binlog to cause relay log rotations
# #
create table t1 (a int); create table t1 (a int);
drop table t1; drop table t1;
connection slave;
reset slave; reset slave;
# #
# Test 1 # Test 1
# #
set @my_max_binlog_size= @@global.max_binlog_size; set @my_max_binlog_size= @@global.max_binlog_size, @my_max_relay_log_size=@@global.max_relay_log_size;
set global max_binlog_size=8192; set global max_binlog_size=8192;
set global max_relay_log_size=8192-1; set global max_relay_log_size=8192-1;
Warnings: Warnings:
...@@ -23,7 +22,7 @@ select @@global.max_relay_log_size; ...@@ -23,7 +22,7 @@ select @@global.max_relay_log_size;
@@global.max_relay_log_size @@global.max_relay_log_size
4096 4096
start slave; start slave;
Checking that both slave threads are running. include/check_slave_is_running.inc
# #
# Test 2 # Test 2
# #
...@@ -33,17 +32,19 @@ set global max_relay_log_size=(5*4096); ...@@ -33,17 +32,19 @@ set global max_relay_log_size=(5*4096);
select @@global.max_relay_log_size; select @@global.max_relay_log_size;
@@global.max_relay_log_size 20480 @@global.max_relay_log_size 20480
start slave; start slave;
Checking that both slave threads are running. include/check_slave_is_running.inc
# #
# Test 3: max_relay_log_size = 0 # Test 3: max_relay_log_size = 0
# #
stop slave; stop slave;
reset slave; reset slave;
set global max_relay_log_size=0; set global max_relay_log_size=0;
Warnings:
Warning 1292 Truncated incorrect max_relay_log_size value: '0'
select @@global.max_relay_log_size; select @@global.max_relay_log_size;
@@global.max_relay_log_size 0 @@global.max_relay_log_size 4096
start slave; start slave;
Checking that both slave threads are running. include/check_slave_is_running.inc
# #
# Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
# #
...@@ -56,19 +57,27 @@ flush logs; ...@@ -56,19 +57,27 @@ flush logs;
reset slave; reset slave;
start slave; start slave;
flush logs; flush logs;
connection master;
create table t1 (a int); create table t1 (a int);
Checking that both slave threads are running. connection slave;
include/check_slave_is_running.inc
# #
# Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
# #
flush logs; flush logs;
connection master;
drop table t1; drop table t1;
Checking that both slave threads are running. connection slave;
include/check_slave_is_running.inc
connection master;
flush logs; flush logs;
show master status; show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000002 # <Binlog_Do_DB> <Binlog_Ignore_DB> master-bin.000002 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
set global max_binlog_size= @my_max_binlog_size; set global max_binlog_size= @my_max_binlog_size;
set global max_relay_log_size= @my_max_relay_log_size;
# #
# End of 4.1 tests # End of 4.1 tests
# #
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection slave;
reset slave; Master_User = 'root'
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; Master_Host = '127.0.0.1'
start slave;
Master_User root
Master_Host 127.0.0.1
include/stop_slave.inc include/stop_slave.inc
change master to master_user='test'; change master to master_user='test';
Master_User test Master_User = 'test'
Master_Host 127.0.0.1 Master_Host = '127.0.0.1'
reset slave; reset slave;
Master_User test Master_User = 'test'
Master_Host 127.0.0.1 Master_Host = '127.0.0.1'
change master to master_user='root'; change master to master_user='root';
include/start_slave.inc include/start_slave.inc
Master_User root Master_User = 'root'
Master_Host 127.0.0.1 Master_Host = '127.0.0.1'
include/stop_slave.inc include/stop_slave.inc
reset slave; reset slave;
include/start_slave.inc include/start_slave.inc
connection master;
create temporary table t1 (a int); create temporary table t1 (a int);
connection slave;
include/stop_slave.inc include/stop_slave.inc
reset slave; reset slave;
include/start_slave.inc include/start_slave.inc
show status like 'slave_open_temp_tables'; show status like 'slave_open_temp_tables';
Variable_name Value Variable_name Value
Slave_open_temp_tables 0 Slave_open_temp_tables 0
connection master;
drop temporary table if exists t1;
connection slave;
include/stop_slave.inc include/stop_slave.inc
reset slave; reset slave;
include/check_slave_no_error.inc
change master to master_user='impossible_user_name'; change master to master_user='impossible_user_name';
start slave; start slave;
stop slave; include/wait_for_slave_io_error.inc [errno=1045]
include/stop_slave_sql.inc
change master to master_user='root'; change master to master_user='root';
include/start_slave.inc include/start_slave.inc
include/check_slave_no_error.inc
stop slave; stop slave;
change master to master_user='impossible_user_name'; change master to master_user='impossible_user_name';
start slave; start slave;
stop slave; include/wait_for_slave_io_error.inc [errno=1045]
include/stop_slave_sql.inc
reset slave; reset slave;
include/check_slave_no_error.inc
change master to master_user='root';
reset slave;
include/start_slave.inc
include/stop_slave.inc
reset slave all;
start slave;
ERROR HY000: Misconfigured slave: MASTER_HOST was not set; Fix in config file or with CHANGE MASTER TO
CHANGE MASTER TO MASTER_HOST= 'MASTER_HOST', MASTER_USER= 'MASTER_USER', MASTER_PORT= MASTER_PORT;
include/start_slave.inc
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
<Begin test section 1 (non deterministic SP)> <Begin test section 1 (non deterministic SP)>
--------------------------------------------- ---------------------------------------------
...@@ -34,12 +30,14 @@ a t ...@@ -34,12 +30,14 @@ a t
2 NEW 2 NEW
3 NEW 3 NEW
4 NEW 4 NEW
connection slave;
SELECT * FROM t2 ORDER BY a; SELECT * FROM t2 ORDER BY a;
a t a t
1 NEW 1 NEW
2 NEW 2 NEW
3 NEW 3 NEW
4 NEW 4 NEW
connection master;
call test.p2(1); call test.p2(1);
SELECT * FROM t2 ORDER BY a; SELECT * FROM t2 ORDER BY a;
a t a t
...@@ -47,12 +45,14 @@ a t ...@@ -47,12 +45,14 @@ a t
2 Tex 2 Tex
3 Tex 3 Tex
4 Tex 4 Tex
connection slave;
SELECT * FROM t2 ORDER BY a; SELECT * FROM t2 ORDER BY a;
a t a t
1 Tex 1 Tex
2 Tex 2 Tex
3 Tex 3 Tex
4 Tex 4 Tex
connection master;
call test.p2(2); call test.p2(2);
SELECT * FROM t2 ORDER BY a; SELECT * FROM t2 ORDER BY a;
a t a t
...@@ -60,12 +60,14 @@ a t ...@@ -60,12 +60,14 @@ a t
2 SQL 2 SQL
3 SQL 3 SQL
4 SQL 4 SQL
connection slave;
SELECT * FROM t2 ORDER BY a; SELECT * FROM t2 ORDER BY a;
a t a t
1 SQL 1 SQL
2 SQL 2 SQL
3 SQL 3 SQL
4 SQL 4 SQL
connection master;
call test.p2(3); call test.p2(3);
SELECT * FROM t2 ORDER BY a; SELECT * FROM t2 ORDER BY a;
a t a t
...@@ -73,13 +75,17 @@ a t ...@@ -73,13 +75,17 @@ a t
2 NONE 2 NONE
3 NONE 3 NONE
4 NONE 4 NONE
connection slave;
SELECT * FROM t2 ORDER BY a; SELECT * FROM t2 ORDER BY a;
a t a t
1 NONE 1 NONE
2 NONE 2 NONE
3 NONE 3 NONE
4 NONE 4 NONE
connection master;
DROP PROCEDURE test.p1; DROP PROCEDURE test.p1;
DROP PROCEDURE test.p2; DROP PROCEDURE test.p2;
DROP TABLE test.t1; DROP TABLE test.t1;
DROP TABLE test.t2; DROP TABLE test.t2;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2; DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t2; DROP TABLE IF EXISTS test.t2;
...@@ -42,9 +39,6 @@ INSERT INTO test.t1 VALUES (4,'MySQL'),(20,'ROCKS'),(11,'Texas'),(10,'kyle'); ...@@ -42,9 +39,6 @@ INSERT INTO test.t1 VALUES (4,'MySQL'),(20,'ROCKS'),(11,'Texas'),(10,'kyle');
INSERT INTO test.t2 VALUES (4),(2),(1),(3); INSERT INTO test.t2 VALUES (4),(2),(1),(3);
UPDATE test.t1 SET id=id+4 WHERE id=4; UPDATE test.t1 SET id=id+4 WHERE id=4;
END| END|
< ---- Master selects-- >
-------------------------
CALL test.p2(); CALL test.p2();
SELECT * FROM test.t1 ORDER BY id; SELECT * FROM test.t1 ORDER BY id;
id data id data
...@@ -58,9 +52,7 @@ id2 ...@@ -58,9 +52,7 @@ id2
2 2
3 3
4 4
connection slave;
< ---- Slave selects-- >
------------------------
SELECT * FROM test.t1 ORDER BY id; SELECT * FROM test.t1 ORDER BY id;
id data id data
8 MySQL 8 MySQL
...@@ -73,30 +65,28 @@ id2 ...@@ -73,30 +65,28 @@ id2
2 2
3 3
4 4
connection master;
< ---- Master selects-- >
-------------------------
CALL test.p1(); CALL test.p1();
Warnings:
Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM test.t3 ORDER BY id3; SELECT * FROM test.t3 ORDER BY id3;
id3 c id3 c
1 MySQL 1 MySQL
2 kyle 2 kyle
3 Texas 3 Texas
4 ROCKS 4 ROCKS
connection slave;
< ---- Slave selects-- >
------------------------
SELECT * FROM test.t3 ORDER BY id3; SELECT * FROM test.t3 ORDER BY id3;
id3 c id3 c
1 MySQL 1 MySQL
2 kyle 2 kyle
3 Texas 3 Texas
4 ROCKS 4 ROCKS
connection master;
ALTER PROCEDURE test.p1 MODIFIES SQL DATA; ALTER PROCEDURE test.p1 MODIFIES SQL DATA;
connection master;
DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2; DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2; DROP TABLE IF EXISTS test.t2;
DROP TABLE IF EXISTS test.t3; DROP TABLE IF EXISTS test.t3;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t2; DROP TABLE IF EXISTS test.t2;
CREATE TABLE test.t1 (a INT,PRIMARY KEY(a)); CREATE TABLE test.t1 (a INT,PRIMARY KEY(a));
...@@ -14,21 +11,19 @@ BEGIN ...@@ -14,21 +11,19 @@ BEGIN
SELECT SQL_CALC_FOUND_ROWS * FROM test.t1 LIMIT 1; SELECT SQL_CALC_FOUND_ROWS * FROM test.t1 LIMIT 1;
INSERT INTO test.t2 VALUES(FOUND_ROWS()); INSERT INTO test.t2 VALUES(FOUND_ROWS());
END| END|
< ---- Master selects-- >
-------------------------
CALL test.p1(); CALL test.p1();
a a
1 1
SELECT * FROM test.t2; SELECT * FROM test.t2;
a a
2 2
connection slave;
< ---- Slave selects-- >
------------------------
SELECT * FROM test.t2; SELECT * FROM test.t2;
a a
2 2
connection master;
DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2; DROP TABLE IF EXISTS test.t2;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2; DROP TABLE IF EXISTS test.t2;
...@@ -53,25 +50,33 @@ SELECT * FROM test.t2 ORDER BY a; ...@@ -53,25 +50,33 @@ SELECT * FROM test.t2 ORDER BY a;
a a
1 1
3 3
connection slave;
SELECT * FROM test.t2 ORDER BY a; SELECT * FROM test.t2 ORDER BY a;
a a
1 1
3 3
connection master;
truncate test.t2; truncate test.t2;
call test.p1('b'); call test.p1('b');
select * from test.t2 ORDER BY a; select * from test.t2 ORDER BY a;
a a
2 2
4 4
connection slave;
SELECT * FROM test.t2 ORDER BY a; SELECT * FROM test.t2 ORDER BY a;
a a
2 2
4 4
connection master;
truncate test.t2; truncate test.t2;
SELECT * FROM test.t2 ORDER BY a; SELECT * FROM test.t2 ORDER BY a;
a a
connection slave;
SELECT * FROM test.t2 ORDER BY a; SELECT * FROM test.t2 ORDER BY a;
a a
connection master;
DROP PROCEDURE test.p1; DROP PROCEDURE test.p1;
DROP TABLE test.t1; DROP TABLE test.t1;
DROP TABLE test.t2; DROP TABLE test.t2;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2; DROP PROCEDURE IF EXISTS test.p2;
DROP PROCEDURE IF EXISTS test.p3; DROP PROCEDURE IF EXISTS test.p3;
...@@ -26,8 +23,10 @@ SELECT * FROM test.t1 ORDER BY a; ...@@ -26,8 +23,10 @@ SELECT * FROM test.t1 ORDER BY a;
a a
1 1
2 2
connection slave;
show tables; show tables;
Tables_in_test Tables_in_test
connection master;
CREATE PROCEDURE test.p3() CREATE PROCEDURE test.p3()
BEGIN BEGIN
INSERT INTO test.t2 VALUES(7); INSERT INTO test.t2 VALUES(7);
...@@ -44,13 +43,17 @@ SELECT * FROM test.t2 ORDER BY a; ...@@ -44,13 +43,17 @@ SELECT * FROM test.t2 ORDER BY a;
a a
6 6
7 7
connection slave;
SELECT * FROM test.t2 ORDER BY a; SELECT * FROM test.t2 ORDER BY a;
a a
6 6
7 7
connection master;
DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2; DROP PROCEDURE IF EXISTS test.p2;
DROP PROCEDURE IF EXISTS test.p3; DROP PROCEDURE IF EXISTS test.p3;
DROP PROCEDURE IF EXISTS test.p4; DROP PROCEDURE IF EXISTS test.p4;
DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2; DROP TABLE IF EXISTS test.t2;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2; DROP PROCEDURE IF EXISTS test.p2;
DROP PROCEDURE IF EXISTS test.p3; DROP PROCEDURE IF EXISTS test.p3;
...@@ -58,6 +55,8 @@ ALTER TABLE test.t2 DROP COLUMN to_drop; ...@@ -58,6 +55,8 @@ ALTER TABLE test.t2 DROP COLUMN to_drop;
INSERT INTO test.t2 VALUES ('gone',NULL,'STM',RAND()); INSERT INTO test.t2 VALUES ('gone',NULL,'STM',RAND());
END| END|
CALL test.p1(); CALL test.p1();
connection slave;
connection master;
DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2; DROP PROCEDURE IF EXISTS test.p2;
DROP PROCEDURE IF EXISTS test.p3; DROP PROCEDURE IF EXISTS test.p3;
...@@ -67,3 +66,5 @@ DROP PROCEDURE IF EXISTS test.p6; ...@@ -67,3 +66,5 @@ DROP PROCEDURE IF EXISTS test.p6;
DROP PROCEDURE IF EXISTS test.p7; DROP PROCEDURE IF EXISTS test.p7;
DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2; DROP TABLE IF EXISTS test.t2;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2; DROP PROCEDURE IF EXISTS test.p2;
DROP PROCEDURE IF EXISTS test.p3; DROP PROCEDURE IF EXISTS test.p3;
create user user1@localhost;
grant usage on *.* to user1@localhost; grant usage on *.* to user1@localhost;
flush privileges; flush privileges;
SELECT CURRENT_USER(); SELECT CURRENT_USER();
...@@ -21,9 +19,10 @@ CREATE PROCEDURE test.p3 () SQL SECURITY INVOKER CALL test.p1(); ...@@ -21,9 +19,10 @@ CREATE PROCEDURE test.p3 () SQL SECURITY INVOKER CALL test.p1();
GRANT EXECUTE ON PROCEDURE p1 TO user1@localhost; GRANT EXECUTE ON PROCEDURE p1 TO user1@localhost;
GRANT EXECUTE ON PROCEDURE p2 TO user1@localhost; GRANT EXECUTE ON PROCEDURE p2 TO user1@localhost;
GRANT EXECUTE ON PROCEDURE p3 TO user1@localhost; GRANT EXECUTE ON PROCEDURE p3 TO user1@localhost;
set sql_mode=default;
<******** Master user1 p3 & p2 calls *******> connection slave;
---------------------------------------------- connect muser1,localhost,user1,,;
connection muser1;
SELECT CURRENT_USER(); SELECT CURRENT_USER();
CURRENT_USER() CURRENT_USER()
user1@localhost user1@localhost
...@@ -36,9 +35,9 @@ user1@localhost user1@localhost ...@@ -36,9 +35,9 @@ user1@localhost user1@localhost
CALL test.p2(); CALL test.p2();
CURRENT_USER() USER() CURRENT_USER() USER()
root@localhost user1@localhost root@localhost user1@localhost
connect suser1,127.0.0.1,user1,,test,$SLAVE_MYPORT,;
<******** Slave user1 p3 & p2 calls *******> connection master;
--------------------------------------------- connection suser1;
SELECT CURRENT_USER(); SELECT CURRENT_USER();
CURRENT_USER() CURRENT_USER()
user1@localhost user1@localhost
...@@ -51,9 +50,12 @@ user1@localhost user1@localhost ...@@ -51,9 +50,12 @@ user1@localhost user1@localhost
CALL test.p2(); CALL test.p2();
CURRENT_USER() USER() CURRENT_USER() USER()
root@localhost user1@localhost root@localhost user1@localhost
connection master;
DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p3; DROP PROCEDURE IF EXISTS test.p3;
DROP PROCEDURE IF EXISTS test.p2; DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2; DROP TABLE IF EXISTS test.t2;
DROP USER 'user1'@'localhost'; DROP USER user1@localhost;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection 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 auto_increment primary key, b int, key(b)); create table t1 (a int not null auto_increment primary key, b int, key(b));
stop slave; connection slave;
include/stop_slave.inc
connection master;
INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
INSERT INTO t1 (a) SELECT null FROM t1; INSERT INTO t1 (a) SELECT null FROM t1;
INSERT INTO t1 (a) SELECT null FROM t1; INSERT INTO t1 (a) SELECT null FROM t1;
...@@ -20,7 +19,9 @@ INSERT INTO t1 (a) SELECT null FROM t1; ...@@ -20,7 +19,9 @@ INSERT INTO t1 (a) SELECT null FROM t1;
INSERT INTO t1 (a) SELECT null FROM t1; INSERT INTO t1 (a) SELECT null FROM t1;
INSERT INTO t1 (a) SELECT null FROM t1; INSERT INTO t1 (a) SELECT null FROM t1;
INSERT INTO t1 (a) SELECT null FROM t1; INSERT INTO t1 (a) SELECT null FROM t1;
start slave; connection slave;
stop slave; include/start_slave.inc
include/stop_slave.inc
drop table t1; drop table t1;
connection master;
drop table t1; drop table t1;
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
CREATE TABLE test.t1 (n MEDIUMINT NOT NULL, d DATETIME, PRIMARY KEY(n)); CREATE TABLE test.t1 (n MEDIUMINT NOT NULL, d DATETIME, PRIMARY KEY(n));
CREATE TABLE test.t2 (n MEDIUMINT NOT NULL AUTO_INCREMENT, f FLOAT, d DATETIME, PRIMARY KEY(n)); CREATE TABLE test.t2 (n MEDIUMINT NOT NULL AUTO_INCREMENT, f FLOAT, d DATETIME, PRIMARY KEY(n));
CREATE TABLE test.t3 (n MEDIUMINT NOT NULL AUTO_INCREMENT, d DATETIME, PRIMARY KEY(n)); CREATE TABLE test.t3 (n MEDIUMINT NOT NULL AUTO_INCREMENT, d DATETIME, PRIMARY KEY(n));
INSERT INTO test.t1 VALUES (1,NOW()); INSERT INTO test.t1 VALUES (1,NOW());
CREATE TRIGGER test.t2_ai AFTER INSERT ON test.t2 FOR EACH ROW UPDATE test.t1 SET d=NOW() where n = 1;// CREATE TRIGGER test.t2_ai AFTER INSERT ON test.t2 FOR EACH ROW UPDATE test.t1 SET d=NOW() where n = 1//
CREATE PROCEDURE test.p3() CREATE PROCEDURE test.p3()
BEGIN BEGIN
INSERT INTO test.t3 (d) VALUES (NOW()); INSERT INTO test.t3 (d) VALUES (NOW());
...@@ -18,9 +14,15 @@ CREATE PROCEDURE test.p2() ...@@ -18,9 +14,15 @@ CREATE PROCEDURE test.p2()
BEGIN BEGIN
INSERT INTO test.t2 (f,d) VALUES (RAND(),NOW()); INSERT INTO test.t2 (f,d) VALUES (RAND(),NOW());
END// END//
connection slave;
connection master;
connection master;
INSERT INTO test.t1 VALUES (1+1, NOW());
connection slave;
<End test section 2 (Tiggers & SP)> <End test section 2 (Tiggers & SP)>
----------------------------------- -----------------------------------
connection master;
DROP PROCEDURE test.p2; DROP PROCEDURE test.p2;
DROP PROCEDURE test.p3; DROP PROCEDURE test.p3;
DROP TRIGGER test.t2_ai; DROP TRIGGER test.t2_ai;
...@@ -28,3 +30,5 @@ DROP TRIGGER test.t3_bi_t2; ...@@ -28,3 +30,5 @@ DROP TRIGGER test.t3_bi_t2;
DROP TABLE test.t1; DROP TABLE test.t1;
DROP TABLE test.t2; DROP TABLE test.t2;
DROP TABLE test.t3; DROP TABLE test.t3;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
DROP TRIGGER test.t2_ai; DROP TRIGGER test.t2_ai;
DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2; DROP TABLE IF EXISTS test.t2;
...@@ -20,6 +17,7 @@ id domain ...@@ -20,6 +17,7 @@ id domain
3 earthmotherwear.com 3 earthmotherwear.com
4 yahoo.com 4 yahoo.com
5 example.com 5 example.com
connection slave;
SELECT * FROM test.t1 ORDER BY id; SELECT * FROM test.t1 ORDER BY id;
id domain id domain
1 example.com 1 example.com
...@@ -27,6 +25,7 @@ id domain ...@@ -27,6 +25,7 @@ id domain
3 earthmotherwear.com 3 earthmotherwear.com
4 yahoo.com 4 yahoo.com
5 example.com 5 example.com
connection master;
INSERT INTO test.t3 VALUES ('Yes', 5, NULL, 'spamfilter','scan_incoming'); INSERT INTO test.t3 VALUES ('Yes', 5, NULL, 'spamfilter','scan_incoming');
INSERT INTO test.t3 VALUES ('Yes', 1, NULL, 'spamfilter','scan_incoming'); INSERT INTO test.t3 VALUES ('Yes', 1, NULL, 'spamfilter','scan_incoming');
INSERT INTO test.t2 VALUES ('Yes', 1, NULL, 'spamfilter','scan_incoming'); INSERT INTO test.t2 VALUES ('Yes', 1, NULL, 'spamfilter','scan_incoming');
...@@ -37,6 +36,7 @@ select * from test.t3; ...@@ -37,6 +36,7 @@ select * from test.t3;
value domain_id mailaccount_id program keey value domain_id mailaccount_id program keey
No 5 NULL spamfilter scan_incoming No 5 NULL spamfilter scan_incoming
Yes 1 NULL spamfilter scan_incoming Yes 1 NULL spamfilter scan_incoming
connection slave;
select * from test.t2; select * from test.t2;
value domain_id mailaccount_id program keey value domain_id mailaccount_id program keey
Yes 1 NULL spamfilter scan_incoming Yes 1 NULL spamfilter scan_incoming
...@@ -44,6 +44,7 @@ select * from test.t3; ...@@ -44,6 +44,7 @@ select * from test.t3;
value domain_id mailaccount_id program keey value domain_id mailaccount_id program keey
No 5 NULL spamfilter scan_incoming No 5 NULL spamfilter scan_incoming
Yes 1 NULL spamfilter scan_incoming Yes 1 NULL spamfilter scan_incoming
connection master;
DELETE FROM test.t1 WHERE id = 1; DELETE FROM test.t1 WHERE id = 1;
SELECT * FROM test.t1 ORDER BY id; SELECT * FROM test.t1 ORDER BY id;
id domain id domain
...@@ -51,19 +52,24 @@ id domain ...@@ -51,19 +52,24 @@ id domain
3 earthmotherwear.com 3 earthmotherwear.com
4 yahoo.com 4 yahoo.com
5 example.com 5 example.com
connection master;
SELECT * FROM test.t1 ORDER BY id; SELECT * FROM test.t1 ORDER BY id;
id domain id domain
2 mysql.com 2 mysql.com
3 earthmotherwear.com 3 earthmotherwear.com
4 yahoo.com 4 yahoo.com
5 example.com 5 example.com
connection slave;
SELECT * FROM test.t1 ORDER BY id; SELECT * FROM test.t1 ORDER BY id;
id domain id domain
2 mysql.com 2 mysql.com
3 earthmotherwear.com 3 earthmotherwear.com
4 yahoo.com 4 yahoo.com
5 example.com 5 example.com
connection master;
DROP TRIGGER test.t2_ai; DROP TRIGGER test.t2_ai;
DROP TABLE test.t1; DROP TABLE test.t1;
DROP TABLE test.t2; DROP TABLE test.t2;
DROP TABLE test.t3; DROP TABLE test.t3;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
DROP TRIGGER test.t1_bi; DROP TRIGGER test.t1_bi;
DROP TRIGGER test.t2_ai; DROP TRIGGER test.t2_ai;
DROP TRIGGER test.t1_bu; DROP TRIGGER test.t1_bu;
...@@ -69,15 +66,11 @@ INSERT INTO test.t2 VALUES(NULL,0,'Testing MySQL databases is a cool ', 'MySQL C ...@@ -69,15 +66,11 @@ INSERT INTO test.t2 VALUES(NULL,0,'Testing MySQL databases is a cool ', 'MySQL C
UPDATE test.t1 SET b1 = 0 WHERE b1 = 1; UPDATE test.t1 SET b1 = 0 WHERE b1 = 1;
INSERT INTO test.t2 VALUES(NULL,1,'This is an after update test.', 'If this works, total will not be zero on the master or slave',1.4321,5.221,0,YEAR(NOW()),NOW()); INSERT INTO test.t2 VALUES(NULL,1,'This is an after update test.', 'If this works, total will not be zero on the master or slave',1.4321,5.221,0,YEAR(NOW()),NOW());
UPDATE test.t2 SET b1 = 0 WHERE b1 = 1; UPDATE test.t2 SET b1 = 0 WHERE b1 = 1;
Warnings:
Error 1329 No data - zero rows fetched, selected, or processed
INSERT INTO test.t1 VALUES(NULL,1,'add some more test data test.', 'and hope for the best', 3.321,5.221,0,YEAR(NOW()),NOW()); INSERT INTO test.t1 VALUES(NULL,1,'add some more test data test.', 'and hope for the best', 3.321,5.221,0,YEAR(NOW()),NOW());
DELETE FROM test.t1 WHERE id = 1; DELETE FROM test.t1 WHERE id = 1;
Warnings:
Error 1329 No data - zero rows fetched, selected, or processed
DELETE FROM test.t2 WHERE id = 1; DELETE FROM test.t2 WHERE id = 1;
Warnings: connection slave;
Error 1329 No data - zero rows fetched, selected, or processed connection master;
DROP TRIGGER test.t1_bi; DROP TRIGGER test.t1_bi;
DROP TRIGGER test.t2_ai; DROP TRIGGER test.t2_ai;
DROP TRIGGER test.t1_bu; DROP TRIGGER test.t1_bu;
...@@ -87,3 +80,5 @@ DROP TRIGGER test.t2_ad; ...@@ -87,3 +80,5 @@ DROP TRIGGER test.t2_ad;
DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2; DROP TABLE IF EXISTS test.t2;
DROP TABLE IF EXISTS test.t3; DROP TABLE IF EXISTS test.t3;
connection slave;
include/rpl_end.inc
...@@ -6,15 +6,14 @@ INSERT INTO t1 VALUES (1),(2),(3),(4); ...@@ -6,15 +6,14 @@ INSERT INTO t1 VALUES (1),(2),(3),(4);
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t2(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY); CREATE TABLE t2(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
INSERT INTO t2 VALUES (1),(2); INSERT INTO t2 VALUES (1),(2);
connection slave;
connection master;
INSERT INTO t2 VALUES (3),(4); INSERT INTO t2 VALUES (3),(4);
DROP TABLE t2; DROP TABLE t2;
connection slave; connection slave;
include/stop_slave.inc include/stop_slave.inc
RESET SLAVE; RESET SLAVE;
CHANGE MASTER TO MASTER_USER='root', MASTER_CONNECT_RETRY=1, MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_MYPORT;
connection slave; connection slave;
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_drop_t1 START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_drop_t1;
include/wait_for_slave_sql_to_stop.inc include/wait_for_slave_sql_to_stop.inc
SELECT * FROM t1; SELECT * FROM t1;
n n
...@@ -23,7 +22,7 @@ n ...@@ -23,7 +22,7 @@ n
3 3
4 4
include/check_slave_param.inc [Exec_Master_Log_Pos] include/check_slave_param.inc [Exec_Master_Log_Pos]
START SLAVE UNTIL MASTER_LOG_FILE='master-no-such-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS; START SLAVE UNTIL MASTER_LOG_FILE='master-no-such-bin.000001', MASTER_LOG_POS=291;
include/wait_for_slave_sql_to_stop.inc include/wait_for_slave_sql_to_stop.inc
SELECT * FROM t1; SELECT * FROM t1;
n n
...@@ -32,19 +31,12 @@ n ...@@ -32,19 +31,12 @@ n
3 3
4 4
include/check_slave_param.inc [Exec_Master_Log_Pos] include/check_slave_param.inc [Exec_Master_Log_Pos]
START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', RELAY_LOG_POS=relay_pos_insert1_t2
include/wait_for_slave_sql_to_stop.inc
SELECT * FROM t2;
n
1
2
include/check_slave_param.inc [Exec_Master_Log_Pos]
START SLAVE; START SLAVE;
include/wait_for_slave_to_start.inc include/wait_for_slave_to_start.inc
connection master; connection master;
connection slave; connection slave;
include/stop_slave.inc include/stop_slave.inc
START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_create_t2 START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_create_t2;
include/wait_for_slave_param.inc [Until_Log_Pos] include/wait_for_slave_param.inc [Until_Log_Pos]
include/wait_for_slave_sql_to_stop.inc include/wait_for_slave_sql_to_stop.inc
include/check_slave_param.inc [Exec_Master_Log_Pos] include/check_slave_param.inc [Exec_Master_Log_Pos]
...@@ -58,10 +50,25 @@ START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000009'; ...@@ -58,10 +50,25 @@ START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000009';
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', MASTER_LOG_POS=MASTER_LOG_POS; START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', MASTER_LOG_POS=MASTER_LOG_POS;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
START SLAVE;
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS; START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS;
Warnings:
Note 1254 Slave is already running
include/stop_slave.inc include/stop_slave.inc
RESET SLAVE; RESET SLAVE;
include/start_slave.inc
include/rpl_reset.inc
connection master;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1);
connection slave;
include/stop_slave_sql.inc
connection master;
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (3);
include/sync_slave_io_with_master.inc
start slave until relay_log_file='slave-relay-bin.000002', relay_log_pos=relay_log_pos;
include/wait_for_slave_sql_to_stop.inc
include/assert.inc [table t1 should have two rows.]
include/start_slave.inc
connection master;
DROP TABLE t1;
connection slave;
include/rpl_end.inc include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create database if not exists mysqltest1; create database if not exists mysqltest1;
DROP VIEW IF EXISTS mysqltest1.v1; DROP VIEW IF EXISTS mysqltest1.v1;
DROP VIEW IF EXISTS mysqltest1.v2; DROP VIEW IF EXISTS mysqltest1.v2;
...@@ -35,6 +32,7 @@ a c c2 ...@@ -35,6 +32,7 @@ a c c2
1 Thank GOD 1 Thank GOD
2 it is 2 it is
3 Friday TGIF 3 Friday TGIF
connection slave;
SELECT * FROM mysqltest1.v2; SELECT * FROM mysqltest1.v2;
qty price value qty price value
3 50 150 3 50 150
...@@ -45,6 +43,7 @@ a c c2 ...@@ -45,6 +43,7 @@ a c c2
1 Thank GOD 1 Thank GOD
2 it is 2 it is
3 Friday TGIF 3 Friday TGIF
connection master;
INSERT INTO mysqltest1.t5 SELECT * FROM mysqltest1.v2; INSERT INTO mysqltest1.t5 SELECT * FROM mysqltest1.v2;
INSERT INTO mysqltest1.t3 SELECT * FROM mysqltest1.v1; INSERT INTO mysqltest1.t3 SELECT * FROM mysqltest1.v1;
SELECT * FROM mysqltest1.t5 ORDER BY qty; SELECT * FROM mysqltest1.t5 ORDER BY qty;
...@@ -57,6 +56,7 @@ a c c2 ...@@ -57,6 +56,7 @@ a c c2
1 Thank GOD 1 Thank GOD
2 it is 2 it is
3 Friday TGIF 3 Friday TGIF
connection slave;
SELECT * FROM mysqltest1.t5 ORDER BY qty; SELECT * FROM mysqltest1.t5 ORDER BY qty;
qty price total qty price total
3 50 150 3 50 150
...@@ -67,6 +67,7 @@ a c c2 ...@@ -67,6 +67,7 @@ a c c2
1 Thank GOD 1 Thank GOD
2 it is 2 it is
3 Friday TGIF 3 Friday TGIF
connection master;
INSERT INTO mysqltest1.v4 VALUES (4,'TEST'); INSERT INTO mysqltest1.v4 VALUES (4,'TEST');
SELECT * FROM mysqltest1.t1 ORDER BY a; SELECT * FROM mysqltest1.t1 ORDER BY a;
a c a c
...@@ -79,6 +80,7 @@ a c ...@@ -79,6 +80,7 @@ a c
2 it 2 it
3 Friday 3 Friday
4 TEST 4 TEST
connection slave;
SELECT * FROM mysqltest1.t1 ORDER BY a; SELECT * FROM mysqltest1.t1 ORDER BY a;
a c a c
1 Thank 1 Thank
...@@ -90,6 +92,7 @@ a c ...@@ -90,6 +92,7 @@ a c
2 it 2 it
3 Friday 3 Friday
4 TEST 4 TEST
connection master;
DROP VIEW IF EXISTS mysqltest1.v1; DROP VIEW IF EXISTS mysqltest1.v1;
DROP VIEW IF EXISTS mysqltest1.v2; DROP VIEW IF EXISTS mysqltest1.v2;
DROP VIEW IF EXISTS mysqltest1.v3; DROP VIEW IF EXISTS mysqltest1.v3;
...@@ -99,3 +102,5 @@ DROP TABLE IF EXISTS mysqltest1.t1; ...@@ -99,3 +102,5 @@ DROP TABLE IF EXISTS mysqltest1.t1;
DROP TABLE IF EXISTS mysqltest1.t2; DROP TABLE IF EXISTS mysqltest1.t2;
DROP TABLE IF EXISTS mysqltest1.t4; DROP TABLE IF EXISTS mysqltest1.t4;
DROP DATABASE mysqltest1; DROP DATABASE mysqltest1;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection slave;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1 (n int); create table t1 (n int);
reset master; reset master;
stop slave; include/stop_slave.inc
change master to master_port=SLAVE_PORT; change master to master_port=SLAVE_PORT;
show slave status; 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 Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 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 Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State
127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # # 0 0 0 107 None 0 No NULL No 0 0 1 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # # 0 0 0 256 None 0 No NULL No 0 0 1 No conservative 0 NULL
start slave; start slave;
insert into t1 values (1); insert into t1 values (1);
show status like "slave_running"; include/wait_for_slave_param.inc [Last_IO_Errno]
Variable_name Value Last_IO_Errno = '1593'
Slave_running OFF Last_IO_Error = 'Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).'
include/stop_slave.inc
reset slave;
reset master;
drop table t1; drop table t1;
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection slave;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1 (n int); create table t1 (n int);
reset master; reset master;
stop slave; stop slave;
include/wait_for_slave_to_stop.inc
change master to master_port=SLAVE_PORT; change master to master_port=SLAVE_PORT;
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 Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id
127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 107 None 0 No NULL No 0 0 1
start slave; start slave;
include/wait_for_slave_to_start.inc
insert into t1 values (1); insert into t1 values (1);
select * from t1; select * from t1;
n n
1 1
1 1
stop slave; stop slave;
include/wait_for_slave_to_stop.inc
drop table t1;
connection master;
reset master;
create table t1(n int);
create table t2(n int);
connection slave;
change master to master_port=MASTER_PORT;
start slave until master_log_file='master-bin.000001', master_log_pos=UNTIL_POS;
include/wait_for_slave_io_to_start.inc
include/wait_for_slave_sql_to_stop.inc
*** checking until position execution: must be only t1 in the list ***
show tables;
Tables_in_test
t1
connection slave;
start slave sql_thread;
connection master;
drop table t1; drop table t1;
drop table t2;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop table if exists t1; drop table if exists t1;
Warnings: Warnings:
Note 1051 Unknown table 't1' Note 1051 Unknown table 'test.t1'
create table t1(a varchar(100),b int); create table t1(a varchar(100),b int);
set @@session.sql_mode=pipes_as_concat; set @@session.sql_mode=pipes_as_concat;
insert into t1 values('My'||'SQL', 1); insert into t1 values('My'||'SQL', 1);
...@@ -16,10 +12,12 @@ select * from t1 where b<3 order by a; ...@@ -16,10 +12,12 @@ select * from t1 where b<3 order by a;
a b a b
1 2 1 2
MySQL 1 MySQL 1
connection slave;
select * from t1 where b<3 order by a; select * from t1 where b<3 order by a;
a b a b
1 2 1 2
MySQL 1 MySQL 1
connection master;
set @@session.sql_mode=ignore_space; set @@session.sql_mode=ignore_space;
insert into t1 values(password ('MySQL'), 3); insert into t1 values(password ('MySQL'), 3);
set @@session.sql_mode=ansi_quotes; set @@session.sql_mode=ansi_quotes;
...@@ -37,7 +35,24 @@ insert into t2 select 2,a from t1 where a is null; ...@@ -37,7 +35,24 @@ insert into t2 select 2,a from t1 where a is null;
select * from t2 order by b; select * from t2 order by b;
b a b a
1 1 1 1
connection slave;
select * from t2 order by b; select * from t2 order by b;
b a b a
1 1 1 1
connection master;
drop table t1,t2; drop table t1,t2;
connection slave;
connection master;
CREATE TABLE t1 (
`id` int(11) NOT NULL auto_increment,
`data` varchar(100),
PRIMARY KEY (`id`)
) ENGINE=MyISAM;
INSERT INTO t1(data) VALUES(SESSION_USER());
connection slave;
SELECT length(data) < 100 FROM t1;
length(data) < 100
1
connection master;
drop table t1;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
set global log_bin_trust_function_creators=0; set global log_bin_trust_function_creators=0;
set binlog_format=STATEMENT; set binlog_format=STATEMENT;
create function fn16456() create function fn16456()
...@@ -27,3 +23,4 @@ set binlog_format=STATEMENT; ...@@ -27,3 +23,4 @@ set binlog_format=STATEMENT;
select fn16456(); select fn16456();
ERROR HY000: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable) ERROR HY000: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
drop function fn16456; drop function fn16456;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1 (n int not null primary key); create table t1 (n int not null primary key);
connection slave;
insert into t1 values (1); insert into t1 values (1);
connection master;
insert into t1 values (1); insert into t1 values (1);
insert into t1 values (2),(3); insert into t1 values (2),(3);
connection slave;
select * from t1 ORDER BY n; select * from t1 ORDER BY n;
n n
1 1
2 2
3 3
connection master;
drop table t1; drop table t1;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; ==== Create new replication user ====
reset slave; connection master;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; GRANT REPLICATION SLAVE ON *.* TO rpl@127.0.0.1 IDENTIFIED BY 'rpl';
start slave; connection slave;
grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl'; include/stop_slave.inc
stop slave; set @save_relay_log_purge=@@global.relay_log_purge;
change master to master_user='rpl',master_password='rpl'; set @@global.relay_log_purge=0;
start slave; CHANGE MASTER TO master_user='rpl', master_password='rpl';
drop table if exists t1; select @@global.relay_log_purge;
create table t1 (n int); @@global.relay_log_purge
insert into t1 values (1); 0
select * from t1; set @@global.relay_log_purge=1;
CHANGE MASTER TO master_user='rpl', master_password='rpl';
select @@global.relay_log_purge;
@@global.relay_log_purge
1
set @@global.relay_log_purge=@save_relay_log_purge;
CHANGE MASTER TO master_user='rpl', master_password='rpl';
include/start_slave.inc
==== Do replication as new user ====
connection master;
CREATE TABLE t1 (n INT);
INSERT INTO t1 VALUES (1);
connection slave;
SELECT * FROM t1;
n n
1 1
drop user rpl@127.0.0.1; ==== Delete new replication user ====
flush privileges; connection master;
stop slave; DROP USER rpl@127.0.0.1;
start slave; FLUSH PRIVILEGES;
show slave status; connection slave;
Slave_IO_State # ==== Restart slave without privileges =====
Master_Host 127.0.0.1 include/stop_slave.inc
Master_User rpl START SLAVE;
Master_Port MASTER_MYPORT include/wait_for_slave_sql_to_start.inc
Connect_Retry 1 include/wait_for_slave_io_to_stop.inc
Master_Log_File master-bin.000001 ==== Verify that Slave IO thread stopped with error ====
Read_Master_Log_Pos # include/wait_for_slave_io_error.inc [errno=1045]
Relay_Log_File # ==== Cleanup (Note that slave IO thread is not running) ====
Relay_Log_Pos # include/stop_slave_sql.inc
Relay_Master_Log_File master-bin.000001 CHANGE MASTER TO MASTER_USER = 'root', MASTER_PASSWORD = '';
Slave_IO_Running Connecting include/rpl_reset.inc
Slave_SQL_Running Yes connection master;
Replicate_Do_DB DROP TABLE t1;
Replicate_Ignore_DB include/rpl_end.inc
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master NULL
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
Last_SQL_Error
Replicate_Ignore_Server_Ids
Master_Server_Id 1
drop table t1;
drop table t1;
This diff is collapsed.
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2; DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t2; DROP TABLE IF EXISTS test.t2;
...@@ -38,6 +35,7 @@ a ...@@ -38,6 +35,7 @@ a
2 2
3 3
8 8
connection slave;
SELECT * FROM test.t1 ORDER BY a; SELECT * FROM test.t1 ORDER BY a;
a a
1 1
...@@ -50,15 +48,18 @@ a ...@@ -50,15 +48,18 @@ a
2 2
3 3
8 8
connection master;
CALL test.p2(); CALL test.p2();
USE test; USE test;
SHOW TABLES; SHOW TABLES;
Tables_in_test Tables_in_test
t3 t3
connection slave;
USE test; USE test;
SHOW TABLES; SHOW TABLES;
Tables_in_test Tables_in_test
t3 t3
connection master;
CALL test.p1(); CALL test.p1();
Warnings: Warnings:
Note 1050 Table 't3' already exists Note 1050 Table 't3' already exists
...@@ -74,6 +75,7 @@ a ...@@ -74,6 +75,7 @@ a
2 2
3 3
8 8
connection slave;
SELECT * FROM test.t1 ORDER BY a; SELECT * FROM test.t1 ORDER BY a;
a a
1 1
...@@ -86,8 +88,11 @@ a ...@@ -86,8 +88,11 @@ a
2 2
3 3
8 8
connection master;
DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2; DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2; DROP TABLE IF EXISTS test.t2;
DROP TABLE IF EXISTS test.t3; DROP TABLE IF EXISTS test.t3;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection master;
reset slave; SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop procedure if exists p1; drop procedure if exists p1;
drop procedure if exists p2; drop procedure if exists p2;
drop function if exists f1; drop function if exists f1;
...@@ -20,6 +18,8 @@ set spv=spv+1; ...@@ -20,6 +18,8 @@ set spv=spv+1;
end while; end while;
end// end//
call p1(); call p1();
connection slave;
connection slave;
SELECT * FROM t1 ORDER BY a; SELECT * FROM t1 ORDER BY a;
a a
1 1
...@@ -27,6 +27,7 @@ a ...@@ -27,6 +27,7 @@ a
3 3
4 4
5 5
connection master;
SELECT * FROM t1 ORDER BY a; SELECT * FROM t1 ORDER BY a;
a a
1 1
...@@ -43,9 +44,12 @@ call p2(); ...@@ -43,9 +44,12 @@ call p2();
SELECT * FROM t2 ORDER BY a; SELECT * FROM t2 ORDER BY a;
a a
4 4
connection slave;
connection slave;
SELECT * FROM t2 ORDER BY a; SELECT * FROM t2 ORDER BY a;
a a
4 4
connection master;
drop procedure p1; drop procedure p1;
drop procedure p2; drop procedure p2;
drop table t2; drop table t2;
...@@ -104,6 +108,8 @@ master: 7 ...@@ -104,6 +108,8 @@ master: 7
master: 8 master: 8
master: 10 master: 10
master: 11 master: 11
connection slave;
connection slave;
SELECT 'slave:',a FROM t1 ORDER BY a; SELECT 'slave:',a FROM t1 ORDER BY a;
slave: a slave: a
slave: 1 slave: 1
...@@ -120,6 +126,7 @@ slave: 7 ...@@ -120,6 +126,7 @@ slave: 7
slave: 8 slave: 8
slave: 10 slave: 10
slave: 11 slave: 11
connection master;
drop procedure p1; drop procedure p1;
delete from t1; delete from t1;
delete from t2; delete from t2;
...@@ -134,10 +141,13 @@ SELECT 'master:',a FROM t1 ORDER BY a; ...@@ -134,10 +141,13 @@ SELECT 'master:',a FROM t1 ORDER BY a;
master: a master: a
master: 1 master: 1
master: 2 master: 2
connection slave;
connection slave;
SELECT 'slave:',a FROM t1 ORDER BY a; SELECT 'slave:',a FROM t1 ORDER BY a;
slave: a slave: a
slave: 1 slave: 1
slave: 2 slave: 2
connection master;
drop view v1; drop view v1;
delete from t1; delete from t1;
prepare s1 from 'select f1(?)'; prepare s1 from 'select f1(?)';
...@@ -148,9 +158,12 @@ f1(?) ...@@ -148,9 +158,12 @@ f1(?)
SELECT 'master:',a FROM t1 ORDER BY a; SELECT 'master:',a FROM t1 ORDER BY a;
master: a master: a
master: 123 master: 123
connection slave;
connection slave;
SELECT 'slave:',a FROM t1 ORDER BY a; SELECT 'slave:',a FROM t1 ORDER BY a;
slave: a slave: a
slave: 123 slave: 123
connection master;
delete from t1; delete from t1;
create procedure p1(spv int) create procedure p1(spv int)
begin begin
...@@ -169,12 +182,15 @@ master: 6 ...@@ -169,12 +182,15 @@ master: 6
master: 6 master: 6
master: 15 master: 15
master: 15 master: 15
connection slave;
connection slave;
SELECT 'slave:',a FROM t1 ORDER BY a; SELECT 'slave:',a FROM t1 ORDER BY a;
slave: a slave: a
slave: 6 slave: 6
slave: 6 slave: 6
slave: 15 slave: 15
slave: 15 slave: 15
connection master;
drop procedure p1; drop procedure p1;
drop function f1; drop function f1;
drop table t1,t2; drop table t1,t2;
...@@ -220,6 +236,8 @@ master 100 ...@@ -220,6 +236,8 @@ master 100
master 101 master 101
master 101 master 101
master 102 master 102
connection slave;
connection slave;
SELECT 'slave', a FROM t1 ORDER BY a; SELECT 'slave', a FROM t1 ORDER BY a;
slave a slave a
slave 10 slave 10
...@@ -231,7 +249,73 @@ slave 100 ...@@ -231,7 +249,73 @@ slave 100
slave 101 slave 101
slave 101 slave 101
slave 102 slave 102
connection master;
drop table t1; drop table t1;
drop function f1; drop function f1;
drop function f2; drop function f2;
drop procedure p1; drop procedure p1;
connection slave;
connection master;
create table t2 (b BIT(7));
create procedure sp_bug26199(bitvalue BIT(7))
begin
insert into t2 set b = bitvalue;
end //
create function sf_bug26199(b BIT(7)) returns int
begin
insert into t2 values(b);
return 0;
end//
call sp_bug26199(b'1110');
call sp_bug26199('\0');
select sf_bug26199(b'1111111');
sf_bug26199(b'1111111')
0
SET STATEMENT sql_mode = '' FOR
select sf_bug26199(b'101111111');
sf_bug26199(b'101111111')
0
Warnings:
Warning 1264 Out of range value for column 'b' at row 1
select sf_bug26199('\'');
sf_bug26199('\'')
0
select hex(b) from t2;
hex(b)
E
0
7F
7F
27
connection slave;
select hex(b) from t2;
hex(b)
E
0
7F
7F
27
connection master;
drop table t2;
drop procedure sp_bug26199;
drop function sf_bug26199;
SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
connection slave;
set names utf8;
CREATE FUNCTION f() RETURNS timestamp DETERMINISTIC
BEGIN RETURN '2012-12-21 12:12:12'; END |
CREATE PROCEDURE p(t timestamp)
BEGIN
SET @t = t;
PREPARE stmt FROM "
UPDATE t1 SET a = @t WHERE '2012-12-31 08:00:00' < f() ";
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
END |
create table t1 (a timestamp);
call p('2012-12-31 08:00:00');
drop table t1;
drop procedure p;
drop function f;
end of the tests
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection slave;
reset slave; include/stop_slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; connection master;
start slave;
stop slave;
create table t1(n int); create table t1(n int);
start slave; connection slave;
stop slave io_thread; include/start_slave.inc
include/stop_slave_io.inc
start slave io_thread; start slave io_thread;
include/wait_for_slave_io_to_start.inc
connection master;
connection slave;
connection master;
drop table t1; drop table t1;
connection slave;
include/rpl_end.inc
include/master-slave.inc
[connection master]
connection slave;
stop slave; stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; connection master;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
stop slave;
# #
# Generate a big enough master's binlog to cause relay log rotations # Generate a big enough master's binlog to cause relay log rotations
# #
create table t1 (a int); create table t1 (a int);
drop table t1; drop table t1;
connection slave;
reset slave; reset slave;
# #
# Test 1 # Test 1
# #
set @my_max_binlog_size= @@global.max_binlog_size; set @my_max_binlog_size= @@global.max_binlog_size, @my_max_relay_log_size=@@global.max_relay_log_size;
set global max_binlog_size=8192; set global max_binlog_size=8192;
set global max_relay_log_size=8192-1; set global max_relay_log_size=8192-1;
Warnings: Warnings:
...@@ -23,7 +22,7 @@ select @@global.max_relay_log_size; ...@@ -23,7 +22,7 @@ select @@global.max_relay_log_size;
@@global.max_relay_log_size @@global.max_relay_log_size
4096 4096
start slave; start slave;
Checking that both slave threads are running. include/check_slave_is_running.inc
# #
# Test 2 # Test 2
# #
...@@ -33,17 +32,19 @@ set global max_relay_log_size=(5*4096); ...@@ -33,17 +32,19 @@ set global max_relay_log_size=(5*4096);
select @@global.max_relay_log_size; select @@global.max_relay_log_size;
@@global.max_relay_log_size 20480 @@global.max_relay_log_size 20480
start slave; start slave;
Checking that both slave threads are running. include/check_slave_is_running.inc
# #
# Test 3: max_relay_log_size = 0 # Test 3: max_relay_log_size = 0
# #
stop slave; stop slave;
reset slave; reset slave;
set global max_relay_log_size=0; set global max_relay_log_size=0;
Warnings:
Warning 1292 Truncated incorrect max_relay_log_size value: '0'
select @@global.max_relay_log_size; select @@global.max_relay_log_size;
@@global.max_relay_log_size 0 @@global.max_relay_log_size 4096
start slave; start slave;
Checking that both slave threads are running. include/check_slave_is_running.inc
# #
# Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
# #
...@@ -56,19 +57,27 @@ flush logs; ...@@ -56,19 +57,27 @@ flush logs;
reset slave; reset slave;
start slave; start slave;
flush logs; flush logs;
connection master;
create table t1 (a int); create table t1 (a int);
Checking that both slave threads are running. connection slave;
include/check_slave_is_running.inc
# #
# Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
# #
flush logs; flush logs;
connection master;
drop table t1; drop table t1;
Checking that both slave threads are running. connection slave;
include/check_slave_is_running.inc
connection master;
flush logs; flush logs;
show master status; show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000002 # <Binlog_Do_DB> <Binlog_Ignore_DB> master-bin.000002 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
set global max_binlog_size= @my_max_binlog_size; set global max_binlog_size= @my_max_binlog_size;
set global max_relay_log_size= @my_max_relay_log_size;
# #
# End of 4.1 tests # End of 4.1 tests
# #
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1(n int auto_increment primary key, s char(10)); create table t1(n int auto_increment primary key, s char(10));
connection slave;
insert into t1 values (2,'old'); insert into t1 values (2,'old');
connection master;
insert into t1 values(NULL,'new'); insert into t1 values(NULL,'new');
insert into t1 values(NULL,'new'); insert into t1 values(NULL,'new');
connection slave;
select * from t1 order by n; select * from t1 order by n;
n s n s
1 new 1 new
2 old 2 old
delete from t1 where n = 2; delete from t1 where n = 2;
start slave; include/start_slave.inc
stop slave; include/stop_slave.inc
connection master;
create table t2(n int); create table t2(n int);
drop table t2; drop table t2;
insert into t1 values(NULL,'new'); insert into t1 values(NULL,'new');
...@@ -22,10 +22,14 @@ set sql_log_bin=0; ...@@ -22,10 +22,14 @@ set sql_log_bin=0;
insert into t1 values(NULL,'new'); insert into t1 values(NULL,'new');
set sql_log_bin=1; set sql_log_bin=1;
delete from t1 where n=4; delete from t1 where n=4;
start slave; connection slave;
include/start_slave.inc
select * from t1 order by n; select * from t1 order by n;
n s n s
1 new 1 new
2 new 2 new
3 new 3 new
connection master;
drop table t1; drop table t1;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection slave;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create database mysqltest; create database mysqltest;
connection master;
drop database if exists mysqltest; drop database if exists mysqltest;
Warnings: Warnings:
Note 1008 Can't drop database 'mysqltest'; database doesn't exist Note 1008 Can't drop database 'mysqltest'; database doesn't exist
connection slave;
show tables from mysqltest; show tables from mysqltest;
ERROR 42000: Unknown database 'mysqltest' ERROR 42000: Unknown database 'mysqltest'
connection slave;
create table t1 (a int); create table t1 (a int);
connection master;
drop table if exists t1; drop table if exists t1;
Warnings: Warnings:
Note 1051 Unknown table 't1' Note 1051 Unknown table 'test.t1'
connection slave;
select * from t1; select * from t1;
ERROR 42S02: Table 'test.t1' doesn't exist ERROR 42S02: Table 'test.t1' doesn't exist
connection master;
create table t1 (a int, b int); create table t1 (a int, b int);
connection slave;
insert into t1 values(1,1); insert into t1 values(1,1);
connection master;
delete from t1; delete from t1;
connection slave;
select * from t1; select * from t1;
a b a b
insert into t1 values(1,1); insert into t1 values(1,1);
connection master;
insert into t1 values(2,1); insert into t1 values(2,1);
update t1 set a=2; update t1 set a=2;
connection slave;
select * from t1; select * from t1;
a b a b
2 1 2 1
2 1 2 1
connection master;
create table t2 (a int, b int); create table t2 (a int, b int);
delete from t1; delete from t1;
insert into t1 values(1,1); insert into t1 values(1,1);
insert into t2 values(1,1); insert into t2 values(1,1);
connection slave;
update t1 set a=2; update t1 set a=2;
connection master;
UPDATE t1, t2 SET t1.a = t2.a; UPDATE t1, t2 SET t1.a = t2.a;
connection slave;
select * from t1; select * from t1;
a b a b
1 1 1 1
select * from t2; select * from t2;
a b a b
1 1 1 1
connection master;
delete from t1; delete from t1;
delete from t2; delete from t2;
connection slave;
insert into t1 values(1,1); insert into t1 values(1,1);
insert into t2 values(1,1); insert into t2 values(1,1);
connection master;
DELETE t1.*, t2.* from t1, t2; DELETE t1.*, t2.* from t1, t2;
connection slave;
select * from t1; select * from t1;
a b a b
select * from t2; select * from t2;
a b a b
connection master;
drop table t1, t2; drop table t1, t2;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection slave;
reset slave; Master_User = 'root'
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; Master_Host = '127.0.0.1'
start slave;
Master_User root
Master_Host 127.0.0.1
include/stop_slave.inc include/stop_slave.inc
change master to master_user='test'; change master to master_user='test';
Master_User test Master_User = 'test'
Master_Host 127.0.0.1 Master_Host = '127.0.0.1'
reset slave; reset slave;
Master_User test Master_User = 'test'
Master_Host 127.0.0.1 Master_Host = '127.0.0.1'
change master to master_user='root'; change master to master_user='root';
include/start_slave.inc include/start_slave.inc
Master_User root Master_User = 'root'
Master_Host 127.0.0.1 Master_Host = '127.0.0.1'
include/stop_slave.inc include/stop_slave.inc
reset slave; reset slave;
include/start_slave.inc include/start_slave.inc
connection master;
create temporary table t1 (a int); create temporary table t1 (a int);
connection slave;
include/stop_slave.inc include/stop_slave.inc
reset slave; reset slave;
include/start_slave.inc include/start_slave.inc
show status like 'slave_open_temp_tables'; show status like 'slave_open_temp_tables';
Variable_name Value Variable_name Value
Slave_open_temp_tables 1 Slave_open_temp_tables 1
connection master;
drop temporary table if exists t1;
connection slave;
include/stop_slave.inc include/stop_slave.inc
reset slave; reset slave;
include/check_slave_no_error.inc
change master to master_user='impossible_user_name'; change master to master_user='impossible_user_name';
start slave; start slave;
stop slave; include/wait_for_slave_io_error.inc [errno=1045]
include/stop_slave_sql.inc
change master to master_user='root'; change master to master_user='root';
include/start_slave.inc include/start_slave.inc
include/check_slave_no_error.inc
stop slave; stop slave;
change master to master_user='impossible_user_name'; change master to master_user='impossible_user_name';
start slave; start slave;
stop slave; include/wait_for_slave_io_error.inc [errno=1045]
include/stop_slave_sql.inc
reset slave; reset slave;
include/check_slave_no_error.inc
change master to master_user='root';
reset slave;
include/start_slave.inc
include/stop_slave.inc
reset slave all;
start slave;
ERROR HY000: Misconfigured slave: MASTER_HOST was not set; Fix in config file or with CHANGE MASTER TO
CHANGE MASTER TO MASTER_HOST= 'MASTER_HOST', MASTER_USER= 'MASTER_USER', MASTER_PORT= MASTER_PORT;
include/start_slave.inc
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master; connection slave;
reset slave; connection master;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
set @saved_binlog_format = @@global.binlog_format;
drop database if exists mysqltest1; drop database if exists mysqltest1;
create database mysqltest1; create database mysqltest1;
use mysqltest1; use mysqltest1;
set @my_binlog_format= @@global.binlog_format;
set session binlog_format=mixed;
show session variables like "binlog_format%";
Variable_name Value
binlog_format MIXED
set session binlog_format=statement;
show session variables like "binlog_format%";
Variable_name Value
binlog_format STATEMENT
set session binlog_format=row; set session binlog_format=row;
set global binlog_format=row; show session variables like "binlog_format%";
Variable_name Value
binlog_format ROW
set global binlog_format=DEFAULT;
show global variables like "binlog_format%";
Variable_name Value
binlog_format MIXED
set global binlog_format=MIXED;
show global variables like "binlog_format%";
Variable_name Value
binlog_format MIXED
set global binlog_format=STATEMENT;
show global variables like "binlog_format%";
Variable_name Value
binlog_format STATEMENT
set global binlog_format=ROW;
show global variables like "binlog_format%"; show global variables like "binlog_format%";
Variable_name Value Variable_name Value
binlog_format ROW binlog_format ROW
...@@ -68,11 +89,11 @@ execute stmt1 using @string; ...@@ -68,11 +89,11 @@ execute stmt1 using @string;
deallocate prepare stmt1; deallocate prepare stmt1;
insert into t1 values("for_10_"); insert into t1 values("for_10_");
insert into t1 select "yesterday_11_"; insert into t1 select "yesterday_11_";
set binlog_format=default; set binlog_format=statement;
select @@global.binlog_format, @@session.binlog_format; select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format @@global.binlog_format @@session.binlog_format
STATEMENT STATEMENT STATEMENT STATEMENT
set global binlog_format=default; set global binlog_format=statement;
select @@global.binlog_format, @@session.binlog_format; select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format @@global.binlog_format @@session.binlog_format
STATEMENT STATEMENT STATEMENT STATEMENT
...@@ -87,11 +108,11 @@ execute stmt1 using @string; ...@@ -87,11 +108,11 @@ execute stmt1 using @string;
deallocate prepare stmt1; deallocate prepare stmt1;
insert into t1 values("for_15_"); insert into t1 values("for_15_");
insert into t1 select "yesterday_16_"; insert into t1 select "yesterday_16_";
set binlog_format=mixed; set global binlog_format=mixed;
select @@global.binlog_format, @@session.binlog_format; select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format @@global.binlog_format @@session.binlog_format
STATEMENT MIXED MIXED STATEMENT
set global binlog_format=mixed; set binlog_format=default;
select @@global.binlog_format, @@session.binlog_format; select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format @@global.binlog_format @@session.binlog_format
MIXED MIXED MIXED MIXED
...@@ -112,11 +133,15 @@ execute stmt1 using @string; ...@@ -112,11 +133,15 @@ execute stmt1 using @string;
deallocate prepare stmt1; deallocate prepare stmt1;
insert into t1 values(concat("for_23_",UUID())); insert into t1 values(concat("for_23_",UUID()));
insert into t1 select "yesterday_24_"; insert into t1 select "yesterday_24_";
create table t2 select rpad(UUID(),100,' '); create table t2 ENGINE=MyISAM select rpad(UUID(),100,' ');
create table t3 select 1 union select UUID(); create table t3 select 1 union select UUID();
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
create table t4 select * from t1 where 3 in (select 1 union select 2 union select UUID() union select 3); create table t4 select * from t1 where 3 in (select 1 union select 2 union select UUID() union select 3);
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3); create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3);
insert into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4); Warnings:
Warning 1292 Incorrect datetime value: '3'
insert ignore into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4);
create procedure foo() create procedure foo()
begin begin
insert into t1 values("work_25_"); insert into t1 values("work_25_");
...@@ -228,6 +253,14 @@ begin ...@@ -228,6 +253,14 @@ begin
set NEW.data = concat(NEW.data,UUID()); set NEW.data = concat(NEW.data,UUID());
end| end|
insert into t11 values("try_560_"); insert into t11 values("try_560_");
insert delayed into t2 values("delay_1_");
insert delayed into t2 values(concat("delay_2_",UUID()));
insert delayed into t2 values("delay_6_");
insert delayed into t2 values(rand());
set @a=2.345;
insert delayed into t2 values(@a);
connection slave;
connection master;
create table t20 select * from t1; create table t20 select * from t1;
create table t21 select * from t2; create table t21 select * from t2;
create table t22 select * from t3; create table t22 select * from t3;
...@@ -244,14 +277,18 @@ end| ...@@ -244,14 +277,18 @@ end|
select f("try_41_"); select f("try_41_");
f("try_41_") f("try_41_")
1 1
connection slave;
use mysqltest1; use mysqltest1;
insert into t2 values(2,null),(3,null),(4,null); insert into t2 values(2,null),(3,null),(4,null);
delete from t2 where a>=2; delete from t2 where a>=2;
connection master;
select f("try_42_"); select f("try_42_");
f("try_42_") f("try_42_")
1 1
connection slave;
insert into t2 values(3,null),(4,null); insert into t2 values(3,null),(4,null);
delete from t2 where a>=3; delete from t2 where a>=3;
connection master;
prepare stmt1 from 'select f(?)'; prepare stmt1 from 'select f(?)';
set @string="try_43_"; set @string="try_43_";
insert into t1 values(null,"try_44_"); insert into t1 values(null,"try_44_");
...@@ -259,6 +296,8 @@ execute stmt1 using @string; ...@@ -259,6 +296,8 @@ execute stmt1 using @string;
f(?) f(?)
1 1
deallocate prepare stmt1; deallocate prepare stmt1;
connection slave;
connection master;
create table t12 select * from t1; create table t12 select * from t1;
drop table t1; drop table t1;
create table t1 (a int, b varchar(100), key(a)); create table t1 (a int, b varchar(100), key(a));
...@@ -284,12 +323,16 @@ end| ...@@ -284,12 +323,16 @@ end|
select f1("try_46_"),f2("try_47_"); select f1("try_46_"),f2("try_47_");
f1("try_46_") f2("try_47_") f1("try_46_") f2("try_47_")
1 1 1 1
connection slave;
insert into t2 values(2,null),(3,null),(4,null); insert into t2 values(2,null),(3,null),(4,null);
delete from t2 where a>=2; delete from t2 where a>=2;
connection master;
select f1("try_48_"),f2("try_49_"); select f1("try_48_"),f2("try_49_");
f1("try_48_") f2("try_49_") f1("try_48_") f2("try_49_")
1 1 1 1
insert into t3 values(concat("try_50_",f1("try_51_"),f2("try_52_"))); insert into t3 values(concat("try_50_",f1("try_51_"),f2("try_52_")));
connection slave;
connection master;
drop function f2; drop function f2;
create function f2 (x varchar(100)) returns int deterministic create function f2 (x varchar(100)) returns int deterministic
begin begin
...@@ -301,6 +344,8 @@ end| ...@@ -301,6 +344,8 @@ end|
select f1("try_53_"),f2("try_54_"); select f1("try_53_"),f2("try_54_");
f1("try_53_") f2("try_54_") f1("try_53_") f2("try_54_")
1 3 1 3
connection slave;
connection master;
drop function f2; drop function f2;
create trigger t1_bi before insert on t1 for each row create trigger t1_bi before insert on t1 for each row
begin begin
...@@ -309,12 +354,16 @@ end| ...@@ -309,12 +354,16 @@ end|
insert into t1 values(null,"try_56_"); insert into t1 values(null,"try_56_");
alter table t1 modify a int, drop primary key; alter table t1 modify a int, drop primary key;
insert into t1 values(null,"try_57_"); insert into t1 values(null,"try_57_");
connection slave;
connection master;
CREATE TEMPORARY TABLE t15 SELECT UUID(); CREATE TEMPORARY TABLE t15 SELECT UUID();
create table t16 like t15; create table t16 like t15;
INSERT INTO t16 SELECT * FROM t15; INSERT INTO t16 SELECT * FROM t15;
insert into t16 values("try_65_"); insert into t16 values("try_65_");
drop table t15; drop table t15;
insert into t16 values("try_66_"); insert into t16 values("try_66_");
connection slave;
connection master;
select count(*) from t1; select count(*) from t1;
count(*) count(*)
7 7
...@@ -338,7 +387,7 @@ count(*) ...@@ -338,7 +387,7 @@ count(*)
66 66
select count(*) from t21; select count(*) from t21;
count(*) count(*)
14 19
select count(*) from t22; select count(*) from t22;
count(*) count(*)
2 2
...@@ -354,6 +403,8 @@ count(*) ...@@ -354,6 +403,8 @@ count(*)
select count(*) from t16; select count(*) from t16;
count(*) count(*)
3 3
connection slave;
connection master;
DROP TABLE IF EXISTS t11; DROP TABLE IF EXISTS t11;
SET SESSION BINLOG_FORMAT=STATEMENT; SET SESSION BINLOG_FORMAT=STATEMENT;
CREATE TABLE t11 (song VARCHAR(255)); CREATE TABLE t11 (song VARCHAR(255));
...@@ -366,17 +417,44 @@ UNLOCK TABLES; ...@@ -366,17 +417,44 @@ UNLOCK TABLES;
SELECT * FROM t11; SELECT * FROM t11;
song Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict song Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict
song Careful With That Axe, Eugene song Careful With That Axe, Eugene
connection slave;
USE mysqltest1; USE mysqltest1;
SELECT * FROM t11; SELECT * FROM t11;
song Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict song Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict
song Careful With That Axe, Eugene song Careful With That Axe, Eugene
connection master;
DROP TABLE IF EXISTS t12; DROP TABLE IF EXISTS t12;
SET SESSION BINLOG_FORMAT=MIXED; SET SESSION BINLOG_FORMAT=MIXED;
CREATE TABLE t12 (data LONG); CREATE TABLE t12 (data LONG);
LOCK TABLES t12 WRITE; LOCK TABLES t12 WRITE;
INSERT INTO t12 VALUES(UUID()); INSERT INTO t12 VALUES(UUID());
UNLOCK TABLES; UNLOCK TABLES;
show binlog events; connection slave;
show binlog events; connection master;
CREATE FUNCTION my_user()
RETURNS CHAR(64)
BEGIN
DECLARE user CHAR(64);
SELECT USER() INTO user;
RETURN user;
END $$
CREATE FUNCTION my_current_user()
RETURNS CHAR(64)
BEGIN
DECLARE user CHAR(64);
SELECT CURRENT_USER() INTO user;
RETURN user;
END $$
DROP TABLE IF EXISTS t13;
CREATE TABLE t13 (data CHAR(64));
INSERT INTO t13 VALUES (USER());
INSERT INTO t13 VALUES (my_user());
INSERT INTO t13 VALUES (CURRENT_USER());
INSERT INTO t13 VALUES (my_current_user());
connection slave;
connection master;
drop database mysqltest1; drop database mysqltest1;
set global binlog_format= @saved_binlog_format; connection slave;
connection master;
set global binlog_format =@my_binlog_format;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t2 (n int, PRIMARY KEY(n)); create table t2 (n int, PRIMARY KEY(n));
create temporary table t1 (n int); create temporary table t1 (n int);
create temporary table t3 (n int not null); create temporary table t3 (n int not null);
...@@ -15,10 +11,16 @@ insert into t3 values (1010); ...@@ -15,10 +11,16 @@ insert into t3 values (1010);
insert into t2 select * from t3; insert into t2 select * from t3;
drop table if exists t3; drop table if exists t3;
insert into t2 values (1012); insert into t2 values (1012);
connection master1;
create temporary table t1 (n int); create temporary table t1 (n int);
insert into t1 values (4),(5); insert into t1 values (4),(5);
insert into t2 select * from t1; insert into t2 select * from t1;
disconnect master;
connection slave;
connection master1;
insert into t2 values(61); insert into t2 values(61);
disconnect master1;
connection slave;
select * from t2; select * from t2;
n n
1 1
...@@ -43,6 +45,19 @@ sum(n) ...@@ -43,6 +45,19 @@ sum(n)
show status like 'Slave_open_temp_tables'; show status like 'Slave_open_temp_tables';
Variable_name Value Variable_name Value
Slave_open_temp_tables 0 Slave_open_temp_tables 0
*** MDEV-8016: Replication aborts on DROP /*!40005 TEMPORARY */ TABLE IF EXISTS ***
connect master2,localhost,root,,;
INSERT INTO t2 VALUES (2000), (2001);
CREATE FUNCTION f() RETURNS INTEGER RETURN 1;
CREATE TEMPORARY TABLE t3 AS SELECT f() AS col FROM t2;
disconnect master2;
connection default;
connection slave;
connect master2,localhost,root,,;
connection master2;
drop table if exists t1,t2; drop table if exists t1,t2;
Warnings: Warnings:
Note 1051 Unknown table 't1' Note 1051 Unknown table 'test.t1'
drop function f;
connection slave;
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create temporary table t1 (n int); create temporary table t1 (n int);
insert into t1 values(1); insert into t1 values(1);
connection slave;
show status like 'Slave_open_temp_tables'; show status like 'Slave_open_temp_tables';
Variable_name Value Variable_name Value
Slave_open_temp_tables 1 Slave_open_temp_tables 1
connection master;
delete from t1; delete from t1;
connection slave;
show status like 'Slave_open_temp_tables'; show status like 'Slave_open_temp_tables';
Variable_name Value Variable_name Value
Slave_open_temp_tables 1 Slave_open_temp_tables 1
connection master;
truncate t1; truncate t1;
connection slave;
show status like 'Slave_open_temp_tables'; show status like 'Slave_open_temp_tables';
Variable_name Value Variable_name Value
Slave_open_temp_tables 1 Slave_open_temp_tables 1
disconnect master;
connection slave;
show status like 'Slave_open_temp_tables'; show status like 'Slave_open_temp_tables';
Variable_name Value Variable_name Value
Slave_open_temp_tables 0 Slave_open_temp_tables 0
include/rpl_end.inc
stop slave; include/master-slave.inc
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; [connection master]
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
set @my_slave_net_timeout =@@global.slave_net_timeout; set @my_slave_net_timeout =@@global.slave_net_timeout;
set @my_sql_slave_skip_counter =@@global.sql_slave_skip_counter; set @my_sql_slave_skip_counter =@@global.sql_slave_skip_counter;
set global slave_net_timeout=100; set global slave_net_timeout=100;
...@@ -19,3 +15,4 @@ Variable_name Value ...@@ -19,3 +15,4 @@ Variable_name Value
slave_skip_errors 3,100,137,643,1752 slave_skip_errors 3,100,137,643,1752
set global slave_net_timeout=@my_slave_net_timeout; set global slave_net_timeout=@my_slave_net_timeout;
set global sql_slave_skip_counter=@my_sql_slave_skip_counter; set global sql_slave_skip_counter=@my_sql_slave_skip_counter;
include/rpl_end.inc
# This tests the offset off by 22 mystery bug
# Must run slave with --disconnect-slave-event-count=1 --master-connect-retry=1
source include/master-slave.inc;
create table t1 (n int not null auto_increment primary key);
insert into t1 values(NULL);
insert into t1 values(2);
save_master_pos;
connection slave;
sync_with_master;
select n from t1;
connection master;
drop table t1;
save_master_pos;
connection slave;
sync_with_master;
# End of 4.1 tests
This diff is collapsed.
--source suite/rpl/t/rpl_000010.test
--source suite/rpl/t/rpl_000013.test
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment