Commit 00528a04 authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.5 into 10.6

parents dbe941e0 233c0913
......@@ -4,24 +4,19 @@ organization registered in the USA.
The current main sponsors of the MariaDB Foundation are:
Alibaba Cloud https://www.alibabacloud.com/ (2017)
Booking.com https://www.booking.com (2013)
MariaDB Corporation https://www.mariadb.com (2013)
Microsoft https://microsoft.com/ (2017)
ServiceNow https://servicenow.com (2019)
Tencent Cloud https://cloud.tencent.com (2017)
Development Bank of Singapore https://dbs.com (2016)
IBM https://www.ibm.com (2017)
Tencent Games http://game.qq.com/ (2018)
Visma https://visma.com (2015)
Acronis https://acronis.com (2016)
Nexedi https://www.nexedi.com (2016)
Automattic https://automattic.com (2019)
Galera Cluster https://galeracluster.com (2020)
Percona https://www.percona.com (2018)
Tencent Game DBA http://tencentdba.com/about (2016)
Tencent TDSQL http://tdsql.org (2016)
Verkkokauppa.com https://www.verkkokauppa.com (2015)
Virtuozzo https://virtuozzo.com (2016)
For a full list of sponsors, see
https://mariadb.org/about/supporters/
https://mariadb.org/about/#sponsors
and for individual contributors, see
https://mariadb.org/donate/individual-sponsors/
......
......@@ -180,7 +180,7 @@ IF(WIN32)
MARK_AS_ADVANCED(SIGNCODE)
IF(SIGNCODE)
SET(SIGNTOOL_PARAMETERS
/a /t http://timestamp.globalsign.com/scripts/timstamp.dll
/a /t http://timestamp.globalsign.com/?signature=sha2
CACHE STRING "parameters for signtool (list)")
FIND_PROGRAM(SIGNTOOL_EXECUTABLE signtool
PATHS "$ENV{ProgramFiles}/Microsoft SDKs/Windows/v7.0A/bin"
......
......@@ -62,7 +62,6 @@ extern struct wsrep_service_st {
int (*wsrep_thd_retry_counter_func)(const MYSQL_THD thd);
bool (*wsrep_thd_ignore_table_func)(MYSQL_THD thd);
long long (*wsrep_thd_trx_seqno_func)(const MYSQL_THD thd);
void (*wsrep_thd_auto_increment_variables_func)(THD *thd, unsigned long long *offset, unsigned long long *increment);
my_bool (*wsrep_thd_is_aborting_func)(const MYSQL_THD thd);
void (*wsrep_set_data_home_dir_func)(const char *data_dir);
my_bool (*wsrep_thd_is_BF_func)(const MYSQL_THD thd, my_bool sync);
......@@ -115,7 +114,6 @@ extern struct wsrep_service_st {
#define wsrep_thd_retry_counter(T) wsrep_service->wsrep_thd_retry_counter_func(T)
#define wsrep_thd_ignore_table(T) wsrep_service->wsrep_thd_ignore_table_func(T)
#define wsrep_thd_trx_seqno(T) wsrep_service->wsrep_thd_trx_seqno_func(T)
#define wsrep_thd_auto_increment_variables(T,O,I) wsrep_service->wsrep_thd_auto_increment_variables_func(T,O,I)
#define wsrep_set_data_home_dir(A) wsrep_service->wsrep_set_data_home_dir_func(A)
#define wsrep_thd_is_BF(T,S) wsrep_service->wsrep_thd_is_BF_func(T,S)
#define wsrep_thd_is_aborting(T) wsrep_service->wsrep_thd_is_aborting_func(T)
......@@ -158,7 +156,6 @@ extern "C" long long wsrep_xid_seqno(const struct xid_t* xid);
const unsigned char* wsrep_xid_uuid(const struct xid_t* xid);
extern "C" long long wsrep_thd_trx_seqno(const MYSQL_THD thd);
my_bool get_wsrep_recovery();
void wsrep_thd_auto_increment_variables(THD *thd, unsigned long long *offset, unsigned long long *increment);
bool wsrep_thd_ignore_table(MYSQL_THD thd);
void wsrep_set_data_home_dir(const char *data_dir);
......
/* Copyright (c) 2009, 2010, Oracle and/or its affiliates.
Copyright (c) 2012, 2019, MariaDB
Copyright (c) 2012, 2021, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -41,6 +41,6 @@
#define VERSION_thd_specifics 0x0100
#define VERSION_thd_timezone 0x0100
#define VERSION_thd_wait 0x0100
#define VERSION_wsrep 0x0203
#define VERSION_wsrep 0x0500
#define VERSION_json 0x0100
#define VERSION_thd_mdl 0x0100
......@@ -4444,7 +4444,7 @@ order by a desc limit 3 )
(select a from t where a=4 union select a from t where a=7 order by a desc);
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 with t as ((select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3) union (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 3) order by `a` desc limit 3)select `t`.`a` AS `a` from `t` where `t`.`a` = 4 union select `t`.`a` AS `a` from ((select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3) union (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 3) order by `a` desc limit 3) `t` where `t`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as ((select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3) union (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 3) order by `a` desc limit 3)select `t`.`a` AS `a` from `t` where `t`.`a` = 4 union select `t`.`a` AS `a` from `t` where `t`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci
select * from v1;
a
7
......@@ -4508,7 +4508,7 @@ s as (select * from t where a > 3)
select a from t where a=1 union select a from s where a=7 order by a desc;
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 with t as (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3), s as (select `t`.`a` AS `a` from (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3) `t` where `t`.`a` > 3)select `t`.`a` AS `a` from `t` where `t`.`a` = 1 union select `s`.`a` AS `a` from `s` where `s`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS with t as (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3), s as (select `t`.`a` AS `a` from `t` where `t`.`a` > 3)select `t`.`a` AS `a` from `t` where `t`.`a` = 1 union select `s`.`a` AS `a` from `s` where `s`.`a` = 7 order by `a` desc latin1 latin1_swedish_ci
select * from v1;
a
1
......
SHOW CONTRIBUTORS;
Name Location Comment
Booking.com https://www.booking.com Founding member, Platinum Sponsor of the MariaDB Foundation
Alibaba Cloud https://www.alibabacloud.com/ Platinum Sponsor of the MariaDB Foundation
Tencent Cloud https://cloud.tencent.com Platinum Sponsor of the MariaDB Foundation
Microsoft https://microsoft.com/ Platinum Sponsor of the MariaDB Foundation
MariaDB Corporation https://mariadb.com Founding member, Platinum Sponsor of the MariaDB Foundation
ServiceNow https://servicenow.com Platinum Sponsor of the MariaDB Foundation
Visma https://visma.com Gold Sponsor of the MariaDB Foundation
DBS https://dbs.com Gold Sponsor of the MariaDB Foundation
IBM https://www.ibm.com Gold Sponsor of the MariaDB Foundation
Tencent Games http://game.qq.com/ Gold Sponsor of the MariaDB Foundation
Nexedi https://www.nexedi.com Silver Sponsor of the MariaDB Foundation
Acronis https://www.acronis.com Silver Sponsor of the MariaDB Foundation
Verkkokauppa.com https://www.verkkokauppa.com Bronze Sponsor of the MariaDB Foundation
Virtuozzo https://virtuozzo.com Bronze Sponsor of the MariaDB Foundation
Tencent Game DBA http://tencentdba.com/about Bronze Sponsor of the MariaDB Foundation
Tencent TDSQL http://tdsql.org Bronze Sponsor of the MariaDB Foundation
Percona https://www.percona.com/ Bronze Sponsor of the MariaDB Foundation
Automattic https://automattic.com Silver Sponsor of the MariaDB Foundation
Percona https://www.percona.com/ Sponsor of the MariaDB Foundation
Galera Cluster https://galeracluster.com Sponsor of the MariaDB Foundation
Google USA Sponsoring encryption, parallel replication and GTID
Facebook USA Sponsoring non-blocking API, LIMIT ROWS EXAMINED etc
Ronald Bradford Brisbane, Australia EFF contribution for UC2006 Auction
......
......@@ -618,7 +618,7 @@ with t(c) as (select a from t1 where b >= 'c')
select * from t r1, t r2 where r1.c=r2.c and r2.c=4;
show create view v4;
View Create View character_set_client collation_connection
v4 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS with t(`c`) as (select `test`.`t1`.`a` AS `c` from `test`.`t1` where `test`.`t1`.`b` >= 'c')select `r1`.`c` AS `c`,`r2`.`c` AS `d` from (`t` `r1` join (select `test`.`t1`.`a` AS `c` from `test`.`t1` where `test`.`t1`.`b` >= 'c') `r2`) where `r1`.`c` = `r2`.`c` and `r2`.`c` = 4 latin1 latin1_swedish_ci
v4 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS with t(`c`) as (select `test`.`t1`.`a` AS `c` from `test`.`t1` where `test`.`t1`.`b` >= 'c')select `r1`.`c` AS `c`,`r2`.`c` AS `d` from (`t` `r1` join `t` `r2`) where `r1`.`c` = `r2`.`c` and `r2`.`c` = 4 latin1 latin1_swedish_ci
select * from v4;
c d
4 4
......@@ -1126,7 +1126,7 @@ NULL UNION RESULT <union4,5> ALL NULL NULL NULL NULL NULL NULL
NULL UNION RESULT <union11,12> ALL NULL NULL NULL NULL NULL NULL
NULL UNION RESULT <union1,6> ALL NULL NULL NULL NULL NULL NULL
Warnings:
Note 1003 with cte_e as (with cte_o as (with cte_i as (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 7)select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 1)select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3 and `test`.`t1`.`a` > 1 and `test`.`t1`.`a` < 7 and `test`.`t1`.`a` > 1 union select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 4 and `test`.`t1`.`a` > 1 and `test`.`t1`.`a` < 7 and `test`.`t1`.`a` > 1)select `cte_e1`.`a` AS `a` from `cte_e` `cte_e1` where `cte_e1`.`a` > 1 union select `cte_e2`.`a` AS `a` from (with cte_o as (with cte_i as (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 7)select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 1)select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3 and `test`.`t1`.`a` > 1 and `test`.`t1`.`a` < 7 union select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 4 and `test`.`t1`.`a` > 1 and `test`.`t1`.`a` < 7) `cte_e2`
Note 1003 with cte_e as (with cte_o as (with cte_i as (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 7)select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 1)select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3 and `test`.`t1`.`a` > 1 and `test`.`t1`.`a` < 7 and `test`.`t1`.`a` > 1 union select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 4 and `test`.`t1`.`a` > 1 and `test`.`t1`.`a` < 7 and `test`.`t1`.`a` > 1)select `cte_e1`.`a` AS `a` from `cte_e` `cte_e1` where `cte_e1`.`a` > 1 union select `cte_e2`.`a` AS `a` from `cte_e` `cte_e2`
drop table t1;
#
# MDEV-13753: embedded CTE in a VIEW created in prepared statement
......@@ -1725,6 +1725,44 @@ drop table db1.t1;
drop database db1;
create database test;
use test;
#
# MDEV-24597: CTE with union used multiple times in query
#
with cte(a) as
(select 1 as d union select 2 as d)
select a from cte as r1
union
select a from cte as r2;
a
1
2
create table t1 (a int, b int) engine=myisam;
insert into t1 values
(3,30), (7,70), (1,10), (7,71), (2,20), (7,72), (3,33), (4,44),
(5,50), (4,40), (3,33), (4,42), (4,43), (5,51);
with cte(c) as
(select a from t1 where b < 30 union select a from t1 where b > 40)
select * from cte as r1, cte as r2 where r1.c = r2.c;
c c
1 1
2 2
7 7
4 4
5 5
with cte(a,c) as
(
select a, count(*) from t1 group by a having count(*) = 1
union
select a, count(*) from t1 group by a having count(*) = 3
)
select a, c from cte as r1 where a < 3
union
select a, c from cte as r2 where a > 4;
a c
1 1
2 1
7 3
drop table t1;
# End of 10.2 tests
#
# MDEV-21673: several references to CTE that uses
......
......@@ -1242,6 +1242,37 @@ drop database db1;
create database test;
use test;
--echo #
--echo # MDEV-24597: CTE with union used multiple times in query
--echo #
with cte(a) as
(select 1 as d union select 2 as d)
select a from cte as r1
union
select a from cte as r2;
create table t1 (a int, b int) engine=myisam;
insert into t1 values
(3,30), (7,70), (1,10), (7,71), (2,20), (7,72), (3,33), (4,44),
(5,50), (4,40), (3,33), (4,42), (4,43), (5,51);
with cte(c) as
(select a from t1 where b < 30 union select a from t1 where b > 40)
select * from cte as r1, cte as r2 where r1.c = r2.c;
with cte(a,c) as
(
select a, count(*) from t1 group by a having count(*) = 1
union
select a, count(*) from t1 group by a having count(*) = 3
)
select a, c from cte as r1 where a < 3
union
select a, c from cte as r2 where a > 4;
drop table t1;
--echo # End of 10.2 tests
--echo #
......
......@@ -6069,6 +6069,63 @@ f2
drop table t1, t2;
set join_buffer_size=@save_join_buffer_size;
#
# MDEV-21104: BNLH used for multi-join query with embedded outer join
# and possible 'not exists' optimization
#
set join_cache_level=4;
CREATE TABLE t1 (a int) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (b int, c int) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1,2),(2,4);
CREATE TABLE t3 (d int, KEY(d)) ENGINE=MyISAM;
INSERT INTO t3 VALUES (1),(2);
CREATE TABLE t4 (e int primary key) ENGINE=MyISAM;
INSERT INTO t4 VALUES (1),(2);
ANALYZE TABLE t1,t2,t3,t4;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
test.t2 analyze status Engine-independent statistics collected
test.t2 analyze status OK
test.t3 analyze status Engine-independent statistics collected
test.t3 analyze status OK
test.t4 analyze status Engine-independent statistics collected
test.t4 analyze status OK
SELECT * FROM t2 LEFT JOIN t3 ON c = d;
b c d
1 2 2
2 4 NULL
SELECT * FROM (t2 LEFT JOIN t3 ON c = d ) JOIN t4;
b c d e
1 2 2 1
2 4 NULL 1
1 2 2 2
2 4 NULL 2
EXPLAIN SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN t3 ON c = d ) JOIN t4 ) ON b = e;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t3 hash_index d #hash#d:d 5:5 test.t2.c 2 Using where; Using index; Using join buffer (incremental, BNLH join)
1 SIMPLE t4 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t2.b 2 Using index; Using join buffer (incremental, BNLH join)
SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN t3 ON c = d ) JOIN t4 ) ON b = e;
a b c d e
1 1 2 2 1
2 1 2 2 1
1 2 4 NULL 2
2 2 4 NULL 2
EXPLAIN SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN t3 ON c = d ) JOIN t4 ) ON b = e
WHERE e IS NULL;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t3 hash_index d #hash#d:d 5:5 test.t2.c 2 Using where; Using index; Using join buffer (incremental, BNLH join)
1 SIMPLE t4 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t2.b 2 Using where; Using index; Not exists; Using join buffer (incremental, BNLH join)
SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN t3 ON c = d ) JOIN t4 ) ON b = e
WHERE e IS NULL;
a b c d e
DROP TABLE t1,t2,t3,t4;
set join_cache_level=@save_join_cache_level;
#
# MDEV-21243: Join buffer: condition is checked in wrong place for range access
#
create table t1(a int primary key);
......@@ -6141,6 +6198,7 @@ EXPLAIN
}
}
drop table t1,t2,t3;
# End of 10.3 tests
set @@optimizer_switch=@save_optimizer_switch;
set global innodb_stats_persistent= @innodb_stats_persistent_save;
set global innodb_stats_persistent_sample_pages=
......
......@@ -4070,6 +4070,41 @@ drop table t1, t2;
set join_buffer_size=@save_join_buffer_size;
--echo #
--echo # MDEV-21104: BNLH used for multi-join query with embedded outer join
--echo # and possible 'not exists' optimization
--echo #
set join_cache_level=4;
CREATE TABLE t1 (a int) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (b int, c int) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1,2),(2,4);
CREATE TABLE t3 (d int, KEY(d)) ENGINE=MyISAM;
INSERT INTO t3 VALUES (1),(2);
CREATE TABLE t4 (e int primary key) ENGINE=MyISAM;
INSERT INTO t4 VALUES (1),(2);
ANALYZE TABLE t1,t2,t3,t4;
SELECT * FROM t2 LEFT JOIN t3 ON c = d;
SELECT * FROM (t2 LEFT JOIN t3 ON c = d ) JOIN t4;
let $q1=
SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN t3 ON c = d ) JOIN t4 ) ON b = e;
eval EXPLAIN $q1;
eval $q1;
let $q2=
SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN t3 ON c = d ) JOIN t4 ) ON b = e
WHERE e IS NULL;
eval EXPLAIN $q2;
eval $q2;
DROP TABLE t1,t2,t3,t4;
set join_cache_level=@save_join_cache_level;
--echo #
--echo # MDEV-21243: Join buffer: condition is checked in wrong place for range access
--echo #
......@@ -4109,6 +4144,7 @@ where
drop table t1,t2,t3;
--echo # End of 10.3 tests
# The following command must be the last one in the file
set @@optimizer_switch=@save_optimizer_switch;
......
......@@ -74,4 +74,12 @@ DROP TRIGGER trigg1;
DROP FUNCTION testQuestion;
DROP EVENT ev1;
DROP TABLE t1,t2;
End of 6.0 tests
#
# End of 5.5 tests
#
select variable_value < 1024*1024*1024 from information_schema.global_status where variable_name='memory_used';
variable_value < 1024*1024*1024
1
#
# End of 10.2 tests
#
......@@ -64,5 +64,14 @@ DROP TRIGGER trigg1;
DROP FUNCTION testQuestion;
DROP EVENT ev1;
DROP TABLE t1,t2;
--echo End of 6.0 tests
--echo #
--echo # End of 5.5 tests
--echo #
select variable_value < 1024*1024*1024 from information_schema.global_status where variable_name='memory_used';
--echo #
--echo # End of 10.2 tests
--echo #
......@@ -7342,6 +7342,44 @@ WHERE (t2.i, t2.pk) NOT IN ( SELECT t3.i, t3.i FROM t t3, t t4 ) AND t1.c = 'foo
pk i c pk i c
1 10 foo 1 10 foo
DROP TABLE t;
#
# MDEV-25002: Outer reference in ON clause of subselect
#
create table t1 (
pk int primary key,
a int
) engine=myisam;
insert into t1 values (1,1), (2,2);
create table t2 (
pk int primary key,
b int
) engine=myisam;
insert into t2 values (1,1), (2,3);
create table t3 (a int);
insert into t3 values (1),(2);
select a,
(select count(*) from t1, t2
where t2.pk=t3.a and t1.pk=1) as sq
from t3;
a sq
1 1
2 1
select a,
(select count(*) from t1 join t2 on t2.pk=t3.a
where t1.pk=1) as sq
from t3;
a sq
1 1
2 1
select a from t3
where a in (select t2.b from t1,t2 where t2.pk=t3.a and t1.pk=1);
a
1
select a from t3
where a in (select t2.b from t1 join t2 on t2.pk=t3.a where t1.pk=1);
a
1
drop table t1,t2,t3;
# End of 10.2 tests
#
# Start of 10.4 tests
......
......@@ -6169,6 +6169,41 @@ SELECT * FROM t t1 RIGHT JOIN t t2 ON (t2.pk = t1.pk)
DROP TABLE t;
--echo #
--echo # MDEV-25002: Outer reference in ON clause of subselect
--echo #
create table t1 (
pk int primary key,
a int
) engine=myisam;
insert into t1 values (1,1), (2,2);
create table t2 (
pk int primary key,
b int
) engine=myisam;
insert into t2 values (1,1), (2,3);
create table t3 (a int);
insert into t3 values (1),(2);
select a,
(select count(*) from t1, t2
where t2.pk=t3.a and t1.pk=1) as sq
from t3;
select a,
(select count(*) from t1 join t2 on t2.pk=t3.a
where t1.pk=1) as sq
from t3;
select a from t3
where a in (select t2.b from t1,t2 where t2.pk=t3.a and t1.pk=1);
select a from t3
where a in (select t2.b from t1 join t2 on t2.pk=t3.a where t1.pk=1);
drop table t1,t2,t3;
--echo # End of 10.2 tests
......
......@@ -2694,6 +2694,33 @@ INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4), (5,5);
SELECT a, b FROM t1 WHERE a IN (SELECT A.a FROM t1 A GROUP BY s.id);
ERROR 42S22: Unknown column 's.id' in 'group statement'
DROP TABLE t1;
#
# MDEV-24519: Server crashes in Charset::set_charset upon SELECT
#
CREATE TABLE t1 (a VARBINARY(8));
INSERT INTO t1 VALUES ('foo'),('bar');
CREATE TABLE t2 (b VARBINARY(8));
EXPLAIN
SELECT a FROM t1 WHERE (a, a) IN (SELECT 'qux', 'qux') AND a = (SELECT MIN(b) FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
SELECT a FROM t1 WHERE (a, a) IN (SELECT 'qux', 'qux') AND a = (SELECT MIN(b) FROM t2);
a
DROP TABLE t1,t2;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (b VARBINARY(8));
EXPLAIN
SELECT a FROM t1 WHERE (a, a) IN (SELECT 1, 2) AND a = (SELECT MIN(b) FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
SELECT a FROM t1 WHERE (a, a) IN (SELECT 1, 2) AND a = (SELECT MIN(b) FROM t2);
a
DROP TABLE t1,t2;
# End of 10.2 tests
#
# MDEV-18335: Assertion `!error || error == 137' failed in subselect_rowid_merge_engine::init
......
......@@ -2212,6 +2212,30 @@ INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4), (5,5);
SELECT a, b FROM t1 WHERE a IN (SELECT A.a FROM t1 A GROUP BY s.id);
DROP TABLE t1;
--echo #
--echo # MDEV-24519: Server crashes in Charset::set_charset upon SELECT
--echo #
CREATE TABLE t1 (a VARBINARY(8));
INSERT INTO t1 VALUES ('foo'),('bar');
CREATE TABLE t2 (b VARBINARY(8));
EXPLAIN
SELECT a FROM t1 WHERE (a, a) IN (SELECT 'qux', 'qux') AND a = (SELECT MIN(b) FROM t2);
SELECT a FROM t1 WHERE (a, a) IN (SELECT 'qux', 'qux') AND a = (SELECT MIN(b) FROM t2);
DROP TABLE t1,t2;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (b VARBINARY(8));
EXPLAIN
SELECT a FROM t1 WHERE (a, a) IN (SELECT 1, 2) AND a = (SELECT MIN(b) FROM t2);
SELECT a FROM t1 WHERE (a, a) IN (SELECT 1, 2) AND a = (SELECT MIN(b) FROM t2);
DROP TABLE t1,t2;
--echo # End of 10.2 tests
--echo #
......
......@@ -7342,6 +7342,44 @@ WHERE (t2.i, t2.pk) NOT IN ( SELECT t3.i, t3.i FROM t t3, t t4 ) AND t1.c = 'foo
pk i c pk i c
1 10 foo 1 10 foo
DROP TABLE t;
#
# MDEV-25002: Outer reference in ON clause of subselect
#
create table t1 (
pk int primary key,
a int
) engine=myisam;
insert into t1 values (1,1), (2,2);
create table t2 (
pk int primary key,
b int
) engine=myisam;
insert into t2 values (1,1), (2,3);
create table t3 (a int);
insert into t3 values (1),(2);
select a,
(select count(*) from t1, t2
where t2.pk=t3.a and t1.pk=1) as sq
from t3;
a sq
1 1
2 1
select a,
(select count(*) from t1 join t2 on t2.pk=t3.a
where t1.pk=1) as sq
from t3;
a sq
1 1
2 1
select a from t3
where a in (select t2.b from t1,t2 where t2.pk=t3.a and t1.pk=1);
a
1
select a from t3
where a in (select t2.b from t1 join t2 on t2.pk=t3.a where t1.pk=1);
a
1
drop table t1,t2,t3;
# End of 10.2 tests
#
# Start of 10.4 tests
......
......@@ -7335,6 +7335,44 @@ WHERE (t2.i, t2.pk) NOT IN ( SELECT t3.i, t3.i FROM t t3, t t4 ) AND t1.c = 'foo
pk i c pk i c
1 10 foo 1 10 foo
DROP TABLE t;
#
# MDEV-25002: Outer reference in ON clause of subselect
#
create table t1 (
pk int primary key,
a int
) engine=myisam;
insert into t1 values (1,1), (2,2);
create table t2 (
pk int primary key,
b int
) engine=myisam;
insert into t2 values (1,1), (2,3);
create table t3 (a int);
insert into t3 values (1),(2);
select a,
(select count(*) from t1, t2
where t2.pk=t3.a and t1.pk=1) as sq
from t3;
a sq
1 1
2 1
select a,
(select count(*) from t1 join t2 on t2.pk=t3.a
where t1.pk=1) as sq
from t3;
a sq
1 1
2 1
select a from t3
where a in (select t2.b from t1,t2 where t2.pk=t3.a and t1.pk=1);
a
1
select a from t3
where a in (select t2.b from t1 join t2 on t2.pk=t3.a where t1.pk=1);
a
1
drop table t1,t2,t3;
# End of 10.2 tests
#
# Start of 10.4 tests
......
......@@ -7333,6 +7333,44 @@ WHERE (t2.i, t2.pk) NOT IN ( SELECT t3.i, t3.i FROM t t3, t t4 ) AND t1.c = 'foo
pk i c pk i c
1 10 foo 1 10 foo
DROP TABLE t;
#
# MDEV-25002: Outer reference in ON clause of subselect
#
create table t1 (
pk int primary key,
a int
) engine=myisam;
insert into t1 values (1,1), (2,2);
create table t2 (
pk int primary key,
b int
) engine=myisam;
insert into t2 values (1,1), (2,3);
create table t3 (a int);
insert into t3 values (1),(2);
select a,
(select count(*) from t1, t2
where t2.pk=t3.a and t1.pk=1) as sq
from t3;
a sq
1 1
2 1
select a,
(select count(*) from t1 join t2 on t2.pk=t3.a
where t1.pk=1) as sq
from t3;
a sq
1 1
2 1
select a from t3
where a in (select t2.b from t1,t2 where t2.pk=t3.a and t1.pk=1);
a
1
select a from t3
where a in (select t2.b from t1 join t2 on t2.pk=t3.a where t1.pk=1);
a
1
drop table t1,t2,t3;
# End of 10.2 tests
#
# Start of 10.4 tests
......
......@@ -7348,6 +7348,44 @@ WHERE (t2.i, t2.pk) NOT IN ( SELECT t3.i, t3.i FROM t t3, t t4 ) AND t1.c = 'foo
pk i c pk i c
1 10 foo 1 10 foo
DROP TABLE t;
#
# MDEV-25002: Outer reference in ON clause of subselect
#
create table t1 (
pk int primary key,
a int
) engine=myisam;
insert into t1 values (1,1), (2,2);
create table t2 (
pk int primary key,
b int
) engine=myisam;
insert into t2 values (1,1), (2,3);
create table t3 (a int);
insert into t3 values (1),(2);
select a,
(select count(*) from t1, t2
where t2.pk=t3.a and t1.pk=1) as sq
from t3;
a sq
1 1
2 1
select a,
(select count(*) from t1 join t2 on t2.pk=t3.a
where t1.pk=1) as sq
from t3;
a sq
1 1
2 1
select a from t3
where a in (select t2.b from t1,t2 where t2.pk=t3.a and t1.pk=1);
a
1
select a from t3
where a in (select t2.b from t1 join t2 on t2.pk=t3.a where t1.pk=1);
a
1
drop table t1,t2,t3;
# End of 10.2 tests
#
# Start of 10.4 tests
......
......@@ -7333,6 +7333,44 @@ WHERE (t2.i, t2.pk) NOT IN ( SELECT t3.i, t3.i FROM t t3, t t4 ) AND t1.c = 'foo
pk i c pk i c
1 10 foo 1 10 foo
DROP TABLE t;
#
# MDEV-25002: Outer reference in ON clause of subselect
#
create table t1 (
pk int primary key,
a int
) engine=myisam;
insert into t1 values (1,1), (2,2);
create table t2 (
pk int primary key,
b int
) engine=myisam;
insert into t2 values (1,1), (2,3);
create table t3 (a int);
insert into t3 values (1),(2);
select a,
(select count(*) from t1, t2
where t2.pk=t3.a and t1.pk=1) as sq
from t3;
a sq
1 1
2 1
select a,
(select count(*) from t1 join t2 on t2.pk=t3.a
where t1.pk=1) as sq
from t3;
a sq
1 1
2 1
select a from t3
where a in (select t2.b from t1,t2 where t2.pk=t3.a and t1.pk=1);
a
1
select a from t3
where a in (select t2.b from t1 join t2 on t2.pk=t3.a where t1.pk=1);
a
1
drop table t1,t2,t3;
# End of 10.2 tests
#
# Start of 10.4 tests
......
# 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
......@@ -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;
......
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
stop slave;
grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab';
grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab';
start slave;
drop table if exists t1;
create table t1(n int);
insert into t1 values(24);
select * from t1;
n
24
drop table t1;
delete from mysql.user where user="replicate";
stop slave;
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
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);
insert into t1 values(1);
stop slave;
start slave;
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
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
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,19 @@ 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 optimistic
SQL_Delay 0
SQL_Remaining_Delay NULL
Slave_SQL_Running_State
Slave_DDL_Groups 0
Slave_Non_Transactional_Groups 0
Slave_Transactional_Groups 0
change master to master_host='127.0.0.1';
show slave status;
Slave_IO_State #
......@@ -93,6 +103,19 @@ 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 optimistic
SQL_Delay 0
SQL_Remaining_Delay NULL
Slave_SQL_Running_State
Slave_DDL_Groups 0
Slave_Non_Transactional_Groups 0
Slave_Transactional_Groups 0
change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=MASTER_PORT;
show slave status;
......@@ -136,7 +159,20 @@ 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 optimistic
SQL_Delay 0
SQL_Remaining_Delay NULL
Slave_SQL_Running_State
Slave_DDL_Groups 0
Slave_Non_Transactional_Groups 0
Slave_Transactional_Groups 0
include/start_slave.inc
show slave status;
Slave_IO_State Waiting for master to send event
Master_Host 127.0.0.1
......@@ -144,9 +180,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 +195,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 +214,34 @@ 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 optimistic
SQL_Delay 0
SQL_Remaining_Delay NULL
Slave_SQL_Running_State Slave has read all relay log; waiting for more updates
Slave_DDL_Groups 0
Slave_Non_Transactional_Groups 0
Slave_Transactional_Groups 0
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
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
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
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
SHOW SLAVE STATUS;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error
SHOW SLAVE HOSTS;
Server_id Host Port Rpl_recovery_rank Master_id
2 127.0.0.1 SLAVE_PORT 0 1
create table t1 ( n int);
insert into t1 values (1),(2),(3),(4);
insert into t1 values(5);
SELECT * FROM t1 ORDER BY n;
n
1
2
3
4
5
SELECT * FROM t1 ORDER BY n;
n
1
2
3
4
SELECT * FROM t1 ORDER BY n;
n
1
2
3
4
SELECT * FROM t1 ORDER BY n;
n
1
2
3
4
5
drop table t1;
@@ -29,7 +29,7 @@
`a` int(10) unsigned NOT NULL,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
insert into t1 (a) values (1),((1<<32)-1);
select * from t1;
a b
@@ -42,7 +42,7 @@
`a` bigint(20) NOT NULL,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
select * from t1;
a b
1 NULL
@@ -54,7 +54,7 @@
`a` int(10) unsigned NOT NULL,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
select * from t1;
a b
1 NULL
@@ -66,7 +66,7 @@
`a` bigint(20) unsigned NOT NULL,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
select * from t1;
a b
1 NULL
@@ -83,7 +83,7 @@
`a` bigint(20) unsigned NOT NULL,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
connection master;
create table t2 (a int unsigned auto_increment primary key, b int);
show create table t2;
@@ -92,7 +92,7 @@
`a` int(10) unsigned NOT NULL AUTO_INCREMENT,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
alter table t2 modify a bigint;
show create table t2;
Table Create Table
@@ -100,7 +100,7 @@
`a` bigint(20) NOT NULL,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
alter table t2 modify a bigint auto_increment;
show create table t2;
Table Create Table
@@ -108,7 +108,7 @@
`a` bigint(20) NOT NULL AUTO_INCREMENT,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1,t2;
#
# MDEV-8432: Slave cannot replicate signed integer-type values
stop slave;
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
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
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
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
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
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
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
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);
insert into mysqltest1.t1 values (1);
select * from mysqltest1.t1 into outfile 'mysqltest1/f1.txt';
Warnings:
Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
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 +32,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
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
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error
load table t1 from master;
ERROR 08S01: Error connecting to master: Master is not configured
load table t1 from master;
ERROR HY000: Error from master: 'Table 'test.t1' doesn't exist'
stop slave;
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
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,18 @@ 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 optimistic
SQL_Delay 0
SQL_Remaining_Delay NULL
Slave_SQL_Running_State Slave has read all relay log; waiting for more updates
Slave_DDL_Groups 0
Slave_Non_Transactional_Groups 0
Slave_Transactional_Groups 0
stop slave;
include/rpl_end.inc
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
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
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
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'
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
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
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 */;
select_priv
Select_priv
N
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
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
Select_priv
N
connection slave;
select select_priv from mysql.user where user='user_foo' /* slave:must get Y */;
select_priv
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
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
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
#
# 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
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
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
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
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
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
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
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;
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;
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;
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
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
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
select master_pos_wait('master-bin.999999',0,2);
master_pos_wait('master-bin.999999',0,2)
-1
explain extended select master_pos_wait('master-bin.999999',0,2);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select master_pos_wait('master-bin.999999',0,2) AS `master_pos_wait('master-bin.999999',0,2)`
select master_pos_wait('master-bin.999999',0);
stop slave sql_thread;
master_pos_wait('master-bin.999999',0)
NULL
stop slave;
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,52 @@ 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";
Warnings:
Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
connection master;
create temporary table t1_slave select * from t1 where 1=0;
load data infile '../../tmp/t1_slave.txt' into table t1_slave;
select count(*) into @aux from t1 join t1_slave using (id)
where ABS(t1.col_a - t1_slave.col_a) < 0.0000001 ;
SELECT @aux;
@aux
12
connection master;
DROP TABLE t1, t1_slave;
DROP PROCEDURE test_replication_sp1;
DROP PROCEDURE test_replication_sp2;
DROP FUNCTION test_replication_sf;
connection slave;
include/rpl_end.inc
stop slave;
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
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
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
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
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
**** On Master ****
CREATE TABLE t1 (a INT, b LONG);
INSERT INTO t1 VALUES (1,1), (2,2);
INSERT INTO t1 VALUES (3,UUID()), (4,UUID());
SHOW BINLOG EVENTS;
**** On Slave ****
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes
Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
Replicate_Ignore_Server_Ids
Master_Server_Id 1
SHOW BINLOG EVENTS;
DROP TABLE IF EXISTS t1;
stop slave;
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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;
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
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
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
......@@ -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
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
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 Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups
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 0 0 0
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;
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
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
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
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
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
This diff is collapsed.
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
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment