1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge 10.2 into 10.3

This commit is contained in:
Marko Mäkelä
2021-03-18 12:34:48 +02:00
244 changed files with 5158 additions and 6822 deletions

View File

@ -1,97 +1,4 @@
# List of disabled tests
# 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
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
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

File diff suppressed because one or more lines are too long

View File

@ -7,7 +7,7 @@ t4
SHOW CREATE TABLE t4;
Table Create Table
t4 CREATE TABLE `t4` (
`c1` tinyblob,
`c1` tinyblob DEFAULT NULL,
UNIQUE KEY `i1` (`c1`(100))
) ENGINE=ENGINE DEFAULT CHARSET=latin1
DROP TABLE t4;
@ -21,7 +21,7 @@ t4
SHOW CREATE TABLE t4;
Table Create Table
t4 CREATE TABLE `t4` (
`c1` blob,
`c1` blob DEFAULT NULL,
UNIQUE KEY `i1` (`c1`(100))
) ENGINE=ENGINE DEFAULT CHARSET=latin1
DROP TABLE t4;
@ -35,7 +35,7 @@ t4
SHOW CREATE TABLE t4;
Table Create Table
t4 CREATE TABLE `t4` (
`c1` mediumblob,
`c1` mediumblob DEFAULT NULL,
UNIQUE KEY `i1` (`c1`(100))
) ENGINE=ENGINE DEFAULT CHARSET=latin1
DROP TABLE t4;
@ -49,7 +49,7 @@ t4
SHOW CREATE TABLE t4;
Table Create Table
t4 CREATE TABLE `t4` (
`c1` longblob,
`c1` longblob DEFAULT NULL,
UNIQUE KEY `i1` (`c1`(100))
) ENGINE=ENGINE DEFAULT CHARSET=latin1
DROP TABLE t4;
@ -63,7 +63,7 @@ t4
SHOW CREATE TABLE t4;
Table Create Table
t4 CREATE TABLE `t4` (
`c1` tinytext,
`c1` tinytext DEFAULT NULL,
UNIQUE KEY `i1` (`c1`(100))
) ENGINE=ENGINE DEFAULT CHARSET=latin1
DROP TABLE t4;
@ -77,7 +77,7 @@ t4
SHOW CREATE TABLE t4;
Table Create Table
t4 CREATE TABLE `t4` (
`c1` text,
`c1` text DEFAULT NULL,
UNIQUE KEY `i1` (`c1`(100))
) ENGINE=ENGINE DEFAULT CHARSET=latin1
DROP TABLE t4;
@ -91,7 +91,7 @@ t4
SHOW CREATE TABLE t4;
Table Create Table
t4 CREATE TABLE `t4` (
`c1` mediumtext,
`c1` mediumtext DEFAULT NULL,
UNIQUE KEY `i1` (`c1`(100))
) ENGINE=ENGINE DEFAULT CHARSET=latin1
DROP TABLE t4;
@ -105,7 +105,7 @@ t4
SHOW CREATE TABLE t4;
Table Create Table
t4 CREATE TABLE `t4` (
`c1` longtext,
`c1` longtext DEFAULT NULL,
UNIQUE KEY `i1` (`c1`(100))
) ENGINE=ENGINE DEFAULT CHARSET=latin1
DROP TABLE t4;

View File

@ -1,16 +0,0 @@
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1 (n int);
insert into t1 values(1);
stop slave;
start slave;
insert into t1 values(2);
select * from t1;
n
1
2
drop table t1;

View File

@ -1,18 +0,0 @@
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";

View File

@ -1,14 +1,14 @@
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;
include/master-slave.inc
[connection master]
create table t1 (n int not null auto_increment primary key);
insert into t1 values(NULL);
insert into t1 values(2);
connection slave;
select n from t1;
n
1
2
connection master;
drop table t1;
connection slave;
include/rpl_end.inc

View File

@ -0,0 +1,18 @@
include/master-slave.inc
[connection master]
create table t1 (n int);
insert into t1 values(1);
connection slave;
include/stop_slave.inc
include/start_slave.inc
connection master;
insert into t1 values(2);
connection slave;
select * from t1;
n
1
2
connection master;
drop table t1;
connection slave;
include/rpl_end.inc

View File

@ -1,17 +1,19 @@
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;
include/master-slave.inc
[connection master]
create table t2(n int);
create temporary table t1 (n int);
insert into t1 values(1),(2),(3);
insert into t2 select * from t1;
connection master1;
create temporary table t1 (n int);
insert into t1 values (4),(5);
insert into t2 select * from t1 as t10;
disconnect master;
connection slave;
connection master1;
insert into t2 values(6);
disconnect master1;
connection slave;
select * from t2;
n
1
@ -23,6 +25,9 @@ n
show status like 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 0
connect master2,localhost,root,,;
connection master2;
drop table if exists t1,t2;
Warnings:
Note 1051 Unknown table 't1'
Note 1051 Unknown table 'test.t1'
include/rpl_end.inc

View File

@ -1,14 +1,11 @@
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;
include/master-slave.inc
[connection master]
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 107
stop slave;
master-bin.000001 329
connection slave;
include/stop_slave.inc
reset slave;
show slave status;
Slave_IO_State #
@ -51,6 +48,16 @@ Last_SQL_Errno 0
Last_SQL_Error
Replicate_Ignore_Server_Ids
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';
show slave status;
Slave_IO_State #
@ -93,6 +100,16 @@ Last_SQL_Errno 0
Last_SQL_Error
Replicate_Ignore_Server_Ids
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',
master_password='',master_port=MASTER_PORT;
show slave status;
@ -136,7 +153,17 @@ Last_SQL_Errno 0
Last_SQL_Error
Replicate_Ignore_Server_Ids
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;
Slave_IO_State Waiting for master to send event
Master_Host 127.0.0.1
@ -144,9 +171,9 @@ Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
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_Pos 254
Relay_Log_Pos 629
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running Yes
@ -159,8 +186,8 @@ Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 107
Relay_Log_Space 410
Exec_Master_Log_Pos 329
Relay_Log_Space 938
Until_Condition None
Until_Log_File
Until_Log_Pos 0
@ -178,15 +205,31 @@ Last_SQL_Errno 0
Last_SQL_Error
Replicate_Ignore_Server_Ids
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;
create table t1 (n int, PRIMARY KEY(n));
insert into t1 values (10),(45),(90);
connection slave;
connection slave;
SELECT * FROM t1 ORDER BY n;
n 10
n 45
n 90
connection master;
SELECT * FROM t1 ORDER BY n;
n 10
n 45
n 90
drop table t1;
connection slave;
include/rpl_end.inc

View File

@ -1,22 +1,19 @@
source include/master-slave.inc;
include/master-slave.inc
[connection master]
connection slave;
stop slave;
connection master;
grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab';
grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab';
connection slave;
start slave;
include/start_slave.inc
connection master;
--disable_warnings
drop table if exists t1;
--enable_warnings
create table t1(n int);
insert into t1 values(24);
sync_slave_with_master;
connection slave;
select * from t1;
n
24
connection master;
drop table t1;
delete from mysql.user where user="replicate";
sync_slave_with_master;
# End of 4.1 tests
include/rpl_end.inc

View File

@ -1,9 +1,6 @@
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;
include/master-slave.inc
[connection master]
connection master;
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (a VARCHAR(255), PRIMARY KEY(a));
LOAD DATA INFILE '../../std_data/words2.dat' INTO TABLE test.t1;
@ -62,6 +59,8 @@ abasements
abasement
abased
abase
connection slave;
connection slave;
SELECT * FROM test.t1 ORDER BY a DESC;
a
aberration
@ -114,4 +113,7 @@ abasements
abasement
abased
abase
connection master;
DROP TABLE test.t1;
connection slave;
include/rpl_end.inc

View File

@ -1,41 +0,0 @@
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;

View File

@ -0,0 +1,72 @@
@@ -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

View File

@ -1,10 +1,5 @@
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;
drop database if exists mysqltest;
include/master-slave.inc
[connection master]
create database mysqltest;
create table mysqltest.t1 ( n int);
alter table mysqltest.t1 add m int;
@ -12,10 +7,126 @@ insert into mysqltest.t1 values (1,2);
create table mysqltest.t2 (n int);
insert into mysqltest.t2 values (45);
rename table mysqltest.t2 to mysqltest.t3, mysqltest.t1 to mysqltest.t2;
connection slave;
select * from mysqltest.t2;
n m
1 2
select * from mysqltest.t3;
n
45
connection master;
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

View File

@ -1,9 +1,12 @@
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;
use mysql;
include/master-slave.inc
[connection master]
==== Verify that alter database does not stop replication ====
create database temp_db;
use temp_db;
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

View File

@ -1,9 +1,6 @@
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;
include/master-slave.inc
[connection master]
connection master;
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (
dummyKey INTEGER NOT NULL,
@ -95,6 +92,7 @@ hex(bit3)
15
24
35
connection slave;
SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1;
oSupp sSuppD GSuppDf VNotSupp x034
5 5 3 2 1
@ -135,4 +133,7 @@ hex(bit3)
15
24
35
connection master;
DROP TABLE IF EXISTS test.t1;
connection slave;
include/rpl_end.inc

View File

@ -1,9 +1,6 @@
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;
include/master-slave.inc
[connection master]
connection master;
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (
dummyKey INTEGER NOT NULL,
@ -98,6 +95,7 @@ hex(bit3)
15
24
35
connection slave;
SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034
FROM test.t1
ORDER BY oSupp, sSuppD, GSuppDf, VNotSupp, x034;
@ -140,6 +138,7 @@ hex(bit3)
15
24
35
connection master;
CREATE TABLE test.t2 (a INT, b BIT(1));
INSERT INTO test.t2 VALUES (1, b'0');
INSERT INTO test.t2 VALUES (1, b'1');
@ -156,6 +155,7 @@ SELECT * FROM test.t3 ORDER BY a,b;
a b
1 NULL
2 0
connection slave;
SELECT a, hex(b) FROM test.t2 ORDER BY a,b;
a hex(b)
1 0
@ -164,6 +164,9 @@ SELECT * FROM test.t3 ORDER BY a,b;
a b
1 NULL
2 0
connection master;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
DROP TABLE IF EXISTS test.t3;
connection slave;
include/rpl_end.inc

View File

@ -1,26 +1,29 @@
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;
include/master-slave.inc
[connection 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");
connection master;
create table t1(n int);
connection slave;
select * from t1;
n
stop slave sql_thread;
connection master;
insert into t1 values(1);
insert into t1 values(2);
stop slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master 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
connection slave;
include/wait_for_slave_param.inc [Read_Master_Log_Pos]
include/stop_slave.inc
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;
select * from t1;
n
1
2
connection master;
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

View File

@ -1,13 +1,11 @@
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;
include/master-slave.inc
[connection master]
DROP DATABASE IF EXISTS mysqltest_prometheus;
DROP DATABASE IF EXISTS mysqltest_sisyfos;
DROP DATABASE IF EXISTS mysqltest_bob;
connection slave;
DROP DATABASE IF EXISTS mysqltest_bob;
connection master;
CREATE DATABASE mysqltest_prometheus;
CREATE DATABASE mysqltest_sisyfos;
CREATE DATABASE mysqltest_bob;
@ -20,25 +18,19 @@ INSERT INTO t2 VALUES(2);
ALTER DATABASE mysqltest_sisyfos CHARACTER SET latin1;
USE mysqltest_sisyfos;
ALTER DATABASE mysqltest_bob CHARACTER SET latin1;
SHOW DATABASES;
Database
information_schema
mtr
SHOW DATABASES LIKE 'mysql%';
Database (mysql%)
mysql
mysqltest_bob
mysqltest_prometheus
mysqltest_sisyfos
performance_schema
test
SHOW DATABASES;
Database
information_schema
mtr
connection slave;
SHOW DATABASES LIKE 'mysql%';
Database (mysql%)
mysql
mysqltest_prometheus
mysqltest_sisyfos
performance_schema
test
connection master;
DROP DATABASE IF EXISTS mysqltest_sisyfos;
USE mysqltest_prometheus;
CREATE TABLE t1 (a INT);
@ -46,25 +38,18 @@ INSERT INTO t1 VALUES (1);
CREATE DATABASE mysqltest_sisyfos;
USE mysqltest_sisyfos;
CREATE TABLE t2 (a INT);
SHOW DATABASES;
Database
information_schema
mtr
SHOW DATABASES LIKE 'mysql%';
Database (mysql%)
mysql
mysqltest_bob
mysqltest_prometheus
mysqltest_sisyfos
performance_schema
test
SHOW DATABASES;
Database
information_schema
mtr
connection slave;
SHOW DATABASES LIKE 'mysql%';
Database (mysql%)
mysql
mysqltest_prometheus
mysqltest_sisyfos
performance_schema
test
USE mysqltest_prometheus;
SHOW TABLES;
Tables_in_mysqltest_prometheus
@ -73,6 +58,9 @@ USE mysqltest_sisyfos;
SHOW TABLES;
Tables_in_mysqltest_sisyfos
t2
connection master;
DROP DATABASE IF EXISTS mysqltest_prometheus;
DROP DATABASE IF EXISTS mysqltest_sisyfos;
DROP DATABASE IF EXISTS mysqltest_bob;
connection slave;
include/rpl_end.inc

View File

@ -1,80 +1,331 @@
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;
include/master-slave.inc
[connection master]
connection master;
delete from mysql.user where user=_binary'rpl_do_grant';
delete from mysql.db where user=_binary'rpl_do_grant';
flush privileges;
connection slave;
delete from mysql.user where user=_binary'rpl_ignore_grant';
delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges;
connection master;
create user rpl_do_grant@localhost;
grant select on *.* to rpl_do_grant@localhost;
grant drop on test.* to rpl_do_grant@localhost;
connection slave;
show grants for rpl_do_grant@localhost;
Grants for rpl_do_grant@localhost
GRANT SELECT ON *.* TO 'rpl_do_grant'@'localhost'
GRANT DROP ON `test`.* TO 'rpl_do_grant'@'localhost'
connection master;
set password for rpl_do_grant@localhost=password("does it work?");
select password<>_binary'' from mysql.user where user=_binary'rpl_do_grant';
password<>_binary''
connection slave;
select authentication_string<>_binary'' from mysql.user where user=_binary'rpl_do_grant';
authentication_string<>_binary''
1
connection master;
update mysql.user set authentication_string='' where user='rpl_do_grant';
flush privileges;
select authentication_string<>'' from mysql.user where user='rpl_do_grant';
authentication_string<>''
0
set sql_mode='ANSI_QUOTES';
set password for rpl_do_grant@localhost=password('does it work?');
set sql_mode='';
connection slave;
select authentication_string<>'' from mysql.user where user='rpl_do_grant';
authentication_string<>''
1
connection master;
delete from mysql.user where user=_binary'rpl_do_grant';
delete from mysql.db where user=_binary'rpl_do_grant';
flush privileges;
connection slave;
delete from mysql.user where user=_binary'rpl_do_grant';
delete from mysql.db where user=_binary'rpl_do_grant';
flush privileges;
connection master;
show grants for rpl_do_grant@localhost;
ERROR 42000: There is no such grant defined for user 'rpl_do_grant' on host 'localhost'
connection slave;
show grants for rpl_do_grant@localhost;
ERROR 42000: There is no such grant defined for user 'rpl_do_grant' on host 'localhost'
connection master;
create user rpl_do_grant@localhost;
show grants for rpl_do_grant@localhost;
Grants for rpl_do_grant@localhost
GRANT USAGE ON *.* TO 'rpl_do_grant'@'localhost'
show grants for rpl_do_grant2@localhost;
ERROR 42000: There is no such grant defined for user 'rpl_do_grant2' on host 'localhost'
connection slave;
show grants for rpl_do_grant@localhost;
Grants for rpl_do_grant@localhost
GRANT USAGE ON *.* TO 'rpl_do_grant'@'localhost'
show grants for rpl_do_grant2@localhost;
ERROR 42000: There is no such grant defined for user 'rpl_do_grant2' on host 'localhost'
connection master;
rename user rpl_do_grant@localhost to rpl_do_grant2@localhost;
show grants for rpl_do_grant2@localhost;
Grants for rpl_do_grant2@localhost
GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
connection slave;
show grants for rpl_do_grant2@localhost;
Grants for rpl_do_grant2@localhost
GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
connection master;
grant DELETE,INSERT on mysqltest1.* to rpl_do_grant2@localhost;
show grants for rpl_do_grant2@localhost;
Grants for rpl_do_grant2@localhost
GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
GRANT INSERT, DELETE ON `mysqltest1`.* TO 'rpl_do_grant2'@'localhost'
connection slave;
show grants for rpl_do_grant2@localhost;
Grants for rpl_do_grant2@localhost
GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
GRANT INSERT, DELETE ON `mysqltest1`.* TO 'rpl_do_grant2'@'localhost'
connection master;
revoke DELETE on mysqltest1.* from rpl_do_grant2@localhost;
show grants for rpl_do_grant2@localhost;
Grants for rpl_do_grant2@localhost
GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
GRANT INSERT ON `mysqltest1`.* TO 'rpl_do_grant2'@'localhost'
connection slave;
show grants for rpl_do_grant2@localhost;
Grants for rpl_do_grant2@localhost
GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
GRANT INSERT ON `mysqltest1`.* TO 'rpl_do_grant2'@'localhost'
connection master;
revoke all privileges, grant option from rpl_do_grant2@localhost;
show grants for rpl_do_grant2@localhost;
Grants for rpl_do_grant2@localhost
GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
connection slave;
show grants for rpl_do_grant2@localhost;
Grants for rpl_do_grant2@localhost
GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
connection master;
drop user rpl_do_grant2@localhost;
show grants for rpl_do_grant2@localhost;
ERROR 42000: There is no such grant defined for user 'rpl_do_grant2' on host 'localhost'
connection slave;
show grants for rpl_do_grant2@localhost;
ERROR 42000: There is no such grant defined for user 'rpl_do_grant2' on host 'localhost'
connection master;
call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' error.* 1396");
connection slave;
connection master;
DROP DATABASE IF EXISTS bug42217_db;
CREATE DATABASE bug42217_db;
GRANT CREATE ROUTINE ON bug42217_db.* TO 'create_rout_db'@'localhost'
IDENTIFIED BY 'create_rout_db' WITH GRANT OPTION;
connection slave;
connection master;
connect create_rout_db_master, localhost, create_rout_db, create_rout_db, bug42217_db,$MASTER_MYPORT,;
connect create_rout_db_slave, localhost, create_rout_db, create_rout_db, bug42217_db, $SLAVE_MYPORT,;
connection create_rout_db_master;
USE bug42217_db;
CREATE FUNCTION upgrade_del_func() RETURNS CHAR(30)
BEGIN
RETURN "INSIDE upgrade_del_func()";
END//
connection master;
USE bug42217_db;
SELECT * FROM mysql.procs_priv;
Host Db User Routine_name Routine_type Grantor Proc_priv Timestamp
localhost bug42217_db create_rout_db upgrade_del_func FUNCTION create_rout_db@localhost Execute,Alter Routine #
SELECT upgrade_del_func();
upgrade_del_func()
INSIDE upgrade_del_func()
connection slave;
SELECT * FROM mysql.procs_priv;
Host Db User Routine_name Routine_type Grantor Proc_priv Timestamp
localhost bug42217_db create_rout_db upgrade_del_func FUNCTION create_rout_db@localhost Execute,Alter Routine #
SHOW GRANTS FOR 'create_rout_db'@'localhost';
Grants for create_rout_db@localhost
GRANT USAGE ON *.* TO 'create_rout_db'@'localhost' IDENTIFIED BY PASSWORD '*08792480350CBA057BDE781B9DF183B263934601'
GRANT CREATE ROUTINE ON `bug42217_db`.* TO 'create_rout_db'@'localhost' WITH GRANT OPTION
GRANT EXECUTE, ALTER ROUTINE ON FUNCTION `bug42217_db`.`upgrade_del_func` TO 'create_rout_db'@'localhost'
USE bug42217_db;
SHOW CREATE FUNCTION upgrade_del_func;
Function sql_mode Create Function character_set_client collation_connection Database Collation
upgrade_del_func STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`create_rout_db`@`localhost` FUNCTION `upgrade_del_func`() RETURNS char(30) CHARSET latin1
BEGIN
RETURN "INSIDE upgrade_del_func()";
END latin1 latin1_swedish_ci latin1_swedish_ci
SELECT upgrade_del_func();
upgrade_del_func()
INSIDE upgrade_del_func()
"Check whether the definer user will be able to execute the replicated routine on slave"
connection create_rout_db_slave;
USE bug42217_db;
SHOW CREATE FUNCTION upgrade_del_func;
Function sql_mode Create Function character_set_client collation_connection Database Collation
upgrade_del_func STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`create_rout_db`@`localhost` FUNCTION `upgrade_del_func`() RETURNS char(30) CHARSET latin1
BEGIN
RETURN "INSIDE upgrade_del_func()";
END latin1 latin1_swedish_ci latin1_swedish_ci
SELECT upgrade_del_func();
upgrade_del_func()
INSIDE upgrade_del_func()
connection slave;
DELETE FROM mysql.procs_priv;
FLUSH PRIVILEGES;
USE bug42217_db;
"Can't execute the replicated routine on slave like before after procs privilege is deleted "
SELECT upgrade_del_func();
ERROR 42000: execute command denied to user 'create_rout_db'@'localhost' for routine 'bug42217_db.upgrade_del_func'
"Test the user who creates a function on master doesn't exist on slave."
"Hence SQL thread ACL_GLOBAL privilege jumps in and no mysql.procs_priv is inserted"
DROP USER 'create_rout_db'@'localhost';
connection create_rout_db_master;
CREATE FUNCTION upgrade_alter_func() RETURNS CHAR(30)
BEGIN
RETURN "INSIDE upgrade_alter_func()";
END//
connection master;
SELECT upgrade_alter_func();
upgrade_alter_func()
INSIDE upgrade_alter_func()
connection slave;
SHOW CREATE FUNCTION upgrade_alter_func;
Function sql_mode Create Function character_set_client collation_connection Database Collation
upgrade_alter_func STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`create_rout_db`@`localhost` FUNCTION `upgrade_alter_func`() RETURNS char(30) CHARSET latin1
BEGIN
RETURN "INSIDE upgrade_alter_func()";
END latin1 latin1_swedish_ci latin1_swedish_ci
"Should no privilege record for upgrade_alter_func in mysql.procs_priv"
SELECT * FROM mysql.procs_priv;
Host Db User Routine_name Routine_type Grantor Proc_priv Timestamp
SELECT upgrade_alter_func();
ERROR HY000: The user specified as a definer ('create_rout_db'@'localhost') does not exist
disconnect create_rout_db_master;
disconnect create_rout_db_slave;
connection master;
USE bug42217_db;
DROP FUNCTION upgrade_del_func;
DROP FUNCTION upgrade_alter_func;
DROP DATABASE bug42217_db;
connection slave;
connection master;
SET SQL_LOG_BIN= 0;
DROP USER 'create_rout_db'@'localhost';
SET SQL_LOG_BIN= 1;
include/rpl_reset.inc
USE test;
######## BUG#49119 #######
### i) test case from the 'how to repeat section'
connection master;
CREATE TABLE t1(c1 INT);
CREATE PROCEDURE p1() SELECT * FROM t1 |
REVOKE EXECUTE ON PROCEDURE p1 FROM 'root'@'localhost';
ERROR 42000: There is no such grant defined for user 'root' on host 'localhost' on routine 'p1'
connection slave;
connection master;
DROP TABLE t1;
DROP PROCEDURE p1;
connection slave;
### ii) Test case in which REVOKE partially succeeds
connection master;
include/rpl_reset.inc
connection master;
CREATE TABLE t1(c1 INT);
CREATE PROCEDURE p1() SELECT * FROM t1 |
CREATE USER 'user49119'@'localhost';
GRANT EXECUTE ON PROCEDURE p1 TO 'user49119'@'localhost';
##############################################################
### Showing grants for both users: root and user49119 (master)
SHOW GRANTS FOR 'user49119'@'localhost';
Grants for user49119@localhost
GRANT USAGE ON *.* TO 'user49119'@'localhost'
GRANT EXECUTE ON PROCEDURE `test`.`p1` TO 'user49119'@'localhost'
SHOW GRANTS FOR CURRENT_USER;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
##############################################################
connection slave;
##############################################################
### Showing grants for both users: root and user49119 (master)
SHOW GRANTS FOR 'user49119'@'localhost';
Grants for user49119@localhost
GRANT USAGE ON *.* TO 'user49119'@'localhost'
GRANT EXECUTE ON PROCEDURE `test`.`p1` TO 'user49119'@'localhost'
SHOW GRANTS FOR CURRENT_USER;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
##############################################################
connection master;
## This statement will make the revoke fail because root has no
## execute grant. However, it will still revoke the grant for
## user49119.
REVOKE EXECUTE ON PROCEDURE p1 FROM 'user49119'@'localhost', 'root'@'localhost';
ERROR 42000: There is no such grant defined for user 'root' on host 'localhost' on routine 'p1'
##############################################################
### Showing grants for both users: root and user49119 (master)
### after revoke statement failure
SHOW GRANTS FOR 'user49119'@'localhost';
Grants for user49119@localhost
GRANT USAGE ON *.* TO 'user49119'@'localhost'
SHOW GRANTS FOR CURRENT_USER;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
##############################################################
connection slave;
#############################################################
### Showing grants for both users: root and user49119 (slave)
### after revoke statement failure (should match
SHOW GRANTS FOR 'user49119'@'localhost';
Grants for user49119@localhost
GRANT USAGE ON *.* TO 'user49119'@'localhost'
SHOW GRANTS FOR CURRENT_USER;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
##############################################################
connection master;
DROP TABLE t1;
DROP PROCEDURE p1;
DROP USER 'user49119'@'localhost';
connection slave;
include/rpl_reset.inc
connection master;
grant all on *.* to foo@"1.2.3.4";
revoke all privileges, grant option from "foo";
ERROR HY000: Can't revoke all privileges for one or more of the requested users
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; grant all on *.* to foo@"1.2.3.4"
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; revoke all privileges, grant option from "foo"
connection slave;
include/check_slave_no_error.inc
connection master;
DROP USER foo@"1.2.3.4";
connection slave;
# Bug#27606 GRANT statement should be replicated with DEFINER information
include/rpl_reset.inc
connection master;
GRANT SELECT, INSERT ON mysql.user TO user_bug27606@localhost;
SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
Grantor
root@localhost
connection slave;
SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
Grantor
root@localhost
connection master;
REVOKE SELECT ON mysql.user FROM user_bug27606@localhost;
SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
Grantor
root@localhost
connection slave;
SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
Grantor
root@localhost
connection master;
DROP USER user_bug27606@localhost;
include/rpl_end.inc

View File

@ -1,10 +1,7 @@
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;
drop table if exists t1, t2;
include/master-slave.inc
[connection master]
create table t1 (a int);
drop table t1, t2;
ERROR 42S02: Unknown table 't2'
ERROR 42S02: Unknown table 'test.t2'
connection slave;
include/rpl_end.inc

View File

@ -1,9 +1,6 @@
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;
include/master-slave.inc
[connection master]
connection master;
drop database if exists mysqltest1;
create database mysqltest1;
create table mysqltest1.t1 (n int);
@ -12,18 +9,20 @@ select * from mysqltest1.t1 into outfile 'mysqltest1/f1.txt';
create table mysqltest1.t2 (n int);
create table mysqltest1.t3 (n int);
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;
show tables;
Tables_in_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;
show tables;
Tables_in_mysqltest1
use test;
create table t1 (n int);
insert into t1 values (1234);
connection slave;
connection slave;
use mysqltest1;
show tables;
Tables_in_mysqltest1
@ -31,9 +30,9 @@ use test;
select * from t1;
n
1234
drop table t1;
stop slave;
drop database mysqltest1;
drop database mysqltest1;
connection master;
use test;
drop table t1;
drop database mysqltest1;
connection slave;
include/rpl_end.inc

View File

@ -1,22 +1,28 @@
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;
include/master-slave.inc
[connection master]
connection slave;
reset master;
connection master;
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);
connection master;
connection master;
create table t4 (n int);
create table t5 (n int);
create table t6 (n int);
connection slave;
connection slave;
connection master;
show tables;
Tables_in_test
t1
t4
t5
t6
stop slave;
include/stop_slave.inc
reset slave;
drop table t1,t4,t5,t6;
connection slave;
include/rpl_end.inc

View File

@ -1,12 +0,0 @@
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'

View File

@ -1,14 +1,12 @@
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;
include/master-slave.inc
[connection master]
connection master;
create table t1 (a int primary key);
create table t4 (a int primary key);
insert into t1 values (1),(1);
Got one of the listed errors
insert into t4 values (1),(2);
connection slave;
show tables like 't1';
Tables_in_test (t1)
show tables like 't4';
@ -18,25 +16,36 @@ SELECT * FROM test.t4 ORDER BY a;
a
1
2
connection master;
drop table t1;
connection slave;
connection master1;
select get_lock('crash_lock%20C', 10);
get_lock('crash_lock%20C', 10)
1
connection master;
create table t2 (a int primary key);
insert into t2 values(1);
create table t3 (id int);
insert into t3 values(connection_id());
update t2 set a = a + 1 + get_lock('crash_lock%20C', 10);
connection master1;
select (@id := id) - id from t3;
(@id := id) - id
0
kill @id;
drop table t2,t3;
insert into t4 values (3),(4);
connection master;
connection master1;
connection slave;
SELECT * FROM test.t4 ORDER BY a;
a
1
2
3
4
connection master1;
DROP TABLE test.t4;
connection slave;
include/rpl_end.inc

View File

@ -1,21 +1,14 @@
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;
include/master-slave.inc
[connection master]
connection slave;
include/stop_slave.inc
change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=MASTER_PORT;
start slave;
stop slave;
include/start_slave.inc
connection master;
change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=SLAVE_PORT;
start slave;
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
include/start_slave.inc
flush logs;
SHOW SLAVE STATUS;
Slave_IO_State #
@ -24,7 +17,7 @@ Master_User root
Master_Port SLAVE_PORT
Connect_Retry 60
Master_Log_File slave-bin.000001
Read_Master_Log_Pos 107
Read_Master_Log_Pos 328
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File slave-bin.000001
@ -39,7 +32,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 107
Exec_Master_Log_Pos 328
Relay_Log_Space #
Until_Condition None
Until_Log_File
@ -58,4 +51,15 @@ Last_SQL_Errno 0
Last_SQL_Error
Replicate_Ignore_Server_Ids
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

View File

@ -1,10 +1,10 @@
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;
include/master-slave.inc
[connection master]
create table t1 (a int);
create table t2 (a int);
connection slave;
connection master;
drop table t1;
drop table t2;
connection slave;
include/rpl_end.inc

View File

@ -1,17 +1,17 @@
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;
include/master-slave.inc
[connection master]
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
create table t1(n int);
insert into t1 values(get_lock("lock",2));
disconnect master;
connection master1;
select get_lock("lock",2);
get_lock("lock",2)
1
select release_lock("lock");
release_lock("lock")
1
connection slave;
select get_lock("lock",3);
get_lock("lock",3)
1
@ -32,4 +32,7 @@ is_free_lock("lock2")
select is_free_lock(NULL);
is_free_lock(NULL)
NULL
connection master1;
drop table t1;
connection slave;
include/rpl_end.inc

View File

@ -1,21 +1,23 @@
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;
include/master-slave.inc
[connection master]
connection master;
set sql_mode="";
delete from mysql.user where user=_binary'rpl_ignore_grant';
delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges;
connection slave;
set sql_mode="";
delete from mysql.user where user=_binary'rpl_ignore_grant';
delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges;
connection master;
grant select on *.* to rpl_ignore_grant@localhost;
grant drop on test.* to rpl_ignore_grant@localhost;
show grants for rpl_ignore_grant@localhost;
Grants for rpl_ignore_grant@localhost
GRANT SELECT ON *.* TO 'rpl_ignore_grant'@'localhost'
GRANT DROP ON `test`.* TO 'rpl_ignore_grant'@'localhost'
connection slave;
show grants for rpl_ignore_grant@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';
@ -25,13 +27,19 @@ select count(*) from mysql.db where user=_binary'rpl_ignore_grant';
count(*)
0
grant select on *.* to rpl_ignore_grant@localhost;
connection master;
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';
password<>_binary''
0
connection master;
delete from mysql.user where user=_binary'rpl_ignore_grant';
delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges;
connection slave;
delete from mysql.user where user=_binary'rpl_ignore_grant';
delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges;
connection master;
include/rpl_end.inc

View File

@ -1,14 +1,12 @@
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;
include/master-slave.inc
[connection master]
connection master;
grant select on *.* to 'user_foo'@'%' identified by 'user_foopass';
revoke select on *.* from 'user_foo'@'%';
select select_priv from mysql.user where user='user_foo' /* master:must be N */;
select_priv
N
connection slave;
grant select on *.* to 'user_foo'@'%' identified by 'user_foopass';
revoke select on *.* from 'user_foo'@'%';
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';
select select_priv from mysql.user where user='user_foo' /* slave:must be Y */;
select_priv
Y
connection master;
revoke select on *.* from 'user_foo';
select select_priv from mysql.user where user='user_foo' /* master:must be N */;
select_priv
N
connection slave;
select select_priv from mysql.user where user='user_foo' /* slave:must get Y */;
select_priv
Y
connection slave;
revoke select on *.* FROM 'user_foo';
connection master;
delete from mysql.user where user="user_foo";
connection slave;
delete from mysql.user where user="user_foo";
include/rpl_end.inc

View File

@ -1,14 +1,12 @@
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;
include/master-slave.inc
[connection master]
connection slave;
use test;
drop table if exists mysqltest_foo;
drop table if exists mysqltest_bar;
create table mysqltest_foo (n int);
insert into mysqltest_foo values(4);
connection master;
use test;
create table mysqltest_foo (n int);
insert into mysqltest_foo values(5);
@ -16,8 +14,12 @@ create table mysqltest_bar (m int);
insert into mysqltest_bar values(15);
create table t1 (k int);
insert into t1 values(55);
connection slave;
select mysqltest_foo.n,mysqltest_bar.m,t1.k from mysqltest_foo,mysqltest_bar,t1;
n m k
4 15 55
connection master;
drop table mysqltest_foo,mysqltest_bar,t1;
connection slave;
drop table mysqltest_foo,mysqltest_bar,t1;
include/rpl_end.inc

View File

@ -1,9 +1,11 @@
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;
include/master-slave.inc
[connection master]
set global max_connections=151;
connection slave;
include/stop_slave.inc
include/start_slave.inc
connection master;
connection slave;
show variables like 'init_slave';
Variable_name Value
init_slave set global max_connections=500
@ -11,17 +13,21 @@ show variables like 'max_connections';
Variable_name Value
max_connections 500
reset master;
connection master;
show variables like 'init_slave';
Variable_name Value
init_slave
show variables like 'max_connections';
Variable_name Value
max_connections 151
connection slave;
set @my_global_init_connect= @@global.init_connect;
set global init_connect="set @c=1";
show variables like 'init_connect';
Variable_name Value
init_connect set @c=1
stop slave;
connection master;
connection slave;
set global init_connect= @my_global_init_connect;
set global max_connections= default;
include/rpl_end.inc

View File

@ -1,23 +1,25 @@
#
# Bug#20821: INSERT DELAYED fails to write some rows to binlog
#
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;
include/master-slave.inc
[connection master]
CREATE SCHEMA IF NOT EXISTS 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;
COUNT(*)
5000
connection slave;
SELECT COUNT(*) FROM mysqlslap.t1;
COUNT(*)
5000
#
# Cleanup
#
connection master;
USE test;
DROP SCHEMA mysqlslap;
connection slave;
include/rpl_end.inc

View File

@ -1,17 +1,21 @@
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;
include/master-slave.inc
[connection master]
connection master;
create table t1 (n int not null primary key);
insert into t1 values (1);
create table t2 (n int);
insert into t2 values (1);
insert ignore into t1 select * from t2;
Warnings:
Warning 1062 Duplicate entry '1' for key 'PRIMARY'
insert into t1 values (2);
connection slave;
connection slave;
select * from t1;
n
1
2
connection master;
drop table t1,t2;
connection slave;
include/rpl_end.inc

View File

@ -1,9 +1,5 @@
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;
include/master-slave.inc
[connection master]
CREATE TABLE t1 (word CHAR(20) NOT NULL);
LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
SELECT * FROM t1 ORDER BY word;
@ -78,6 +74,7 @@ Aberdeen
Abernathy
aberrant
aberration
connection slave;
SELECT * FROM t1 ORDER BY word;
word
Aarhus
@ -150,4 +147,7 @@ Aberdeen
Abernathy
aberrant
aberration
connection master;
drop table t1;
connection slave;
include/rpl_end.inc

View File

@ -1,10 +1,7 @@
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;
include/master-slave.inc
[connection master]
drop database if exists mysqltest;
connection master;
USE test;
CREATE TABLE t1(a INT, b INT, UNIQUE(b));
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;
SELECT COUNT(*) FROM mysqltest.t1;
COUNT(*)
2
connection slave;
SHOW DATABASES;
Database
information_schema
@ -36,5 +34,8 @@ t1
SELECT COUNT(*) FROM mysqltest.t1;
COUNT(*)
2
connection master;
DROP DATABASE mysqltest;
DROP TABLE test.t1;
DROP TABLE IF EXISTS test.t1;
connection slave;
include/rpl_end.inc

View File

@ -1,15 +1,16 @@
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;
include/master-slave.inc
[connection master]
connection slave;
reset master;
connection master;
create table test.t1(a int, b int, unique(b));
load data infile '../../std_data/rpl_loaddata.dat' into table test.t1;
connection slave;
select count(*) from test.t1;
count(*)
2
show binlog events from 107;
Log_name Pos Event_type Server_id End_log_pos Info
include/show_binlog_events.inc
connection master;
drop table test.t1;
connection slave;
include/rpl_end.inc

View File

@ -1,31 +1,37 @@
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;
include/master-slave.inc
[connection master]
create table t1(a int);
select * into outfile 'MYSQLTEST_VARDIR/tmp/rpl_loaddatalocal.select_outfile' from t1;
truncate 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;
a count(*)
1 10000
connection master;
drop table t1;
connection slave;
connection master;
create table t1(a int);
insert into t1 values (1), (2), (2), (3);
select * into outfile 'MYSQLTEST_VARDIR/tmp/rpl_loaddatalocal.select_outfile' from t1;
drop table t1;
create table t1(a int primary key);
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;
a
1
2
3
connection slave;
SELECT * FROM t1 ORDER BY a;
a
1
2
3
connection master;
drop table t1;
connection slave;
include/rpl_end.inc

View File

@ -1,9 +1,6 @@
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;
include/master-slave.inc
[connection master]
connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, PRIMARY KEY(a));
@ -119,6 +116,8 @@ Abernathy
aberrant
aberration
connection slave;
connection slave;
SELECT * FROM test.t1 ORDER BY blob_column;
a blob_column
1 abase
@ -223,5 +222,8 @@ Abernathy
aberrant
aberration
connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE test.t1;
connection slave;
include/rpl_end.inc

View File

@ -1,46 +1,37 @@
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;
include/master-slave.inc
[connection master]
create table if not exists t1 (n int);
drop table t1;
call mtr.add_suppression ("Slave I/O: Got fatal error 1236 from master when reading data from binary");
call mtr.add_suppression ("Error in Log_event::read_log_event");
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 107 <Binlog_Ignore_DB>
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=107;
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
connection slave;
include/stop_slave.inc
change master to master_log_pos=MASTER_LOG_POS;
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;
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 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/wait_for_slave_io_error.inc [errno=1236]
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.''
include/stop_slave_sql.inc
connection master;
show master status;
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);
drop table if exists t1;
create table t1 (n int);
insert into t1 values (1),(2),(3);
stop slave;
change master to master_log_pos=207;
connection slave;
change master to master_log_pos=MASTER_LOG_POS;
start slave;
select * from t1 ORDER BY n;
n
1
2
3
connection master;
drop table t1;
connection slave;
End of 5.0 tests
include/rpl_end.inc

