summaryrefslogtreecommitdiff
path: root/mysql-test/suite/sys_vars
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2020-10-30 17:23:53 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2020-10-30 17:23:53 +0100
commit794f66513967891520ec432123dcff8270871b93 (patch)
treeda31ab80611c016e9dca9af28ffd65c4a838e2f5 /mysql-test/suite/sys_vars
parent14d43f4fa691e3af113195a3608f1fc401b85090 (diff)
parent72eea39d4c4a8bcadccfdac457e61abc7b618ff8 (diff)
downloadmariadb-git-794f66513967891520ec432123dcff8270871b93.tar.gz
Merge branch '10.2' into 10.3
Diffstat (limited to 'mysql-test/suite/sys_vars')
-rw-r--r--mysql-test/suite/sys_vars/r/div_precision_increment_func.result16
-rw-r--r--mysql-test/suite/sys_vars/r/replicate_do_db_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/rpl_init_slave_func.result16
-rw-r--r--mysql-test/suite/sys_vars/t/replicate_do_db_basic.test3
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_init_slave_func.test32
5 files changed, 37 insertions, 34 deletions
diff --git a/mysql-test/suite/sys_vars/r/div_precision_increment_func.result b/mysql-test/suite/sys_vars/r/div_precision_increment_func.result
index e16ce76fed9..c839dd6b289 100644
--- a/mysql-test/suite/sys_vars/r/div_precision_increment_func.result
+++ b/mysql-test/suite/sys_vars/r/div_precision_increment_func.result
@@ -51,9 +51,9 @@ INSERT into t1(name, salary, income_tax) values('Record_2', 501, 501*2.5/1000);
INSERT into t1(name, salary, income_tax) values('Record_3', 210, 210*2.5/1000);
SELECT * from t1;
id name salary income_tax
-1 Record_1 100011 250.03
-2 Record_2 501 1.25
-3 Record_3 210 0.53
+1 Record_1 100011 250.027
+2 Record_2 501 1.2525
+3 Record_3 210 0.525
connect test_con2, localhost, root,,;
connection test_con2;
## Verifying session & global value of variable ##
@@ -69,11 +69,11 @@ INSERT into t1(name, salary, income_tax) values('Record_5', 501, 501*2.5/1000);
INSERT into t1(name, salary, income_tax) values('Record_6', 210, 210*2.5/1000);
SELECT * from t1;
id name salary income_tax
-1 Record_1 100011 250.03
-2 Record_2 501 1.25
-3 Record_3 210 0.53
-4 Record_4 100011 250.028
-5 Record_5 501 1.253
+1 Record_1 100011 250.027
+2 Record_2 501 1.2525
+3 Record_3 210 0.525
+4 Record_4 100011 250.027
+5 Record_5 501 1.2525
6 Record_6 210 0.525
## Dropping table t1 ##
drop table t1;
diff --git a/mysql-test/suite/sys_vars/r/replicate_do_db_basic.result b/mysql-test/suite/sys_vars/r/replicate_do_db_basic.result
index a05b85a9bfd..54adf835962 100644
--- a/mysql-test/suite/sys_vars/r/replicate_do_db_basic.result
+++ b/mysql-test/suite/sys_vars/r/replicate_do_db_basic.result
@@ -37,5 +37,9 @@ SET @@GLOBAL.replicate_do_db=null;
SELECT @@GLOBAL.replicate_do_db;
@@GLOBAL.replicate_do_db
+SET @@GLOBAL.replicate_do_db=DEFAULT;
+SELECT @@GLOBAL.replicate_do_db;
+@@GLOBAL.replicate_do_db
+
# Cleanup.
SET @@GLOBAL.replicate_do_db = @save_replicate_do_db;
diff --git a/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result b/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result
index ec3b39124fe..249d745482a 100644
--- a/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result
+++ b/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result
@@ -1,6 +1,6 @@
include/master-slave.inc
[connection master]
-connection slave;
+include/sync_slave_sql_with_master.inc
SET @start_max_connections= @@global.max_connections;
SET @start_init_slave= @@global.init_slave;
SET NAMES utf8;
@@ -19,18 +19,12 @@ SELECT @@global.init_slave = 'SET @@global.max_connections = @@global.max_connec
1
Expect 1
include/assert.inc [@@global.max_connections = @start_max_connections]
-STOP SLAVE;
-RESET MASTER;
-RESET SLAVE;
-START SLAVE;
-include/wait_for_slave_to_start.inc
+include/restart_slave.inc
+connection master;
+include/sync_slave_sql_with_master.inc
include/assert.inc [@@global.max_connections = @start_max_connections + 1]
SET @@global.init_slave = "SET @a=5";
-STOP SLAVE;
-RESET MASTER;
-RESET SLAVE;
-START SLAVE;
-include/wait_for_slave_to_start.inc
+include/restart_slave.inc
SHOW VARIABLES LIKE 'init_slave';
Variable_name Value
init_slave SET @a=5
diff --git a/mysql-test/suite/sys_vars/t/replicate_do_db_basic.test b/mysql-test/suite/sys_vars/t/replicate_do_db_basic.test
index 59d0176add2..b7004d1938b 100644
--- a/mysql-test/suite/sys_vars/t/replicate_do_db_basic.test
+++ b/mysql-test/suite/sys_vars/t/replicate_do_db_basic.test
@@ -38,5 +38,8 @@ SELECT @@GLOBAL.replicate_do_db;
SET @@GLOBAL.replicate_do_db=null;
SELECT @@GLOBAL.replicate_do_db;
+SET @@GLOBAL.replicate_do_db=DEFAULT;
+SELECT @@GLOBAL.replicate_do_db;
+
--echo # Cleanup.
SET @@GLOBAL.replicate_do_db = @save_replicate_do_db;
diff --git a/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test b/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test
index f8cbc54fc70..0e5ff7a3f39 100644
--- a/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test
+++ b/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test
@@ -29,7 +29,13 @@
###############################################################################
source include/master-slave.inc;
-connection slave;
+
+# Since a part of slave SQL thread initialisation happens after Slave_SQL_Running
+# has been set to Yes, there is a race condition between initialisation above and
+# init_slave setting given below. Synchronise slave applier with master to ensure
+# init_slave is complete and applier had processed few events like FD.
+--source include/sync_slave_sql_with_master.inc
+
--disable_query_log
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
--enable_query_log
@@ -66,14 +72,15 @@ let $wait_condition= SELECT @@global.max_connections = @start_max_connections;
--let $assert_text= @@global.max_connections = @start_max_connections
--let $assert_cond= @@global.max_connections = @start_max_connections
--source include/assert.inc
-#
-# reset of the server
-STOP SLAVE;
---wait_for_slave_to_stop
-RESET MASTER;
-RESET SLAVE;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+
+--source include/restart_slave_sql.inc
+
+# Upon slave start, sync the applier with master, to ensure slave has
+# completed init_slave command execution and processed FD event from the
+# master.
+--connection master
+--source include/sync_slave_sql_with_master.inc
+
#
# wait for the slave threads have set the global variable.
let $wait_timeout= 90;
@@ -87,12 +94,7 @@ let $wait_condition= SELECT @@global.max_connections = @start_max_connections +
# Setting a variable(which is local to a session) and must not be visible
SET @@global.init_slave = "SET @a=5";
#
-STOP SLAVE;
---wait_for_slave_to_stop
-RESET MASTER;
-RESET SLAVE;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+--source include/restart_slave_sql.inc
#
SHOW VARIABLES LIKE 'init_slave';
# expect NULL