View File

@ -1,9 +1,7 @@
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;
include/master-slave.inc
[connection master]
create table t1 (a int not null auto_increment primary key, b int, key(b));
INSERT INTO t1 (a) VALUES (1),(2);
drop table t1;
connection slave;
include/rpl_end.inc

View File

@ -1,18 +0,0 @@
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

View File

@ -1,9 +1,6 @@
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;
include/master-slave.inc
[connection master]
CALL mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT');
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(2, 0, rand()*1000, rand()*1000, "");
@ -13,12 +10,50 @@ delete from t1 where id=6;
set sql_log_bin=1;
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?'));
select * into outfile '../../tmp/rpl_misc_functions.outfile' from t1;
create table t2 like t1;
load data local infile 'MYSQLTEST_VARDIR/tmp/rpl_misc_functions.outfile' into table t2;
select * into outfile 'rpl_misc_functions.outfile' from t1;
connection slave;
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);
id i r1 r2 p id i r1 r2 p
stop slave;
drop table t1;
drop table t2;
connection master;
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

View File

@ -1,9 +1,5 @@
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;
include/master-slave.inc
[connection master]
create table t1 (a int primary key);
create table t2 (a int);
insert into t1 values (1);
@ -14,9 +10,13 @@ a
select * from t2;
a
1
connection slave;
select * from t1;
a
select * from t2;
a
1
connection master;
drop table t1,t2;
connection slave;
include/rpl_end.inc

View File

@ -1,13 +1,12 @@
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;
include/master-slave.inc
[connection master]
connection master;
set sql_log_bin=0;
create database mysqltest_from;
set sql_log_bin=1;
connection slave;
create database mysqltest_to;
connection master;
use mysqltest_from;
drop table if exists a;
CREATE TABLE a (i INT);
@ -20,10 +19,12 @@ delete alias FROM a alias where alias.i=2;
select * from a;
i
3
connection slave;
use mysqltest_to;
select * from a;
i
3
connection master;
create table t1 (a int primary key);
create table t2 (a int);
insert into t1 values (1);
@ -34,11 +35,15 @@ a
select * from t2;
a
1
connection slave;
select * from t1;
ERROR 42S02: Table 'mysqltest_to.t1' doesn't exist
select * from t2;
ERROR 42S02: Table 'mysqltest_to.t2' doesn't exist
connection master;
set sql_log_bin=0;
drop database mysqltest_from;
set sql_log_bin=1;
connection slave;
drop database mysqltest_to;
include/rpl_end.inc

View File

@ -1,12 +1,11 @@
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;
include/master-slave.inc
[connection master]
connection master;
drop database if exists d1;
drop database if exists d2;
connection slave;
drop database if exists d2;
connection master;
create database d1;
create table d1.t0 (id int);
create database d2;
@ -17,9 +16,13 @@ insert into t1 values (1), (2), (3), (4), (5);
insert into t2 select id + 3 from t1;
update t1 join t2 using (id) set t1.id = 0;
insert into d1.t0 values (0);
connection slave;
use d1;
select * from t0 where id=0;
id
0
connection master;
drop database d1;
drop database d2;
connection slave;
include/rpl_end.inc

View File

@ -1,9 +1,5 @@
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;
include/master-slave.inc
[connection master]
drop table if exists t1;
create table t1(n char(30));
prepare stmt1 from 'insert into t1 values (?)';
@ -19,12 +15,40 @@ set @var2= 'insert into t1 values (concat("from-var-", ?))';
prepare stmt2 from @var2;
set @var1='from-master-3';
execute stmt2 using @var1;
connection slave;
SELECT * FROM t1 ORDER BY n;
n
from-master-1
from-master-2-'',
from-var-from-master-3
connection master;
drop table t1;
connection slave;
stop slave;
reset master;
reset slave;
include/wait_for_slave_to_stop.inc
########################################################################
#
# 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

View File

@ -1,55 +0,0 @@
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;

View File

@ -1,19 +1,18 @@
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;
include/master-slave.inc
[connection master]
connection slave;
include/stop_slave.inc
connection master;
create table t1 (a int);
drop table t1;
create table t1 (a int);
drop table t1;
connection slave;
reset slave;
start slave io_thread;
stop slave io_thread;
include/wait_for_slave_param.inc [Slave_IO_State]
include/stop_slave_io.inc
reset slave;
start slave;
select master_pos_wait('master-bin.001',200,6)=-1;
master_pos_wait('master-bin.001',200,6)=-1
0
include/start_slave.inc
include/assert.inc [Assert that master_pos_wait does not timeout nor it returns NULL]
include/rpl_end.inc

View File

@ -1,9 +1,5 @@
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;
include/master-slave.inc
[connection master]
drop database if exists mysqltest1;
drop database if exists mysqltest2;
create database mysqltest1;
@ -11,13 +7,19 @@ create database mysqltest2;
use mysqltest1;
create table t1 (a int);
insert into t1 values(1);
connection slave;
select * from mysqltest1.t1;
ERROR 42S02: Table 'mysqltest1.t1' doesn't exist
connection master;
use mysqltest2;
create table t1 (a int);
insert into t1 values(1);
connection slave;
select * from mysqltest2.t1;
a
1
connection master;
drop database mysqltest1;
drop database mysqltest2;
connection slave;
include/rpl_end.inc

View File

@ -1,9 +1,6 @@
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;
include/master-slave.inc
[connection master]
connection master;
create database if not exists mysqltest1;
DROP TABLE IF EXISTS mysqltest1.t1;
CREATE TABLE mysqltest1.t1 (n MEDIUMINT NOT NULL AUTO_INCREMENT,
@ -24,6 +21,10 @@ FOR EACH ROW BEGIN
SET new.b = mysqltest1.f1();
END|
INSERT INTO mysqltest1.t1 SET n = NULL, a = now();
connection slave;
connection master;
DROP TABLE IF EXISTS mysqltest1.t1;
DROP FUNCTION mysqltest1.f1;
DROP DATABASE mysqltest1;
connection slave;
include/rpl_end.inc

View File

@ -1,15 +1,15 @@
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;
include/master-slave.inc
[connection master]
set local sql_mode="";
connection master;
DROP DATABASE IF EXISTS mysqltest1;
CREATE DATABASE mysqltest1;
CREATE USER tester IDENTIFIED BY 'test';
GRANT ALL ON mysqltest1.* TO 'tester'@'%' IDENTIFIED BY 'test';
GRANT ALL ON mysqltest1.* TO ''@'localhost%';
FLUSH PRIVILEGES;
connect m_1,localhost,tester,,mysqltest1;
connection m_1;
CREATE TABLE mysqltest1.t1 (a INT, users VARCHAR(255), PRIMARY KEY(a));
INSERT INTO mysqltest1.t1 VALUES(1,USER());
INSERT INTO mysqltest1.t1 VALUES(2,CURRENT_USER());
@ -19,21 +19,26 @@ INSERT INTO mysqltest1.t1 VALUES(3,USER());
INSERT INTO mysqltest1.t1 VALUES(4,CURRENT_USER());
end|
CALL mysqltest1.p1();
connection master;
SELECT * FROM mysqltest1.t1 ORDER BY a;
a users
1 tester@localhost
2 @localhost%
3 tester@localhost
4 @localhost%
connection slave;
SELECT * FROM mysqltest1.t1 ORDER BY a;
a users
1 tester@localhost
2 @localhost%
3 tester@localhost
4 @localhost%
connection master;
DROP DATABASE mysqltest1;
REVOKE ALL ON mysqltest1.* FROM 'tester'@'%';
REVOKE ALL ON mysqltest1.* FROM ''@'localhost%';
DROP DATABASE mysqltest1;
DROP USER 'tester';
DROP USER tester@'%';
DROP USER ''@'localhost%';
FLUSH PRIVILEGES;
connection slave;
include/rpl_end.inc

View File

@ -1,10 +1,6 @@
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 ****
include/master-slave.inc
[connection master]
connection master;
CREATE TABLE t1 (a int);
CREATE TABLE t2 (a int);
CREATE TEMPORARY TABLE t2 (a int, b int);
@ -12,47 +8,48 @@ SHOW TABLES;
Tables_in_test
t1
t2
**** On Slave ****
connection slave;
SHOW TABLES;
Tables_in_test
t1
t2
**** On Master ****
connection master;
DROP TABLE t2;
SHOW TABLES;
Tables_in_test
t1
t2
**** On Slave ****
connection slave;
SHOW TABLES;
Tables_in_test
t1
t2
**** On Master ****
connection master;
CREATE TEMPORARY TABLE t2 (a int, b int);
SHOW TABLES;
Tables_in_test
t1
t2
**** On Slave ****
connection slave;
SHOW TABLES;
Tables_in_test
t1
t2
**** On Master ****
connection master;
DROP TABLE t1,t2;
SHOW BINLOG EVENTS;
include/show_binlog_events.inc
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 107 Query 1 193 use `test`; CREATE TABLE t1 (a int)
master-bin.000001 193 Query 1 279 use `test`; CREATE TABLE t2 (a int)
master-bin.000001 279 Query 1 403 use `test`; DROP TEMPORARY TABLE IF EXISTS `t2` /* generated by server */
master-bin.000001 403 Query 1 527 use `test`; DROP TEMPORARY TABLE IF EXISTS `t2` /* generated by server */
master-bin.000001 527 Query 1 631 use `test`; DROP TABLE `t1` /* generated by server */
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int)
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a int)
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
SHOW TABLES;
Tables_in_test
t2
**** On Slave ****
connection slave;
SHOW TABLES;
Tables_in_test
t2
include/rpl_end.inc

View File

@ -1,9 +1,6 @@
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;
include/master-slave.inc
[connection master]
connection master;
DROP FUNCTION test.f1;
DROP TABLE IF EXISTS test.t1;
create table test.t1 (a int, PRIMARY KEY(a));
@ -22,9 +19,14 @@ select * from test.t1;
a
1
2
connection slave;
connection slave;
select * from test.t1;
a
1
2
connection master;
DROP FUNCTION test.f1;
DROP TABLE test.t1;
connection slave;
include/rpl_end.inc

View File

@ -1,14 +1,12 @@
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;
include/master-slave.inc
[connection master]
connection master;
create table t1 (a int not null primary key);
insert into t1 values (1);
create table t2 (a int);
insert into t2 values (1);
update t1, t2 set t1.a = 0 where t1.a = t2.a;
connection slave;
show tables;
Tables_in_test
t1
@ -16,46 +14,14 @@ select * from t1;
a
0
drop table t1;
connection master;
insert into t1 values (1);
show slave status;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_MYPORT
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 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
connection slave;
call mtr.add_suppression("Slave SQL.*Error executing row event: .Table .test.t1. doesn.t exist., error.* 1146");
include/wait_for_slave_sql_error.inc [errno=1146]
==== Clean up ====
include/stop_slave_io.inc
RESET SLAVE;
connection master;
drop table t1, t2;
include/rpl_end.inc

View File

@ -1,20 +1,19 @@
include/master-slave.inc
[connection master]
connection slave;
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;
connection master;
#
# Generate a big enough master's binlog to cause relay log rotations
#
create table t1 (a int);
drop table t1;
connection slave;
reset slave;
#
# 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_relay_log_size=8192-1;
Warnings:
@ -23,7 +22,7 @@ select @@global.max_relay_log_size;
@@global.max_relay_log_size
4096
start slave;
Checking that both slave threads are running.
include/check_slave_is_running.inc
#
# Test 2
#
@ -33,17 +32,19 @@ set global max_relay_log_size=(5*4096);
select @@global.max_relay_log_size;
@@global.max_relay_log_size 20480
start slave;
Checking that both slave threads are running.
include/check_slave_is_running.inc
#
# Test 3: max_relay_log_size = 0
#
stop slave;
reset slave;
set global max_relay_log_size=0;
Warnings:
Warning 1292 Truncated incorrect max_relay_log_size value: '0'
select @@global.max_relay_log_size;
@@global.max_relay_log_size 0
@@global.max_relay_log_size 4096
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
#
@ -56,19 +57,27 @@ flush logs;
reset slave;
start slave;
flush logs;
connection master;
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
#
flush logs;
connection master;
drop table t1;
Checking that both slave threads are running.
connection slave;
include/check_slave_is_running.inc
connection master;
flush logs;
show master status;
File Position 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_relay_log_size= @my_max_relay_log_size;
#
# End of 4.1 tests
#
include/rpl_end.inc

View File

@ -1,41 +1,58 @@
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;
Master_User root
Master_Host 127.0.0.1
include/master-slave.inc
[connection master]
connection slave;
Master_User = 'root'
Master_Host = '127.0.0.1'
include/stop_slave.inc
change master to master_user='test';
Master_User test
Master_Host 127.0.0.1
Master_User = 'test'
Master_Host = '127.0.0.1'
reset slave;
Master_User test
Master_Host 127.0.0.1
Master_User = 'test'
Master_Host = '127.0.0.1'
change master to master_user='root';
include/start_slave.inc
Master_User root
Master_Host 127.0.0.1
Master_User = 'root'
Master_Host = '127.0.0.1'
include/stop_slave.inc
reset slave;
include/start_slave.inc
connection master;
create temporary table t1 (a int);
connection slave;
include/stop_slave.inc
reset slave;
include/start_slave.inc
show status like 'slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 0
connection master;
drop temporary table if exists t1;
connection slave;
include/stop_slave.inc
reset slave;
include/check_slave_no_error.inc
change master to master_user='impossible_user_name';
start slave;
stop slave;
include/wait_for_slave_io_error.inc [errno=1045]
include/stop_slave_sql.inc
change master to master_user='root';
include/start_slave.inc
include/check_slave_no_error.inc
stop slave;
change master to master_user='impossible_user_name';
start slave;
stop slave;
include/wait_for_slave_io_error.inc [errno=1045]
include/stop_slave_sql.inc
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

View File

@ -1,9 +1,5 @@
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;
include/master-slave.inc
[connection master]
<Begin test section 1 (non deterministic SP)>
---------------------------------------------
@ -34,12 +30,14 @@ a t
2 NEW
3 NEW
4 NEW
connection slave;
SELECT * FROM t2 ORDER BY a;
a t
1 NEW
2 NEW
3 NEW
4 NEW
connection master;
call test.p2(1);
SELECT * FROM t2 ORDER BY a;
a t
@ -47,12 +45,14 @@ a t
2 Tex
3 Tex
4 Tex
connection slave;
SELECT * FROM t2 ORDER BY a;
a t
1 Tex
2 Tex
3 Tex
4 Tex
connection master;
call test.p2(2);
SELECT * FROM t2 ORDER BY a;
a t
@ -60,12 +60,14 @@ a t
2 SQL
3 SQL
4 SQL
connection slave;
SELECT * FROM t2 ORDER BY a;
a t
1 SQL
2 SQL
3 SQL
4 SQL
connection master;
call test.p2(3);
SELECT * FROM t2 ORDER BY a;
a t
@ -73,13 +75,17 @@ a t
2 NONE
3 NONE
4 NONE
connection slave;
SELECT * FROM t2 ORDER BY a;
a t
1 NONE
2 NONE
3 NONE
4 NONE
connection master;
DROP PROCEDURE test.p1;
DROP PROCEDURE test.p2;
DROP TABLE test.t1;
DROP TABLE test.t2;
connection slave;
include/rpl_end.inc

View File

@ -1,9 +1,6 @@
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;
include/master-slave.inc
[connection master]
connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t2;
@ -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);
UPDATE test.t1 SET id=id+4 WHERE id=4;
END|
< ---- Master selects-- >
-------------------------
CALL test.p2();
SELECT * FROM test.t1 ORDER BY id;
id data
@ -58,9 +52,7 @@ id2
2
3
4
< ---- Slave selects-- >
------------------------
connection slave;
SELECT * FROM test.t1 ORDER BY id;
id data
8 MySQL
@ -73,30 +65,28 @@ id2
2
3
4
< ---- Master selects-- >
-------------------------
connection master;
CALL test.p1();
Warnings:
Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM test.t3 ORDER BY id3;
id3 c
1 MySQL
2 kyle
3 Texas
4 ROCKS
< ---- Slave selects-- >
------------------------
connection slave;
SELECT * FROM test.t3 ORDER BY id3;
id3 c
1 MySQL
2 kyle
3 Texas
4 ROCKS
connection master;
ALTER PROCEDURE test.p1 MODIFIES SQL DATA;
connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
DROP TABLE IF EXISTS test.t3;
connection slave;
include/rpl_end.inc

View File

@ -1,9 +1,6 @@
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;
include/master-slave.inc
[connection master]
connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t2;
CREATE TABLE test.t1 (a INT,PRIMARY KEY(a));
@ -14,21 +11,19 @@ BEGIN
SELECT SQL_CALC_FOUND_ROWS * FROM test.t1 LIMIT 1;
INSERT INTO test.t2 VALUES(FOUND_ROWS());
END|
< ---- Master selects-- >
-------------------------
CALL test.p1();
a
1
SELECT * FROM test.t2;
a
2
< ---- Slave selects-- >
------------------------
connection slave;
SELECT * FROM test.t2;
a
2
connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
connection slave;
include/rpl_end.inc

View File

@ -1,9 +1,6 @@
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;
include/master-slave.inc
[connection master]
connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
@ -53,25 +50,33 @@ SELECT * FROM test.t2 ORDER BY a;
a
1
3
connection slave;
SELECT * FROM test.t2 ORDER BY a;
a
1
3
connection master;
truncate test.t2;
call test.p1('b');
select * from test.t2 ORDER BY a;
a
2
4
connection slave;
SELECT * FROM test.t2 ORDER BY a;
a
2
4
connection master;
truncate test.t2;
SELECT * FROM test.t2 ORDER BY a;
a
connection slave;
SELECT * FROM test.t2 ORDER BY a;
a
connection master;
DROP PROCEDURE test.p1;
DROP TABLE test.t1;
DROP TABLE test.t2;
connection slave;
include/rpl_end.inc

View File

@ -1,9 +1,6 @@
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;
include/master-slave.inc
[connection master]
connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP PROCEDURE IF EXISTS test.p3;
@ -26,8 +23,10 @@ SELECT * FROM test.t1 ORDER BY a;
a
1
2
connection slave;
show tables;
Tables_in_test
connection master;
CREATE PROCEDURE test.p3()
BEGIN
INSERT INTO test.t2 VALUES(7);
@ -44,13 +43,17 @@ SELECT * FROM test.t2 ORDER BY a;
a
6
7
connection slave;
SELECT * FROM test.t2 ORDER BY a;
a
6
7
connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP PROCEDURE IF EXISTS test.p3;
DROP PROCEDURE IF EXISTS test.p4;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
connection slave;
include/rpl_end.inc

View File

@ -1,9 +1,6 @@
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;
include/master-slave.inc
[connection master]
connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP PROCEDURE IF EXISTS test.p3;
@ -58,6 +55,8 @@ ALTER TABLE test.t2 DROP COLUMN to_drop;
INSERT INTO test.t2 VALUES ('gone',NULL,'STM',RAND());
END|
CALL test.p1();
connection slave;
connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP PROCEDURE IF EXISTS test.p3;
@ -67,3 +66,5 @@ DROP PROCEDURE IF EXISTS test.p6;
DROP PROCEDURE IF EXISTS test.p7;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
connection slave;
include/rpl_end.inc

View File

@ -1,12 +1,10 @@
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;
include/master-slave.inc
[connection master]
connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP PROCEDURE IF EXISTS test.p3;
create user user1@localhost;
grant usage on *.* to user1@localhost;
flush privileges;
SELECT CURRENT_USER();
@ -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 p2 TO user1@localhost;
GRANT EXECUTE ON PROCEDURE p3 TO user1@localhost;
<******** Master user1 p3 & p2 calls *******>
----------------------------------------------
set sql_mode=default;
connection slave;
connect muser1,localhost,user1,,;
connection muser1;
SELECT CURRENT_USER();
CURRENT_USER()
user1@localhost
@ -36,9 +35,9 @@ user1@localhost user1@localhost
CALL test.p2();
CURRENT_USER() USER()
root@localhost user1@localhost
<******** Slave user1 p3 & p2 calls *******>
---------------------------------------------
connect suser1,127.0.0.1,user1,,test,$SLAVE_MYPORT,;
connection master;
connection suser1;
SELECT CURRENT_USER();
CURRENT_USER()
user1@localhost
@ -51,9 +50,12 @@ user1@localhost user1@localhost
CALL test.p2();
CURRENT_USER() USER()
root@localhost user1@localhost
connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p3;
DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
DROP USER 'user1'@'localhost';
DROP USER user1@localhost;
connection slave;
include/rpl_end.inc

View File

@ -1,11 +1,10 @@
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;
include/master-slave.inc
[connection master]
connection master;
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) SELECT null FROM t1;
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;
start slave;
stop slave;
connection slave;
include/start_slave.inc
include/stop_slave.inc
drop table t1;
connection master;
drop table t1;

View File

@ -1,14 +1,10 @@
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;
include/master-slave.inc
[connection master]
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.t3 (n MEDIUMINT NOT NULL AUTO_INCREMENT, d DATETIME, PRIMARY KEY(n));
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()
BEGIN
INSERT INTO test.t3 (d) VALUES (NOW());
@ -18,9 +14,15 @@ CREATE PROCEDURE test.p2()
BEGIN
INSERT INTO test.t2 (f,d) VALUES (RAND(),NOW());
END//
connection slave;
connection master;
connection master;
INSERT INTO test.t1 VALUES (1+1, NOW());
connection slave;
<End test section 2 (Tiggers & SP)>
-----------------------------------
connection master;
DROP PROCEDURE test.p2;
DROP PROCEDURE test.p3;
DROP TRIGGER test.t2_ai;
@ -28,3 +30,5 @@ DROP TRIGGER test.t3_bi_t2;
DROP TABLE test.t1;
DROP TABLE test.t2;
DROP TABLE test.t3;
connection slave;
include/rpl_end.inc

View File

@ -1,9 +1,6 @@
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;
include/master-slave.inc
[connection master]
connection master;
DROP TRIGGER test.t2_ai;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
@ -20,6 +17,7 @@ id domain
3 earthmotherwear.com
4 yahoo.com
5 example.com
connection slave;
SELECT * FROM test.t1 ORDER BY id;
id domain
1 example.com
@ -27,6 +25,7 @@ id domain
3 earthmotherwear.com
4 yahoo.com
5 example.com
connection master;
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.t2 VALUES ('Yes', 1, NULL, 'spamfilter','scan_incoming');
@ -37,6 +36,7 @@ select * from test.t3;
value domain_id mailaccount_id program keey
No 5 NULL spamfilter scan_incoming
Yes 1 NULL spamfilter scan_incoming
connection slave;
select * from test.t2;
value domain_id mailaccount_id program keey
Yes 1 NULL spamfilter scan_incoming
@ -44,6 +44,7 @@ select * from test.t3;
value domain_id mailaccount_id program keey
No 5 NULL spamfilter scan_incoming
Yes 1 NULL spamfilter scan_incoming
connection master;
DELETE FROM test.t1 WHERE id = 1;
SELECT * FROM test.t1 ORDER BY id;
id domain
@ -51,19 +52,24 @@ id domain
3 earthmotherwear.com
4 yahoo.com
5 example.com
connection master;
SELECT * FROM test.t1 ORDER BY id;
id domain
2 mysql.com
3 earthmotherwear.com
4 yahoo.com
5 example.com
connection slave;
SELECT * FROM test.t1 ORDER BY id;
id domain
2 mysql.com
3 earthmotherwear.com
4 yahoo.com
5 example.com
connection master;
DROP TRIGGER test.t2_ai;
DROP TABLE test.t1;
DROP TABLE test.t2;
DROP TABLE test.t3;
connection slave;
include/rpl_end.inc

View File

@ -1,9 +1,6 @@
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;
include/master-slave.inc
[connection master]
connection master;
DROP TRIGGER test.t1_bi;
DROP TRIGGER test.t2_ai;
DROP TRIGGER test.t1_bu;
@ -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;
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;
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());
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;
Warnings:
Error 1329 No data - zero rows fetched, selected, or processed
connection slave;
connection master;
DROP TRIGGER test.t1_bi;
DROP TRIGGER test.t2_ai;
DROP TRIGGER test.t1_bu;
@ -87,3 +80,5 @@ DROP TRIGGER test.t2_ad;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
DROP TABLE IF EXISTS test.t3;
connection slave;
include/rpl_end.inc

View File

@ -6,15 +6,14 @@ INSERT INTO t1 VALUES (1),(2),(3),(4);
DROP TABLE t1;
CREATE TABLE t2(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
INSERT INTO t2 VALUES (1),(2);
connection slave;
connection master;
INSERT INTO t2 VALUES (3),(4);
DROP TABLE t2;
connection slave;
include/stop_slave.inc
RESET SLAVE;
CHANGE MASTER TO MASTER_USER='root', MASTER_CONNECT_RETRY=1, MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_MYPORT;
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
SELECT * FROM t1;
n
@ -23,7 +22,7 @@ n
3
4
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
SELECT * FROM t1;
n
@ -32,19 +31,12 @@ n
3
4
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;
include/wait_for_slave_to_start.inc
connection master;
connection slave;
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_sql_to_stop.inc
include/check_slave_param.inc [Exec_Master_Log_Pos]
@ -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
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
START SLAVE;
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
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

View File

@ -1,9 +1,6 @@
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;
include/master-slave.inc
[connection master]
connection master;
create database if not exists mysqltest1;
DROP VIEW IF EXISTS mysqltest1.v1;
DROP VIEW IF EXISTS mysqltest1.v2;
@ -35,6 +32,7 @@ a c c2
1 Thank GOD
2 it is
3 Friday TGIF
connection slave;
SELECT * FROM mysqltest1.v2;
qty price value
3 50 150
@ -45,6 +43,7 @@ a c c2
1 Thank GOD
2 it is
3 Friday TGIF
connection master;
INSERT INTO mysqltest1.t5 SELECT * FROM mysqltest1.v2;
INSERT INTO mysqltest1.t3 SELECT * FROM mysqltest1.v1;
SELECT * FROM mysqltest1.t5 ORDER BY qty;
@ -57,6 +56,7 @@ a c c2
1 Thank GOD
2 it is
3 Friday TGIF
connection slave;
SELECT * FROM mysqltest1.t5 ORDER BY qty;
qty price total
3 50 150
@ -67,6 +67,7 @@ a c c2
1 Thank GOD
2 it is
3 Friday TGIF
connection master;
INSERT INTO mysqltest1.v4 VALUES (4,'TEST');
SELECT * FROM mysqltest1.t1 ORDER BY a;
a c
@ -79,6 +80,7 @@ a c
2 it
3 Friday
4 TEST
connection slave;
SELECT * FROM mysqltest1.t1 ORDER BY a;
a c
1 Thank
@ -90,6 +92,7 @@ a c
2 it
3 Friday
4 TEST
connection master;
DROP VIEW IF EXISTS mysqltest1.v1;
DROP VIEW IF EXISTS mysqltest1.v2;
DROP VIEW IF EXISTS mysqltest1.v3;
@ -99,3 +102,5 @@ DROP TABLE IF EXISTS mysqltest1.t1;
DROP TABLE IF EXISTS mysqltest1.t2;
DROP TABLE IF EXISTS mysqltest1.t4;
DROP DATABASE mysqltest1;
connection slave;
include/rpl_end.inc

View File

@ -1,19 +1,19 @@
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;
include/master-slave.inc
[connection master]
connection slave;
create table t1 (n int);
reset master;
stop slave;
include/stop_slave.inc
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
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 256 None 0 No NULL No 0 0 1 No conservative 0 NULL
start slave;
insert into t1 values (1);
show status like "slave_running";
Variable_name Value
Slave_running OFF
include/wait_for_slave_param.inc [Last_IO_Errno]
Last_IO_Errno = '1593'
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;

View File

@ -1,21 +1,38 @@
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;
include/master-slave.inc
[connection master]
connection slave;
create table t1 (n int);
reset master;
stop slave;
include/wait_for_slave_to_stop.inc
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;
include/wait_for_slave_to_start.inc
insert into t1 values (1);
select * from t1;
n
1
1
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 t2;
connection slave;
include/rpl_end.inc

View File

@ -1,12 +1,8 @@
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;
include/master-slave.inc
[connection master]
drop table if exists t1;
Warnings:
Note 1051 Unknown table 't1'
Note 1051 Unknown table 'test.t1'
create table t1(a varchar(100),b int);
set @@session.sql_mode=pipes_as_concat;
insert into t1 values('My'||'SQL', 1);
@ -16,10 +12,12 @@ select * from t1 where b<3 order by a;
a b
1 2
MySQL 1
connection slave;
select * from t1 where b<3 order by a;
a b
1 2
MySQL 1
connection master;
set @@session.sql_mode=ignore_space;
insert into t1 values(password ('MySQL'), 3);
set @@session.sql_mode=ansi_quotes;
@ -37,7 +35,24 @@ insert into t2 select 2,a from t1 where a is null;
select * from t2 order by b;
b a
1 1
connection slave;
select * from t2 order by b;
b a
1 1
connection master;
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

View File

@ -1,9 +1,5 @@
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;
include/master-slave.inc
[connection master]
set global log_bin_trust_function_creators=0;
set binlog_format=STATEMENT;
create function fn16456()
@ -27,3 +23,4 @@ set binlog_format=STATEMENT;
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)
drop function fn16456;
include/rpl_end.inc

View File

@ -1,16 +1,18 @@
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;
include/master-slave.inc
[connection master]
create table t1 (n int not null primary key);
connection slave;
insert into t1 values (1);
connection master;
insert into t1 values (1);
insert into t1 values (2),(3);
connection slave;
select * from t1 ORDER BY n;
n
1
2
3
connection master;
drop table t1;
connection slave;
include/rpl_end.inc

View File

@ -1,63 +1,48 @@
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;
grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl';
stop slave;
change master to master_user='rpl',master_password='rpl';
start slave;
drop table if exists t1;
create table t1 (n int);
insert into t1 values (1);
select * from t1;
include/master-slave.inc
[connection master]
==== Create new replication user ====
connection master;
GRANT REPLICATION SLAVE ON *.* TO rpl@127.0.0.1 IDENTIFIED BY 'rpl';
connection slave;
include/stop_slave.inc
set @save_relay_log_purge=@@global.relay_log_purge;
set @@global.relay_log_purge=0;
CHANGE MASTER TO master_user='rpl', master_password='rpl';
select @@global.relay_log_purge;
@@global.relay_log_purge
0
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
1
drop user rpl@127.0.0.1;
flush privileges;
stop slave;
start slave;
show slave status;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User rpl
Master_Port MASTER_MYPORT
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 Connecting
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 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;
==== Delete new replication user ====
connection master;
DROP USER rpl@127.0.0.1;
FLUSH PRIVILEGES;
connection slave;
==== Restart slave without privileges =====
include/stop_slave.inc
START SLAVE;
include/wait_for_slave_sql_to_start.inc
include/wait_for_slave_io_to_stop.inc
==== Verify that Slave IO thread stopped with error ====
include/wait_for_slave_io_error.inc [errno=1045]
==== Cleanup (Note that slave IO thread is not running) ====
include/stop_slave_sql.inc
CHANGE MASTER TO MASTER_USER = 'root', MASTER_PASSWORD = '';
include/rpl_reset.inc
connection master;
DROP TABLE t1;
include/rpl_end.inc

View File

@ -0,0 +1,476 @@
@@ -126,11 +126,14 @@
show warnings;
Level Code Message
Error 1062 Duplicate entry '20' for key 'a'
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
select * from t2;
a
+20
connection slave;
select * from t2;
a
+20
select * from mysql.proc where name="foo4" and db='mysqltest1';
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
mysqltest1 foo4 PROCEDURE foo4 SQL CONTAINS_SQL YES DEFINER begin
@@ -170,20 +173,16 @@
insert into t2 values(fn1(21));
select * from t1;
a
-15
20
21
-5
select * from t2;
a
23
connection slave;
select * from t1;
a
-15
20
21
-5
select * from t2;
a
23
@@ -290,13 +289,18 @@
do fn1(100);
Warnings:
Error 1062 Duplicate entry '100' for key 'a'
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
select fn1(20);
ERROR 23000: Duplicate entry '20' for key 'a'
select * from t2;
a
+20
+100
connection slave;
select * from t2;
a
+20
+100
connection con1;
create trigger trg before insert on t1 for each row set new.a= 10;
ERROR 42000: TRIGGER command denied to user 'zedjzlcsjhd'@'localhost' for table 't1'
@@ -470,13 +474,13 @@
end
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values ( NAME_CONST('b',8))
-master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (unix_timestamp())
-master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `mysqltest1`; delete from t1
-master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo2`()
select * from mysqltest1.t1
@@ -507,24 +511,24 @@
end
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(3)
-master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (15)
-master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(3)
-master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `mysqltest1`; alter procedure foo4 sql security invoker
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(3)
-master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (5)
-master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `mysqltest1`; delete from t2
-master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `mysqltest1`; alter table t2 add unique (a)
master-bin.000001 # Gtid # # GTID #-#-#
@@ -535,6 +539,9 @@
begin
insert into t2 values(20),(20);
end
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(20),(20)
+master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `mysqltest1`; drop procedure foo4
master-bin.000001 # Gtid # # GTID #-#-#
@@ -555,10 +562,10 @@
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`fn1`(20)
-master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(fn1(21))
-master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `mysqltest1`; drop function fn1
master-bin.000001 # Gtid # # GTID #-#-#
@@ -569,10 +576,10 @@
end
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `mysqltest1`; delete from t1
-master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(fn1())
-master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`zedjzlcsjhd`@`127.0.0.1` FUNCTION `fn2`() RETURNS int(11)
NO SQL
@@ -587,7 +594,7 @@
end
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `mysqltest1`; delete from t2
-master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `mysqltest1`; alter table t2 add unique (a)
master-bin.000001 # Gtid # # GTID #-#-#
@@ -599,21 +606,27 @@
return 10;
end
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`fn1`(100)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
+master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`fn1`(20)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `mysqltest1`; delete from t1
-master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger trg before insert on t1 for each row set new.a= 10
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (1)
-master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `mysqltest1`; delete from t1
-master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `mysqltest1`; drop trigger trg
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (1)
-master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`()
READS SQL DATA
@@ -645,7 +658,7 @@
master-bin.000001 # Query # # use `test`; create table t1 (a int)
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; insert into t1 (a) values (f1())
-master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; drop view v1
master-bin.000001 # Gtid # # GTID #-#-#
@@ -661,7 +674,7 @@
INSERT INTO t1 VALUES(arg)
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES( NAME_CONST('arg',_latin1'test' COLLATE 'latin1_swedish_ci'))
-master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP PROCEDURE p1
master-bin.000001 # Gtid # # GTID #-#-#
@@ -695,7 +708,7 @@
begin end
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `mysqltest2`; insert into t values ( 1 )
-master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `mysqltest2`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
begin
@@ -704,7 +717,7 @@
end
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `mysqltest`; SELECT `mysqltest2`.`f1`()
-master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # COMMIT
connection slave;
set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
connection master;
@@ -799,19 +812,25 @@
SET TIMESTAMP=t/*!*/;
insert into t1 values ( NAME_CONST('b',8))
/*!*/;
-COMMIT/*!*/;
+SET TIMESTAMP=t/*!*/;
+COMMIT
+/*!*/;
BEGIN
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t1 values (unix_timestamp())
/*!*/;
-COMMIT/*!*/;
+SET TIMESTAMP=t/*!*/;
+COMMIT
+/*!*/;
BEGIN
/*!*/;
SET TIMESTAMP=t/*!*/;
delete from t1
/*!*/;
-COMMIT/*!*/;
+SET TIMESTAMP=t/*!*/;
+COMMIT
+/*!*/;
SET TIMESTAMP=t/*!*/;
CREATE DEFINER=`root`@`localhost` PROCEDURE `foo2`()
select * from mysqltest1.t1
@@ -856,21 +875,27 @@
SET TIMESTAMP=t/*!*/;
insert into t2 values(3)
/*!*/;
-COMMIT/*!*/;
+SET TIMESTAMP=t/*!*/;
+COMMIT
+/*!*/;
BEGIN
/*!*/;
SET TIMESTAMP=t/*!*/;
SET @@session.sql_mode=0/*!*/;
insert into t1 values (15)
/*!*/;
-COMMIT/*!*/;
+SET TIMESTAMP=t/*!*/;
+COMMIT
+/*!*/;
BEGIN
/*!*/;
SET TIMESTAMP=t/*!*/;
SET @@session.sql_mode=1411383296/*!*/;
insert into t2 values(3)
/*!*/;
-COMMIT/*!*/;
+SET TIMESTAMP=t/*!*/;
+COMMIT
+/*!*/;
SET TIMESTAMP=t/*!*/;
SET @@session.sql_mode=0/*!*/;
alter procedure foo4 sql security invoker
@@ -881,20 +906,26 @@
SET @@session.sql_mode=1411383296/*!*/;
insert into t2 values(3)
/*!*/;
-COMMIT/*!*/;
+SET TIMESTAMP=t/*!*/;
+COMMIT
+/*!*/;
BEGIN
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t1 values (5)
/*!*/;
-COMMIT/*!*/;
+SET TIMESTAMP=t/*!*/;
+COMMIT
+/*!*/;
BEGIN
/*!*/;
SET TIMESTAMP=t/*!*/;
SET @@session.sql_mode=0/*!*/;
delete from t2
/*!*/;
-COMMIT/*!*/;
+SET TIMESTAMP=t/*!*/;
+COMMIT
+/*!*/;
SET TIMESTAMP=t/*!*/;
alter table t2 add unique (a)
/*!*/;
@@ -908,6 +939,14 @@
insert into t2 values(20),(20);
end
/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=t/*!*/;
+insert into t2 values(20),(20)
+/*!*/;
+SET TIMESTAMP=t/*!*/;
+COMMIT
+/*!*/;
SET TIMESTAMP=t/*!*/;
drop procedure foo4
/*!*/;
@@ -941,13 +980,17 @@
SET TIMESTAMP=t/*!*/;
SELECT `mysqltest1`.`fn1`(20)
/*!*/;
-COMMIT/*!*/;
+SET TIMESTAMP=t/*!*/;
+COMMIT
+/*!*/;
BEGIN
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t2 values(fn1(21))
/*!*/;
-COMMIT/*!*/;
+SET TIMESTAMP=t/*!*/;
+COMMIT
+/*!*/;
SET TIMESTAMP=t/*!*/;
drop function fn1
/*!*/;
@@ -963,13 +1006,17 @@
SET TIMESTAMP=t/*!*/;
delete from t1
/*!*/;
-COMMIT/*!*/;
+SET TIMESTAMP=t/*!*/;
+COMMIT
+/*!*/;
BEGIN
/*!*/;
SET TIMESTAMP=t/*!*/;
insert into t1 values(fn1())
/*!*/;
-COMMIT/*!*/;
+SET TIMESTAMP=t/*!*/;
+COMMIT
+/*!*/;
SET TIMESTAMP=t/*!*/;
SET @@session.sql_mode=1411383296/*!*/;
CREATE DEFINER=`zedjzlcsjhd`@`127.0.0.1` FUNCTION `fn2`() RETURNS int(11)
@@ -991,7 +1038,9 @@
SET TIMESTAMP=t/*!*/;
delete from t2
/*!*/;
-COMMIT/*!*/;
+SET TIMESTAMP=t/*!*/;
+COMMIT
+/*!*/;
SET TIMESTAMP=t/*!*/;
alter table t2 add unique (a)
/*!*/;
@@ -1008,9 +1057,27 @@
BEGIN
/*!*/;
SET TIMESTAMP=t/*!*/;
+SELECT `mysqltest1`.`fn1`(100)
+/*!*/;
+SET TIMESTAMP=t/*!*/;
+COMMIT
+/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=t/*!*/;
+SELECT `mysqltest1`.`fn1`(20)
+/*!*/;
+SET TIMESTAMP=t/*!*/;
+COMMIT
+/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=t/*!*/;
delete from t1
/*!*/;
-COMMIT/*!*/;
+SET TIMESTAMP=t/*!*/;
+COMMIT
+/*!*/;
SET TIMESTAMP=t/*!*/;
CREATE DEFINER=`root`@`localhost` trigger trg before insert on t1 for each row set new.a= 10
/*!*/;
@@ -1019,13 +1086,17 @@
SET TIMESTAMP=t/*!*/;
insert into t1 values (1)
/*!*/;
-COMMIT/*!*/;
+SET TIMESTAMP=t/*!*/;
+COMMIT
+/*!*/;
BEGIN
/*!*/;
SET TIMESTAMP=t/*!*/;
delete from t1
/*!*/;
-COMMIT/*!*/;
+SET TIMESTAMP=t/*!*/;
+COMMIT
+/*!*/;
SET TIMESTAMP=t/*!*/;
drop trigger trg
/*!*/;
@@ -1034,7 +1105,9 @@
SET TIMESTAMP=t/*!*/;
insert into t1 values (1)
/*!*/;
-COMMIT/*!*/;
+SET TIMESTAMP=t/*!*/;
+COMMIT
+/*!*/;
SET TIMESTAMP=t/*!*/;
CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`()
READS SQL DATA
@@ -1079,7 +1152,9 @@
SET TIMESTAMP=t/*!*/;
insert into t1 (a) values (f1())
/*!*/;
-COMMIT/*!*/;
+SET TIMESTAMP=t/*!*/;
+COMMIT
+/*!*/;
SET TIMESTAMP=t/*!*/;
drop view v1
/*!*/;
@@ -1104,7 +1179,9 @@
SET TIMESTAMP=t/*!*/;
INSERT INTO t1 VALUES( NAME_CONST('arg',_latin1'test' COLLATE 'latin1_swedish_ci'))
/*!*/;
-COMMIT/*!*/;
+SET TIMESTAMP=t/*!*/;
+COMMIT
+/*!*/;
SET TIMESTAMP=t/*!*/;
DROP PROCEDURE p1
/*!*/;
@@ -1156,7 +1233,9 @@
SET TIMESTAMP=t/*!*/;
insert into t values ( 1 )
/*!*/;
-COMMIT/*!*/;
+SET TIMESTAMP=t/*!*/;
+COMMIT
+/*!*/;
SET TIMESTAMP=t/*!*/;
CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
begin
@@ -1170,7 +1249,9 @@
SET TIMESTAMP=t/*!*/;
SELECT `mysqltest2`.`f1`()
/*!*/;
-COMMIT/*!*/;
+SET TIMESTAMP=t/*!*/;
+COMMIT
+/*!*/;
SET TIMESTAMP=t/*!*/;
drop database mysqltest
/*!*/;

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,6 @@
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;
include/master-slave.inc
[connection master]
connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t2;
@ -38,6 +35,7 @@ a
2
3
8
connection slave;
SELECT * FROM test.t1 ORDER BY a;
a
1
@ -50,15 +48,18 @@ a
2
3
8
connection master;
CALL test.p2();
USE test;
SHOW TABLES;
Tables_in_test
t3
connection slave;
USE test;
SHOW TABLES;
Tables_in_test
t3
connection master;
CALL test.p1();
Warnings:
Note 1050 Table 't3' already exists
@ -74,6 +75,7 @@ a
2
3
8
connection slave;
SELECT * FROM test.t1 ORDER BY a;
a
1
@ -86,8 +88,11 @@ a
2
3
8
connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
DROP TABLE IF EXISTS test.t3;
connection slave;
include/rpl_end.inc

View File

@ -1,9 +1,7 @@
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;
include/master-slave.inc
[connection master]
connection master;
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
drop procedure if exists p1;
drop procedure if exists p2;
drop function if exists f1;
@ -20,6 +18,8 @@ set spv=spv+1;
end while;
end//
call p1();
connection slave;
connection slave;
SELECT * FROM t1 ORDER BY a;
a
1
@ -27,6 +27,7 @@ a
3
4
5
connection master;
SELECT * FROM t1 ORDER BY a;
a
1
@ -43,9 +44,12 @@ call p2();
SELECT * FROM t2 ORDER BY a;
a
4
connection slave;
connection slave;
SELECT * FROM t2 ORDER BY a;
a
4
connection master;
drop procedure p1;
drop procedure p2;
drop table t2;
@ -104,6 +108,8 @@ master: 7
master: 8
master: 10
master: 11
connection slave;
connection slave;
SELECT 'slave:',a FROM t1 ORDER BY a;
slave: a
slave: 1
@ -120,6 +126,7 @@ slave: 7
slave: 8
slave: 10
slave: 11
connection master;
drop procedure p1;
delete from t1;
delete from t2;
@ -134,10 +141,13 @@ SELECT 'master:',a FROM t1 ORDER BY a;
master: a
master: 1
master: 2
connection slave;
connection slave;
SELECT 'slave:',a FROM t1 ORDER BY a;
slave: a
slave: 1
slave: 2
connection master;
drop view v1;
delete from t1;
prepare s1 from 'select f1(?)';
@ -148,9 +158,12 @@ f1(?)
SELECT 'master:',a FROM t1 ORDER BY a;
master: a
master: 123
connection slave;
connection slave;
SELECT 'slave:',a FROM t1 ORDER BY a;
slave: a
slave: 123
connection master;
delete from t1;
create procedure p1(spv int)
begin
@ -169,12 +182,15 @@ master: 6
master: 6
master: 15
master: 15
connection slave;
connection slave;
SELECT 'slave:',a FROM t1 ORDER BY a;
slave: a
slave: 6
slave: 6
slave: 15
slave: 15
connection master;
drop procedure p1;
drop function f1;
drop table t1,t2;
@ -220,6 +236,8 @@ master 100
master 101
master 101
master 102
connection slave;
connection slave;
SELECT 'slave', a FROM t1 ORDER BY a;
slave a
slave 10
@ -231,7 +249,73 @@ slave 100
slave 101
slave 101
slave 102
connection master;
drop table t1;
drop function f1;
drop function f2;
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

View File

@ -1,12 +1,17 @@
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;
include/master-slave.inc
[connection master]
connection slave;
include/stop_slave.inc
connection master;
create table t1(n int);
start slave;
stop slave io_thread;
connection slave;
include/start_slave.inc
include/stop_slave_io.inc
start slave io_thread;
include/wait_for_slave_io_to_start.inc
connection master;
connection slave;
connection master;
drop table t1;
connection slave;
include/rpl_end.inc

View File

@ -1,20 +1,19 @@
include/master-slave.inc
[connection master]
connection slave;
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;
connection master;
#
# Generate a big enough master's binlog to cause relay log rotations
#
create table t1 (a int);
drop table t1;
connection slave;
reset slave;
#
# 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_relay_log_size=8192-1;
Warnings:
@ -23,7 +22,7 @@ select @@global.max_relay_log_size;
@@global.max_relay_log_size
4096
start slave;
Checking that both slave threads are running.
include/check_slave_is_running.inc
#
# Test 2
#
@ -33,17 +32,19 @@ set global max_relay_log_size=(5*4096);
select @@global.max_relay_log_size;
@@global.max_relay_log_size 20480
start slave;
Checking that both slave threads are running.
include/check_slave_is_running.inc
#
# Test 3: max_relay_log_size = 0
#
stop slave;
reset slave;
set global max_relay_log_size=0;
Warnings:
Warning 1292 Truncated incorrect max_relay_log_size value: '0'
select @@global.max_relay_log_size;
@@global.max_relay_log_size 0
@@global.max_relay_log_size 4096
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
#
@ -56,19 +57,27 @@ flush logs;
reset slave;
start slave;
flush logs;
connection master;
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
#
flush logs;
connection master;
drop table t1;
Checking that both slave threads are running.
connection slave;
include/check_slave_is_running.inc
connection master;
flush logs;
show master status;
File Position 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_relay_log_size= @my_max_relay_log_size;
#
# End of 4.1 tests
#
include/rpl_end.inc

View File

@ -1,20 +1,20 @@
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;
include/master-slave.inc
[connection master]
create table t1(n int auto_increment primary key, s char(10));
connection slave;
insert into t1 values (2,'old');
connection master;
insert into t1 values(NULL,'new');
insert into t1 values(NULL,'new');
connection slave;
select * from t1 order by n;
n s
1 new
2 old
delete from t1 where n = 2;
start slave;
stop slave;
include/start_slave.inc
include/stop_slave.inc
connection master;
create table t2(n int);
drop table t2;
insert into t1 values(NULL,'new');
@ -22,10 +22,14 @@ set sql_log_bin=0;
insert into t1 values(NULL,'new');
set sql_log_bin=1;
delete from t1 where n=4;
start slave;
connection slave;
include/start_slave.inc
select * from t1 order by n;
n s
1 new
2 new
3 new
connection master;
drop table t1;
connection slave;
include/rpl_end.inc

View File

@ -1,52 +1,71 @@
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;
include/master-slave.inc
[connection master]
connection slave;
create database mysqltest;
connection master;
drop database if exists mysqltest;
Warnings:
Note 1008 Can't drop database 'mysqltest'; database doesn't exist
connection slave;
show tables from mysqltest;
ERROR 42000: Unknown database 'mysqltest'
connection slave;
create table t1 (a int);
connection master;
drop table if exists t1;
Warnings:
Note 1051 Unknown table 't1'
Note 1051 Unknown table 'test.t1'
connection slave;
select * from t1;
ERROR 42S02: Table 'test.t1' doesn't exist
connection master;
create table t1 (a int, b int);
connection slave;
insert into t1 values(1,1);
connection master;
delete from t1;
connection slave;
select * from t1;
a b
insert into t1 values(1,1);
connection master;
insert into t1 values(2,1);
update t1 set a=2;
connection slave;
select * from t1;
a b
2 1
2 1
connection master;
create table t2 (a int, b int);
delete from t1;
insert into t1 values(1,1);
insert into t2 values(1,1);
connection slave;
update t1 set a=2;
connection master;
UPDATE t1, t2 SET t1.a = t2.a;
connection slave;
select * from t1;
a b
1 1
select * from t2;
a b
1 1
connection master;
delete from t1;
delete from t2;
connection slave;
insert into t1 values(1,1);
insert into t2 values(1,1);
connection master;
DELETE t1.*, t2.* from t1, t2;
connection slave;
select * from t1;
a b
select * from t2;
a b
connection master;
drop table t1, t2;
connection slave;
include/rpl_end.inc

View File

@ -1,41 +1,58 @@
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;
Master_User root
Master_Host 127.0.0.1
include/master-slave.inc
[connection master]
connection slave;
Master_User = 'root'
Master_Host = '127.0.0.1'
include/stop_slave.inc
change master to master_user='test';
Master_User test
Master_Host 127.0.0.1
Master_User = 'test'
Master_Host = '127.0.0.1'
reset slave;
Master_User test
Master_Host 127.0.0.1
Master_User = 'test'
Master_Host = '127.0.0.1'
change master to master_user='root';
include/start_slave.inc
Master_User root
Master_Host 127.0.0.1
Master_User = 'root'
Master_Host = '127.0.0.1'
include/stop_slave.inc
reset slave;
include/start_slave.inc
connection master;
create temporary table t1 (a int);
connection slave;
include/stop_slave.inc
reset slave;
include/start_slave.inc
show status like 'slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 1
connection master;
drop temporary table if exists t1;
connection slave;
include/stop_slave.inc
reset slave;
include/check_slave_no_error.inc
change master to master_user='impossible_user_name';
start slave;
stop slave;
include/wait_for_slave_io_error.inc [errno=1045]
include/stop_slave_sql.inc
change master to master_user='root';
include/start_slave.inc
include/check_slave_no_error.inc
stop slave;
change master to master_user='impossible_user_name';
start slave;
stop slave;
include/wait_for_slave_io_error.inc [errno=1045]
include/stop_slave_sql.inc
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

View File

@ -1,15 +1,36 @@
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;
set @saved_binlog_format = @@global.binlog_format;
include/master-slave.inc
[connection master]
connection slave;
connection master;
drop database if exists mysqltest1;
create database 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 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%";
Variable_name Value
binlog_format ROW
@ -68,11 +89,11 @@ execute stmt1 using @string;
deallocate prepare stmt1;
insert into t1 values("for_10_");
insert into t1 select "yesterday_11_";
set binlog_format=default;
set binlog_format=statement;
select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format
STATEMENT STATEMENT
set global binlog_format=default;
set global binlog_format=statement;
select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format
STATEMENT STATEMENT
@ -87,11 +108,11 @@ execute stmt1 using @string;
deallocate prepare stmt1;
insert into t1 values("for_15_");
insert into t1 select "yesterday_16_";
set binlog_format=mixed;
set global binlog_format=mixed;
select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format
STATEMENT MIXED
set global binlog_format=mixed;
MIXED STATEMENT
set binlog_format=default;
select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format
MIXED MIXED
@ -112,11 +133,15 @@ execute stmt1 using @string;
deallocate prepare stmt1;
insert into t1 values(concat("for_23_",UUID()));
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();
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);
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);
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()
begin
insert into t1 values("work_25_");
@ -228,6 +253,14 @@ begin
set NEW.data = concat(NEW.data,UUID());
end|
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 t21 select * from t2;
create table t22 select * from t3;
@ -244,14 +277,18 @@ end|
select f("try_41_");
f("try_41_")
1
connection slave;
use mysqltest1;
insert into t2 values(2,null),(3,null),(4,null);
delete from t2 where a>=2;
connection master;
select f("try_42_");
f("try_42_")
1
connection slave;
insert into t2 values(3,null),(4,null);
delete from t2 where a>=3;
connection master;
prepare stmt1 from 'select f(?)';
set @string="try_43_";
insert into t1 values(null,"try_44_");
@ -259,6 +296,8 @@ execute stmt1 using @string;
f(?)
1
deallocate prepare stmt1;
connection slave;
connection master;
create table t12 select * from t1;
drop table t1;
create table t1 (a int, b varchar(100), key(a));
@ -284,12 +323,16 @@ end|
select f1("try_46_"),f2("try_47_");
f1("try_46_") f2("try_47_")
1 1
connection slave;
insert into t2 values(2,null),(3,null),(4,null);
delete from t2 where a>=2;
connection master;
select f1("try_48_"),f2("try_49_");
f1("try_48_") f2("try_49_")
1 1
insert into t3 values(concat("try_50_",f1("try_51_"),f2("try_52_")));
connection slave;
connection master;
drop function f2;
create function f2 (x varchar(100)) returns int deterministic
begin
@ -301,6 +344,8 @@ end|
select f1("try_53_"),f2("try_54_");
f1("try_53_") f2("try_54_")
1 3
connection slave;
connection master;
drop function f2;
create trigger t1_bi before insert on t1 for each row
begin
@ -309,12 +354,16 @@ end|
insert into t1 values(null,"try_56_");
alter table t1 modify a int, drop primary key;
insert into t1 values(null,"try_57_");
connection slave;
connection master;
CREATE TEMPORARY TABLE t15 SELECT UUID();
create table t16 like t15;
INSERT INTO t16 SELECT * FROM t15;
insert into t16 values("try_65_");
drop table t15;
insert into t16 values("try_66_");
connection slave;
connection master;
select count(*) from t1;
count(*)
7
@ -338,7 +387,7 @@ count(*)
66
select count(*) from t21;
count(*)
14
19
select count(*) from t22;
count(*)
2
@ -354,6 +403,8 @@ count(*)
select count(*) from t16;
count(*)
3
connection slave;
connection master;
DROP TABLE IF EXISTS t11;
SET SESSION BINLOG_FORMAT=STATEMENT;
CREATE TABLE t11 (song VARCHAR(255));
@ -366,17 +417,44 @@ UNLOCK TABLES;
SELECT * FROM t11;
song Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict
song Careful With That Axe, Eugene
connection slave;
USE mysqltest1;
SELECT * FROM t11;
song Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict
song Careful With That Axe, Eugene
connection master;
DROP TABLE IF EXISTS t12;
SET SESSION BINLOG_FORMAT=MIXED;
CREATE TABLE t12 (data LONG);
LOCK TABLES t12 WRITE;
INSERT INTO t12 VALUES(UUID());
UNLOCK TABLES;
show binlog events;
show binlog events;
connection slave;
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;
set global binlog_format= @saved_binlog_format;
connection slave;
connection master;
set global binlog_format =@my_binlog_format;
include/rpl_end.inc

View File

@ -1,9 +1,5 @@
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;
include/master-slave.inc
[connection master]
create table t2 (n int, PRIMARY KEY(n));
create temporary table t1 (n int);
create temporary table t3 (n int not null);
@ -15,10 +11,16 @@ insert into t3 values (1010);
insert into t2 select * from t3;
drop table if exists t3;
insert into t2 values (1012);
connection master1;
create temporary table t1 (n int);
insert into t1 values (4),(5);
insert into t2 select * from t1;
disconnect master;
connection slave;
connection master1;
insert into t2 values(61);
disconnect master1;
connection slave;
select * from t2;
n
1
@ -43,6 +45,19 @@ sum(n)
show status like 'Slave_open_temp_tables';
Variable_name Value
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;
Warnings:
Note 1051 Unknown table 't1'
Note 1051 Unknown table 'test.t1'
drop function f;
connection slave;
include/rpl_end.inc

View File

@ -1,11 +1,43 @@
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
SET sql_log_bin = 0;
SET sql_log_bin = 1;
include/master-slave.inc
[connection master]
connection slave;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
reset master;
CREATE USER ''@localhost;
connection master;
DROP TABLE IF EXISTS t1;
CREATE TEMPORARY TABLE t1 (a char(1));
INSERT INTO t1 VALUES ('a');
connection slave;
include/stop_slave.inc
include/start_slave.inc
connection master;
INSERT INTO t1 VALUES ('b');
connection slave;
connection master;
DROP TABLE IF EXISTS t1;
CREATE TEMPORARY TABLE `t1`(`a` tinyint,`b` char(1))engine=myisam;
INSERT IGNORE INTO `t1` set `a`=128,`b`='128';
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
Warning 1265 Data truncated for column 'b' at row 1
connection slave;
include/stop_slave.inc
include/start_slave.inc
connection master;
INSERT IGNORE INTO `t1` set `a`=128,`b`='128';
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
Warning 1265 Data truncated for column 'b' at row 1
connection slave;
connection master;
DROP TABLE t1;
connection slave;
connection master;
connect con1,localhost,root,,;
connect con2,localhost,root,,;
connect con3,localhost,zedjzlcsjhd,,;
connection con3;
SET @save_select_limit=@@session.sql_select_limit;
SET @@session.sql_select_limit=10, @@session.pseudo_thread_id=100;
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
@ -17,20 +49,33 @@ ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) fo
SELECT @@session.sql_select_limit = @save_select_limit;
@@session.sql_select_limit = @save_select_limit
1
connection con2;
SET @save_conn_id= connection_id();
SET @@session.pseudo_thread_id=100;
SET @@session.pseudo_thread_id=connection_id();
SET @@session.pseudo_thread_id=@save_conn_id;
SET @@session.sql_log_bin=0;
SET @@session.sql_log_bin=1;
connection con3;
drop table if exists t1,t2;
create table t1(f int);
create table t2(f int);
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
SELECT COUNT(*) FROM t1;
COUNT(*)
10
connection con1;
create temporary table t3(f int);
insert into t3 select * from t1 where f<6;
connection con2;
create temporary table t3(f int);
connection con1;
insert into t2 select count(*) from t3;
connection con2;
insert into t3 select * from t1 where f>=4;
connection con1;
drop temporary table t3;
connection con2;
insert into t2 select count(*) from t3;
drop temporary table t3;
select * from t2 ORDER BY f;
@ -75,15 +120,22 @@ f
7
drop table t1,t2;
create temporary table t3 (f int);
connection slave;
connection master;
create temporary table t4 (f int);
create table t5 (f int);
select id from information_schema.processlist where command='Binlog Dump' into @id;
kill @id;
connection slave;
stop slave;
connection master;
insert into t5 select * from t4;
connection slave;
start slave;
select * from t5 /* must be 1 after reconnection */;
f
connection master;
drop temporary table t4;
drop table t5;
connection con1;
set @@session.pseudo_thread_id=100;
create temporary table t101 (id int);
create temporary table t102 (id int);
@ -95,14 +147,99 @@ set @@session.pseudo_thread_id=300;
create temporary table t301 (id int);
create temporary table t302 (id int);
create temporary table `#sql_not_user_table303` (id int);
DROP USER ''@localhost;
disconnect con1;
connection master;
create table t1(f int);
insert into t1 values (1);
connection slave;
select * from t1 /* must be 1 */;
f
1
connection master;
drop table t1;
connection slave;
select * from t1;
a
1
connection master;
drop table t1;
connection slave;
include/stop_slave.inc
connection master;
include/rpl_reset.inc
-- Bug#43748
-- make a user on the slave that can list but not kill system threads.
connection slave;
FLUSH PRIVILEGES;
GRANT USAGE ON *.* TO user43748@127.0.0.1 IDENTIFIED BY 'meow';
GRANT PROCESS ON *.* TO user43748@127.0.0.1;
-- try to KILL system-thread as that non-privileged user (on slave).
connect cont43748,127.0.0.1,user43748,meow,test,$SLAVE_MYPORT,;
connection cont43748;
SELECT id INTO @id FROM information_schema.processlist WHERE user='system user' LIMIT 1;
KILL @id;
Got one of the listed errors
disconnect cont43748;
-- throw out test-user on slave.
connection slave;
DROP USER user43748@127.0.0.1;
#
# MDEV-10216: Assertion `strcmp(share->unique_file_name,filename) ||
# share->last_version' failed in myisam/mi_open.c:67: test_if_reopen
#
connection master;
CREATE TEMPORARY TABLE t1(i INT PRIMARY KEY) ENGINE=MYISAM;
INSERT INTO t1 VALUES(1);
SELECT COUNT(*)=1 FROM t1;
COUNT(*)=1
1
ALTER TABLE t1 RENAME t2;
SELECT COUNT(*)=1 FROM t2;
COUNT(*)=1
1
ALTER TABLE t2 RENAME t1;
ALTER TABLE t1 DISABLE KEYS;
ALTER TABLE t1 ENABLE KEYS;
LOCK TABLES t1 WRITE;
ALTER TABLE t1 RENAME t2;
SELECT COUNT(*)=1 FROM t2;
COUNT(*)=1
1
ALTER TABLE t2 RENAME t1;
ALTER TABLE t1 DISABLE KEYS;
ALTER TABLE t1 ENABLE KEYS;
UNLOCK TABLES;
LOCK TABLES t1 READ;
ALTER TABLE t1 RENAME t2;
SELECT COUNT(*)=1 FROM t2;
COUNT(*)=1
1
ALTER TABLE t2 RENAME t1;
ALTER TABLE t1 DISABLE KEYS;
ALTER TABLE t1 ENABLE KEYS;
UNLOCK TABLES;
FLUSH TABLES WITH READ LOCK;
ALTER TABLE t1 RENAME t2;
SELECT COUNT(*)=1 FROM t2;
COUNT(*)=1
1
ALTER TABLE t2 RENAME t1;
ALTER TABLE t1 DISABLE KEYS;
ALTER TABLE t1 ENABLE KEYS;
UNLOCK TABLES;
ALTER TABLE t1 RENAME t2, LOCK SHARED;
ALTER TABLE t2 RENAME t1, LOCK EXCLUSIVE;
DROP TABLE t1;
#
# MDEV-10320: NO-OP ALTER TABLE on temporary tables getting logged
# under row binlog format
#
connection master;
CREATE TEMPORARY TABLE t1(i INT PRIMARY KEY) ENGINE=MYISAM;
ALTER TABLE t1;
ALTER TABLE t1 ADD COLUMN IF NOT EXISTS I INT;
Warnings:
Note 1060 Duplicate column name 'I'
DROP TABLE t1;
End of 5.1 tests
include/rpl_end.inc

View File

@ -1,12 +1,6 @@
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;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3;
include/master-slave.inc
[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
create table t1 (a int auto_increment, primary key (a), b int, rand_value double not null);
create table t2 (a int auto_increment, primary key (a), b int);
create table t3 (a int auto_increment, primary key (a), name varchar(64) not null, old_a int, old_b int, rand_value double not null);
@ -22,8 +16,10 @@ insert into t3 values(100,"log",0,0,0);
SET @@RAND_SEED1=658490765, @@RAND_SEED2=635893186;
insert into t1 values(1,1,rand()),(NULL,2,rand());
insert into t2 (b) values(last_insert_id());
insert into t2 values(3,0),(NULL,0);
insert into t2 values(NULL,0),(500,0);
insert into t2 values(3,0);
insert into t2 values(NULL,0);
insert into t2 values(NULL,0);
insert into t2 values(500,0);
select a,b, truncate(rand_value,4) from t1;
a b truncate(rand_value,4)
1 1 0.4320
@ -39,14 +35,13 @@ select a,name, old_a, old_b, truncate(rand_value,4) from t3;
a name old_a old_b truncate(rand_value,4)
100 log 0 0 0.0000
101 t1 1 1 0.3203
102 t1 0 2 0.5666
102 t1 NULL 2 0.5666
103 t2 1 2 0.9164
104 t2 3 0 0.8826
105 t2 4 0 0.6635
106 t2 5 0 0.6699
107 t2 500 0 0.3593
--- On slave --
connection slave;
select a,b, truncate(rand_value,4) from t1;
a b truncate(rand_value,4)
1 1 0.4320
@ -62,16 +57,20 @@ select a,name, old_a, old_b, truncate(rand_value,4) from t3;
a name old_a old_b truncate(rand_value,4)
100 log 0 0 0.0000
101 t1 1 1 0.3203
102 t1 0 2 0.5666
102 t1 NULL 2 0.5666
103 t2 1 2 0.9164
104 t2 3 0 0.8826
105 t2 4 0 0.6635
106 t2 5 0 0.6699
107 t2 500 0 0.3593
connection master;
drop table t1,t2,t3;
connect con2,localhost,root,,;
connection con2;
select get_lock("bug12480",2);
get_lock("bug12480",2)
1
connection default;
create table t1 (a datetime,b datetime, c datetime);
drop function if exists bug12480;
create function bug12480() returns datetime
@ -91,40 +90,33 @@ select a=b && a=c from t1;
a=b && a=c
1
SELECT routine_name, definer
FROM information_schema.routines;
FROM information_schema.routines
WHERE routine_name = 'bug12480';
routine_name definer
add_suppression root@localhost
check_testcase root@localhost
check_warnings root@localhost
force_restart root@localhost
bug12480 root@localhost
SELECT trigger_name, definer
FROM information_schema.triggers;
FROM information_schema.triggers
WHERE trigger_name = 't1_first';
trigger_name definer
gs_insert root@localhost
ts_insert root@localhost
t1_first root@localhost
--- On slave --
connection slave;
SELECT routine_name, definer
FROM information_schema.routines;
FROM information_schema.routines
WHERE routine_name = 'bug12480';
routine_name definer
add_suppression root@localhost
check_testcase root@localhost
check_warnings root@localhost
force_restart root@localhost
bug12480 root@localhost
SELECT trigger_name, definer
FROM information_schema.triggers;
FROM information_schema.triggers
WHERE trigger_name = 't1_first';
trigger_name definer
gs_insert root@localhost
ts_insert root@localhost
t1_first root@localhost
select a=b && a=c from t1;
a=b && a=c
1
test
1
connection master;
disconnect con2;
truncate table t1;
drop trigger t1_first;
insert into t1 values ("2003-03-03","2003-03-03","2003-03-03"),(bug12480(),bug12480(),bug12480()),(now(),now(),now());
@ -144,6 +136,8 @@ end|
create database other;
use other;
insert into test.t1 values (1);
connection slave;
connection master;
use test;
drop table t1,t2;
drop database other;
@ -151,14 +145,18 @@ test case for BUG#13227
-------------------
10
-------------------
connection master;
drop table if exists t110;
connection slave;
drop table if exists t210,t310;
connection master;
create table t110 (f1 int) /* 2 replicate */;
insert into t110 values (-5);
insert into t110 values (-4);
insert into t110 values (-3);
insert into t110 values (-2);
insert into t110 values (-1);
connection slave;
select * from t110;
f1
-5
@ -198,11 +196,13 @@ f1
SELECT * from t310 /* must be f3 5*100 */;
f3
500
connection master;
UPDATE t110 SET f1=5 where f1=-5;
UPDATE t110 SET f1=4 where f1=-4;
UPDATE t110 SET f1=3 where f1=-3;
UPDATE t110 SET f1=2 where f1=-2;
UPDATE t110 SET f1=1 where f1=-1;
connection slave;
SELECT * from t110 /* must be f1 5 ... 1 */;
f1
5
@ -219,18 +219,25 @@ f3
100
drop trigger trg110;
drop table t210,t310;
connection master;
drop table t110;
connection slave;
connection master;
-------------------
9
-------------------
connection master;
drop table if exists t19;
connection slave;
drop table if exists t29,t39;
connection master;
create table t19 (f1 int) /* 2 replicate */;
insert into t19 values (-5);
insert into t19 values (-4);
insert into t19 values (-3);
insert into t19 values (-2);
insert into t19 values (-1);
connection slave;
select * from t19;
f1
-5
@ -270,11 +277,13 @@ f1
SELECT * from t39 /* must be f3 5*100 */;
f3
500
connection master;
UPDATE t19 SET f1=5 where f1=-5;
UPDATE t19 SET f1=4 where f1=-4;
UPDATE t19 SET f1=3 where f1=-3;
UPDATE t19 SET f1=2 where f1=-2;
UPDATE t19 SET f1=1 where f1=-1;
connection slave;
SELECT * from t19 /* must be f1 5 ... 1 */;
f1
5
@ -291,18 +300,25 @@ f3
100
drop trigger trg19;
drop table t29,t39;
connection master;
drop table t19;
connection slave;
connection master;
-------------------
8
-------------------
connection master;
drop table if exists t18;
connection slave;
drop table if exists t28,t38;
connection master;
create table t18 (f1 int) /* 2 replicate */;
insert into t18 values (-5);
insert into t18 values (-4);
insert into t18 values (-3);
insert into t18 values (-2);
insert into t18 values (-1);
connection slave;
select * from t18;
f1
-5
@ -342,11 +358,13 @@ f1
SELECT * from t38 /* must be f3 5*100 */;
f3
500
connection master;
UPDATE t18 SET f1=5 where f1=-5;
UPDATE t18 SET f1=4 where f1=-4;
UPDATE t18 SET f1=3 where f1=-3;
UPDATE t18 SET f1=2 where f1=-2;
UPDATE t18 SET f1=1 where f1=-1;
connection slave;
SELECT * from t18 /* must be f1 5 ... 1 */;
f1
5
@ -363,18 +381,25 @@ f3
100
drop trigger trg18;
drop table t28,t38;
connection master;
drop table t18;
connection slave;
connection master;
-------------------
7
-------------------
connection master;
drop table if exists t17;
connection slave;
drop table if exists t27,t37;
connection master;
create table t17 (f1 int) /* 2 replicate */;
insert into t17 values (-5);
insert into t17 values (-4);
insert into t17 values (-3);
insert into t17 values (-2);
insert into t17 values (-1);
connection slave;
select * from t17;
f1
-5
@ -414,11 +439,13 @@ f1
SELECT * from t37 /* must be f3 5*100 */;
f3
500
connection master;
UPDATE t17 SET f1=5 where f1=-5;
UPDATE t17 SET f1=4 where f1=-4;
UPDATE t17 SET f1=3 where f1=-3;
UPDATE t17 SET f1=2 where f1=-2;
UPDATE t17 SET f1=1 where f1=-1;
connection slave;
SELECT * from t17 /* must be f1 5 ... 1 */;
f1
5
@ -435,18 +462,25 @@ f3
100
drop trigger trg17;
drop table t27,t37;
connection master;
drop table t17;
connection slave;
connection master;
-------------------
6
-------------------
connection master;
drop table if exists t16;
connection slave;
drop table if exists t26,t36;
connection master;
create table t16 (f1 int) /* 2 replicate */;
insert into t16 values (-5);
insert into t16 values (-4);
insert into t16 values (-3);
insert into t16 values (-2);
insert into t16 values (-1);
connection slave;
select * from t16;
f1
-5
@ -486,11 +520,13 @@ f1
SELECT * from t36 /* must be f3 5*100 */;
f3
500
connection master;
UPDATE t16 SET f1=5 where f1=-5;
UPDATE t16 SET f1=4 where f1=-4;
UPDATE t16 SET f1=3 where f1=-3;
UPDATE t16 SET f1=2 where f1=-2;
UPDATE t16 SET f1=1 where f1=-1;
connection slave;
SELECT * from t16 /* must be f1 5 ... 1 */;
f1
5
@ -507,18 +543,25 @@ f3
100
drop trigger trg16;
drop table t26,t36;
connection master;
drop table t16;
connection slave;
connection master;
-------------------
5
-------------------
connection master;
drop table if exists t15;
connection slave;
drop table if exists t25,t35;
connection master;
create table t15 (f1 int) /* 2 replicate */;
insert into t15 values (-5);
insert into t15 values (-4);
insert into t15 values (-3);
insert into t15 values (-2);
insert into t15 values (-1);
connection slave;
select * from t15;
f1
-5
@ -558,11 +601,13 @@ f1
SELECT * from t35 /* must be f3 5*100 */;
f3
500
connection master;
UPDATE t15 SET f1=5 where f1=-5;
UPDATE t15 SET f1=4 where f1=-4;
UPDATE t15 SET f1=3 where f1=-3;
UPDATE t15 SET f1=2 where f1=-2;
UPDATE t15 SET f1=1 where f1=-1;
connection slave;
SELECT * from t15 /* must be f1 5 ... 1 */;
f1
5
@ -579,18 +624,25 @@ f3
100
drop trigger trg15;
drop table t25,t35;
connection master;
drop table t15;
connection slave;
connection master;
-------------------
4
-------------------
connection master;
drop table if exists t14;
connection slave;
drop table if exists t24,t34;
connection master;
create table t14 (f1 int) /* 2 replicate */;
insert into t14 values (-5);
insert into t14 values (-4);
insert into t14 values (-3);
insert into t14 values (-2);
insert into t14 values (-1);
connection slave;
select * from t14;
f1
-5
@ -630,11 +682,13 @@ f1
SELECT * from t34 /* must be f3 5*100 */;
f3
500
connection master;
UPDATE t14 SET f1=5 where f1=-5;
UPDATE t14 SET f1=4 where f1=-4;
UPDATE t14 SET f1=3 where f1=-3;
UPDATE t14 SET f1=2 where f1=-2;
UPDATE t14 SET f1=1 where f1=-1;
connection slave;
SELECT * from t14 /* must be f1 5 ... 1 */;
f1
5
@ -651,18 +705,25 @@ f3
100
drop trigger trg14;
drop table t24,t34;
connection master;
drop table t14;
connection slave;
connection master;
-------------------
3
-------------------
connection master;
drop table if exists t13;
connection slave;
drop table if exists t23,t33;
connection master;
create table t13 (f1 int) /* 2 replicate */;
insert into t13 values (-5);
insert into t13 values (-4);
insert into t13 values (-3);
insert into t13 values (-2);
insert into t13 values (-1);
connection slave;
select * from t13;
f1
-5
@ -702,11 +763,13 @@ f1
SELECT * from t33 /* must be f3 5*100 */;
f3
500
connection master;
UPDATE t13 SET f1=5 where f1=-5;
UPDATE t13 SET f1=4 where f1=-4;
UPDATE t13 SET f1=3 where f1=-3;
UPDATE t13 SET f1=2 where f1=-2;
UPDATE t13 SET f1=1 where f1=-1;
connection slave;
SELECT * from t13 /* must be f1 5 ... 1 */;
f1
5
@ -723,18 +786,25 @@ f3
100
drop trigger trg13;
drop table t23,t33;
connection master;
drop table t13;
connection slave;
connection master;
-------------------
2
-------------------
connection master;
drop table if exists t12;
connection slave;
drop table if exists t22,t32;
connection master;
create table t12 (f1 int) /* 2 replicate */;
insert into t12 values (-5);
insert into t12 values (-4);
insert into t12 values (-3);
insert into t12 values (-2);
insert into t12 values (-1);
connection slave;
select * from t12;
f1
-5
@ -774,11 +844,13 @@ f1
SELECT * from t32 /* must be f3 5*100 */;
f3
500
connection master;
UPDATE t12 SET f1=5 where f1=-5;
UPDATE t12 SET f1=4 where f1=-4;
UPDATE t12 SET f1=3 where f1=-3;
UPDATE t12 SET f1=2 where f1=-2;
UPDATE t12 SET f1=1 where f1=-1;
connection slave;
SELECT * from t12 /* must be f1 5 ... 1 */;
f1
5
@ -795,18 +867,25 @@ f3
100
drop trigger trg12;
drop table t22,t32;
connection master;
drop table t12;
connection slave;
connection master;
-------------------
1
-------------------
connection master;
drop table if exists t11;
connection slave;
drop table if exists t21,t31;
connection master;
create table t11 (f1 int) /* 2 replicate */;
insert into t11 values (-5);
insert into t11 values (-4);
insert into t11 values (-3);
insert into t11 values (-2);
insert into t11 values (-1);
connection slave;
select * from t11;
f1
-5
@ -846,11 +925,13 @@ f1
SELECT * from t31 /* must be f3 5*100 */;
f3
500
connection master;
UPDATE t11 SET f1=5 where f1=-5;
UPDATE t11 SET f1=4 where f1=-4;
UPDATE t11 SET f1=3 where f1=-3;
UPDATE t11 SET f1=2 where f1=-2;
UPDATE t11 SET f1=1 where f1=-1;
connection slave;
SELECT * from t11 /* must be f1 5 ... 1 */;
f1
5
@ -867,11 +948,20 @@ f3
100
drop trigger trg11;
drop table t21,t31;
connection master;
drop table t11;
STOP SLAVE;
connection slave;
connection master;
connection slave;
include/stop_slave.inc
connection master;
FLUSH LOGS;
include/rpl_stop_server.inc [server_number=1]
include/rpl_start_server.inc [server_number=1]
--> Master binlog: Server ver: 5.0.16-debug-log, Binlog ver: 4
connection slave;
RESET SLAVE;
START SLAVE;
include/start_slave.inc
SELECT MASTER_POS_WAIT('master-bin.000001', 513) >= 0;
MASTER_POS_WAIT('master-bin.000001', 513) >= 0
1
@ -881,7 +971,7 @@ t1
t2
SHOW TRIGGERS;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
trg1 INSERT t1 INSERT INTO t2 VALUES(CURRENT_USER()) AFTER NULL latin1 latin1_swedish_ci latin1_swedish_ci
trg1 INSERT t1 INSERT INTO t2 VALUES(CURRENT_USER()) AFTER # latin1 latin1_swedish_ci latin1_swedish_ci
SELECT * FROM t1;
c
1
@ -900,25 +990,28 @@ root@localhost
DROP TRIGGER trg1;
DROP TABLE t1;
DROP TABLE t2;
STOP SLAVE;
include/stop_slave.inc
RESET SLAVE;
connection master;
SHOW TABLES LIKE 't_';
Tables_in_test (t_)
SHOW TRIGGERS;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
RESET MASTER;
START SLAVE;
connection slave;
include/start_slave.inc
---> Test for BUG#20438
---> Preparing environment...
---> connection: master
connection master;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
---> Synchronizing slave with master...
connection slave;
---> connection: master
connection master;
---> Creating objects...
CREATE TABLE t1(c INT);
@ -939,7 +1032,7 @@ c
10
---> Synchronizing slave with master...
---> connection: master
connection slave;
---> Checking on slave...
SELECT * FROM t1;
@ -949,11 +1042,14 @@ SELECT * FROM t2;
c
10
---> connection: master
connection master;
---> Cleaning up...
DROP TABLE t1;
DROP TABLE t2;
connection slave;
connection master;
connection master;
drop table if exists t1;
create table t1(a int, b varchar(50));
drop trigger not_a_trigger;
@ -975,11 +1071,15 @@ a b
1 In trigger t1_bi
2 b
3 c
connection slave;
select * from t1;
a b
1 In trigger t1_bi
2 b
3 c
connection master;
drop table if exists t1,t11;
Warnings:
Note 1051 Unknown table 't11'
Note 1051 Unknown table 'test.t11'
connection slave;
include/rpl_end.inc

View File

@ -1,22 +1,26 @@
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;
include/master-slave.inc
[connection master]
create temporary table t1 (n int);
insert into t1 values(1);
connection slave;
show status like 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 1
connection master;
delete from t1;
connection slave;
show status like 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 1
connection master;
truncate t1;
connection slave;
show status like 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 1
disconnect master;
connection slave;
show status like 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 0
include/rpl_end.inc

View File

@ -1,10 +1,8 @@
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;
include/master-slave.inc
[connection master]
connection slave;
reset master;
connection master;
create table t1(n char(30));
set @i1:=12345678901234, @i2:=-12345678901234, @i3:=0, @i4:=-1;
set @s1:='This is a test', @r1:=12.5, @r2:=-12.5;
@ -23,6 +21,7 @@ set @a:=5;
insert into t1 values (@a),(@a);
select * from t1 where n = '<nonexistant>';
n
connection master1;
insert into t1 values (@a),(@a),(@a*5);
SELECT * FROM t1 ORDER BY n;
n
@ -51,6 +50,7 @@ abcn1
abcn1n2
abc\def
This is a test
connection slave;
SELECT * FROM t1 ORDER BY n;
n
NULL
@ -78,6 +78,235 @@ abcn1
abcn1n2
abc\def
This is a test
connection master;
insert into t1 select * FROM (select @var1 union select @var2) AS t2;
drop table t1;
stop slave;
End of 4.1 tests.
DROP TABLE IF EXISTS t20;
DROP TABLE IF EXISTS t21;
DROP PROCEDURE IF EXISTS test.insert;
CREATE TABLE t20 (a VARCHAR(20));
CREATE TABLE t21 (a VARCHAR(20));
CREATE PROCEDURE test.insert()
BEGIN
IF (@VAR)
THEN
INSERT INTO test.t20 VALUES ('SP_TRUE');
ELSE
INSERT INTO test.t20 VALUES ('SP_FALSE');
END IF;
END|
CREATE TRIGGER test.insert_bi BEFORE INSERT
ON test.t20 FOR EACH ROW
BEGIN
IF (@VAR)
THEN
INSERT INTO test.t21 VALUES ('TRIG_TRUE');
ELSE
INSERT INTO test.t21 VALUES ('TRIG_FALSE');
END IF;
END|
connection slave;
connection master;
SET @VAR=0;
CALL test.insert();
SET @VAR=1;
CALL test.insert();
Check the tables for correct data
SELECT * FROM t20;
a
SP_FALSE
SP_TRUE
SELECT * FROM t21;
a
TRIG_FALSE
TRIG_TRUE
connection slave;
Check the tables for correct data and it matches master
SELECT * FROM t20;
a
SP_FALSE
SP_TRUE
SELECT * FROM t21;
a
TRIG_FALSE
TRIG_TRUE
connection master;
DROP TABLE t20;
DROP TABLE t21;
DROP PROCEDURE test.insert;
DROP TABLE IF EXISTS t1;
DROP FUNCTION IF EXISTS test.square;
CREATE TABLE t1 (i INT);
CREATE FUNCTION test.square() RETURNS INTEGER DETERMINISTIC RETURN
(@var * @var);
SET @var = 1;
INSERT INTO t1 VALUES (square());
SET @var = 2;
INSERT INTO t1 VALUES (square());
SET @var = 3;
INSERT INTO t1 VALUES (square());
SET @var = 4;
INSERT INTO t1 VALUES (square());
SET @var = 5;
INSERT INTO t1 VALUES (square());
Retrieve the values from the table
SELECT * FROM t1;
i
1
4
9
16
25
connection slave;
Retrieve the values from the table and verify they are the same as on master
SELECT * FROM t1;
i
1
4
9
16
25
connection master;
DROP TABLE t1;
DROP FUNCTION test.square;
DROP TABLE IF EXISTS t1;
DROP FUNCTION IF EXISTS f1;
DROP FUNCTION IF EXISTS f2;
CREATE TABLE t1(a int);
CREATE FUNCTION f1() returns int deterministic BEGIN
return @a;
END |
CREATE FUNCTION f2() returns int deterministic BEGIN
IF (@b > 0) then
SET @c = (@a + @b);
else
SET @c = (@a - 1);
END if;
return @c;
END |
connection slave;
connection master;
SET @a=500;
INSERT INTO t1 values(f1());
SET @b = 125;
SET @c = 1;
INSERT INTO t1 values(f2());
Retrieve the values from the table
connection slave;
connection master;
SELECT * from t1;
a
500
625
connection slave;
Check the tables for correct data and it matches master
SELECT * from t1;
a
500
625
connection master;
DROP TABLE t1;
DROP FUNCTION f1;
DROP FUNCTION f2;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
CREATE TABLE t1 (i int);
CREATE TABLE t2 (k int);
CREATE trigger t1_bi before INSERT on t1 for each row BEGIN
INSERT INTO t2 values (@a);
SET @a:=42;
INSERT INTO t2 values (@a);
END |
connection slave;
connection master;
SET @a:=100;
INSERT INTO t1 values (5);
Check to see that data was inserted correctly in both tables
SELECT * from t1;
i
5
SELECT * from t2;
k
100
42
connection slave;
Check the tables for correct data and it matches master
SELECT * from t1;
i
5
SELECT * from t2;
k
100
42
connection master;
drop table t1, t2;
connection master;
create table t1(a int, b int);
prepare s1 from 'insert into t1 values (@x:=@x+1, ?)';
set @x=1;
execute s1 using @x;
select * from t1;
a b
2 1
connection slave;
connection slave;
select * from t1;
a b
2 1
connection master;
drop table t1;
connection master;
create table t1(a int);
insert into t1 values (1),(2);
prepare s1 from 'insert into t1 select a from t1 limit ?';
set @x='1.1';
execute s1 using @x;
select * from t1;
a
1
2
1
connection slave;
connection slave;
select * from t1;
a
1
2
1
connection master;
drop table t1;
End of 5.0 tests.
DROP FUNCTION IF EXISTS f1;
DROP FUNCTION IF EXISTS f2;
CREATE TABLE t1 (i INT);
CREATE FUNCTION f1() RETURNS INT RETURN @a;
CREATE
FUNCTION f2() RETURNS INT BEGIN
INSERT INTO t1 VALUES (10 + @a);
RETURN 0;
END|
connection slave;
connection master;
SET @a:=123;
SELECT f1(), f2();
f1() f2()
123 0
Check to see that data was inserted correctly
INSERT INTO t1 VALUES(f1());
SELECT * FROM t1;
i
133
123
connection slave;
Check the table for correct data and it matches master
SELECT * FROM t1;
i
133
123
connection master;
DROP FUNCTION f1;
DROP FUNCTION f2;
DROP TABLE t1;
connection slave;
include/rpl_end.inc

View File

@ -1,9 +1,5 @@
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;
include/master-slave.inc
[connection master]
set @my_slave_net_timeout =@@global.slave_net_timeout;
set @my_sql_slave_skip_counter =@@global.sql_slave_skip_counter;
set global slave_net_timeout=100;
@ -19,3 +15,4 @@ Variable_name Value
slave_skip_errors 3,100,137,643,1752
set global slave_net_timeout=@my_slave_net_timeout;
set global sql_slave_skip_counter=@my_sql_slave_skip_counter;
include/rpl_end.inc

View File

@ -1,12 +1,10 @@
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;
include/master-slave.inc
[connection master]
drop table if exists t1,v1;
drop view if exists t1,v1;
connection slave;
reset master;
connection master;
create table t1 (a int);
insert into t1 values (1);
create view v1 as select a from t1;
@ -15,45 +13,57 @@ select * from v1 order by a;
a
1
2
connection slave;
select * from v1 order by a;
a
1
2
connection master;
update v1 set a=3 where a=1;
select * from v1 order by a;
a
2
3
connection slave;
select * from v1 order by a;
a
2
3
connection master;
delete from v1 where a=2;
select * from v1 order by a;
a
3
connection slave;
select * from v1 order by a;
a
3
connection master;
alter view v1 as select a as b from t1;
connection slave;
select * from v1 order by 1;
b
3
connection master;
drop view v1;
connection slave;
select * from v1 order by a;
ERROR 42S02: Table 'test.v1' doesn't exist
connection master;
drop table t1;
connection slave;
---> Test for BUG#20438
---> Preparing environment...
---> connection: master
connection master;
DROP TABLE IF EXISTS t1;
DROP VIEW IF EXISTS v1;
---> Synchronizing slave with master...
connection slave;
---> connection: master
connection master;
---> Creating objects...
CREATE TABLE t1(c INT);
@ -68,21 +78,22 @@ c
1
---> Synchronizing slave with master...
---> connection: master
---> Checking on slave...
connection slave;
SELECT * FROM t1;
c
1
---> connection: master
connection master;
---> Cleaning up...
DROP VIEW v1;
DROP TABLE t1;
connection slave;
connection master;
connection master;
create table t1(a int, b int);
insert into t1 values (1, 1), (1, 2), (1, 3);
create view v1(a, b) as select a, sum(b) from t1 group by a;
connection slave;
explain v1;
Field Type Null Key Default Extra
a int(11) YES NULL
@ -93,6 +104,35 @@ v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
select * from v1;
a b
1 6
connection master;
drop table t1;
drop view v1;
connection slave;
connection master;
CREATE TABLE t1(a INT);
CREATE VIEW v1 AS SELECT * FROM t1;
CREATE VIEW v1 AS SELECT * FROM t1;
ERROR 42S01: Table 'v1' already exists
DROP VIEW v1;
DROP TABLE t1;
connection slave;
connection master;
CREATE TABLE t1 (a INT);
# create view as output from mysqldump 10.11 (5.0.62)
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`t1`.`a` < 3) */
/*!50002 WITH CASCADED CHECK OPTION */;
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where `t1`.`a` < 3 WITH CASCADED CHECK OPTION latin1 latin1_swedish_ci
connection slave;
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where `t1`.`a` < 3 WITH CASCADED CHECK OPTION latin1 latin1_swedish_ci
connection master;
DROP VIEW v1;
DROP TABLE t1;
connection slave;
End of 5.0 tests
include/rpl_end.inc

View File

@ -1 +0,0 @@
--disconnect-slave-event-count=2

View File

@ -1,19 +0,0 @@
# 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

View File

@ -1,17 +0,0 @@
source include/master-slave.inc;
create table t1 (n int);
insert into t1 values(1);
sync_slave_with_master;
stop slave;
start slave;
connection master;
insert into t1 values(2);
#let slave catch up
sync_slave_with_master;
select * from t1;
connection master;
drop table t1;
sync_slave_with_master;
# End of 4.1 tests

View File

@ -1,61 +0,0 @@
# This test is to verify that DROP TEMPORARY TABLE
# is automatically binlogged and sent to slave
# when a temp table is dropped by disconnection
# of a master's conection.
# So it does not apply to row-based, where we neither need
# nor do this automatic binlogging. And if we run this test
# in row-based, it hangs waiting for an offset which is never
# reached (the "sync_with_master 1"), logically.
--source include/have_binlog_format_mixed_or_statement.inc
source include/master-slave.inc;
save_master_pos;
connection slave;
sync_with_master;
connection master;
--disable_query_log
CALL mtr.add_suppression(" Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
--enable_query_log
create table t2(n int);
create temporary table t1 (n int);
insert into t1 values(1),(2),(3);
--disable_warnings
insert into t2 select * from t1;
--enable_warnings
connection master1;
create temporary table t1 (n int);
insert into t1 values (4),(5);
--disable_warnings
insert into t2 select * from t1 as t10;
--enable_warnings
save_master_pos;
disconnect master;
connection slave;
#add 1 to catch drop table
sync_with_master 1;
connection master1;
insert into t2 values(6);
save_master_pos;
disconnect master1;
connection slave;
# same trick to go one more event
sync_with_master 1;
select * from t2;
show status like 'Slave_open_temp_tables';
#
# Clean up
#
connect (master2,localhost,root,,);
connection master2;
# We will get a warning for t1 as this is a temporary table that doesn't
# exist in this connection.
drop table if exists t1,t2;
save_master_pos;
connection slave;
sync_with_master;
# End of 4.1 tests

View File

@ -1 +0,0 @@
--skip-slave-start

View File

@ -0,0 +1,2 @@
--source suite/rpl/t/rpl_000010.test

View File

@ -0,0 +1,18 @@
--source include/master-slave.inc
create table t1 (n int);
insert into t1 values(1);
--sync_slave_with_master
--source include/stop_slave.inc
--source include/start_slave.inc
connection master;
insert into t1 values(2);
#let slave catch up
--sync_slave_with_master
select * from t1;
connection master;
drop table t1;
--sync_slave_with_master
# End of 4.1 tests
--source include/rpl_end.inc

Some files were not shown because too many files have changed in this diff Show More