mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge branch '10.2' of github.com:MariaDB/server into 10.2-mariarocks
and a few trivial test result updates
This commit is contained in:
@@ -10,19 +10,19 @@
|
||||
#
|
||||
# Format_description_log_event length =
|
||||
# 19 /* event common header */ +
|
||||
# 58 /* misc stuff in the Format description header */ +
|
||||
# 57 /* misc stuff in the Format description header */ +
|
||||
# number of events +
|
||||
# 1 /* Checksum algorithm */ +
|
||||
# 4 /* CRC32 length */
|
||||
#
|
||||
# With current number of events = 164,
|
||||
# With current number of events = 171,
|
||||
#
|
||||
# binlog_start_pos = 4 + 19 + 57 + 163 + 1 + 4 = 249.
|
||||
# binlog_start_pos = 4 + 19 + 57 + 171 + 1 + 4 = 256.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
let $binlog_start_pos=249;
|
||||
--disable_query_log
|
||||
SET @binlog_start_pos=249;
|
||||
set @binlog_start_pos=256 + @@encrypt_binlog * (36 + (@@binlog_checksum != 'NONE') * 4);
|
||||
--enable_query_log
|
||||
let $binlog_start_pos=`select @binlog_start_pos`;
|
||||
|
||||
|
@@ -67,6 +67,9 @@ if ($tmp)
|
||||
--echo Replicate_Do_Domain_Ids
|
||||
--echo Replicate_Ignore_Domain_Ids
|
||||
--echo Parallel_Mode conservative
|
||||
--echo SQL_Delay 0
|
||||
--echo SQL_Remaining_Delay NULL
|
||||
--echo Slave_SQL_Running_State
|
||||
}
|
||||
if (!$tmp) {
|
||||
# Note: after WL#5177, fields 13-18 shall not be filtered-out.
|
||||
|
@@ -430,9 +430,9 @@ call p_verify_status_increment(2, 2, 2, 2);
|
||||
--echo # 4. Read-write statement: UPDATE, update 0 rows, 1 row matches WHERE
|
||||
--echo #
|
||||
update t1 set a=2;
|
||||
call p_verify_status_increment(2, 2, 1, 0);
|
||||
call p_verify_status_increment(2, 0, 1, 0);
|
||||
commit;
|
||||
call p_verify_status_increment(2, 2, 1, 0);
|
||||
call p_verify_status_increment(2, 0, 1, 0);
|
||||
|
||||
--echo # 5. Read-write statement: UPDATE, update 0 rows, 0 rows match WHERE
|
||||
--echo #
|
||||
|
24
mysql-test/include/func_str_ascii_checksum.inc
Normal file
24
mysql-test/include/func_str_ascii_checksum.inc
Normal file
@@ -0,0 +1,24 @@
|
||||
--echo # Start of func_str_ascii_checksum.inc
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-10850 Wrong result for WHERE .. (f2=TO_BASE64('test') OR f2=TO_BASE64('TEST'))
|
||||
--echo #
|
||||
|
||||
--eval CREATE TABLE t1 (f1 VARCHAR(4), f2 VARCHAR(255), UNIQUE KEY k1 (f1,f2))
|
||||
--eval INSERT INTO t1 VALUES ('test',$func('test')), ('TEST', $func('TEST'))
|
||||
--eval SELECT * FROM t1 IGNORE INDEX(k1) WHERE f1='test' AND (f2= $func("test") OR f2= $func("TEST"))
|
||||
--eval SELECT * FROM t1 WHERE f1='test' AND (f2= $func("test") OR f2= $func("TEST"))
|
||||
--eval SELECT * FROM t1 WHERE f1='test' AND (f2= $func("TEST") OR f2= $func("test"))
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-10425 Assertion `collation.derivation == DERIVATION_IMPLICIT' failed in Item_func_conv_charset::fix_length_and_dec()
|
||||
--echo #
|
||||
|
||||
--eval PREPARE stmt FROM "SELECT $func(CONVERT('foo' USING latin1))"
|
||||
EXECUTE stmt;
|
||||
DEALLOCATE PREPARE stmt;
|
||||
|
||||
|
||||
--echo # End of func_str_ascii_checksum.inc
|
@@ -9,9 +9,13 @@ innodb-locks
|
||||
innodb-buffer-pool-stats
|
||||
innodb-buffer-page
|
||||
innodb-buffer-page-lru
|
||||
innodb-sys-columns
|
||||
innodb-sys-fields
|
||||
innodb-sys-foreign
|
||||
innodb-sys-foreign-cols
|
||||
innodb-sys-indexes
|
||||
innodb-sys-tables
|
||||
innodb-sys-virtual
|
||||
innodb-metrics
|
||||
|
||||
[xtradb_plugin]
|
||||
@@ -43,3 +47,21 @@ innodb-buffer-page-lru
|
||||
innodb-sys-foreign
|
||||
innodb-sys-foreign-cols
|
||||
innodb-sys-tables
|
||||
|
||||
[innodb]
|
||||
innodb
|
||||
innodb-cmpmem
|
||||
innodb-cmp-per-index
|
||||
innodb-trx
|
||||
innodb-locks
|
||||
innodb-metrics
|
||||
innodb-buffer-pool-stats
|
||||
innodb-buffer-page
|
||||
innodb-buffer-page-lru
|
||||
innodb-sys-columns
|
||||
innodb-sys-fields
|
||||
innodb-sys-foreign
|
||||
innodb-sys-foreign-cols
|
||||
innodb-sys-indexes
|
||||
innodb-sys-tables
|
||||
innodb-sys-virtual
|
||||
|
9
mysql-test/include/have_numa.inc
Normal file
9
mysql-test/include/have_numa.inc
Normal file
@@ -0,0 +1,9 @@
|
||||
let $numa_support = `SELECT COUNT(VARIABLE_VALUE) = 1 FROM
|
||||
INFORMATION_SCHEMA.GLOBAL_VARIABLES
|
||||
WHERE VARIABLE_NAME='innodb_numa_interleave'`;
|
||||
|
||||
if ( $numa_support == 0 )
|
||||
{
|
||||
--skip Test requires: Binary must be built with NUMA support.
|
||||
}
|
||||
|
@@ -6,8 +6,8 @@ innodb-cmpmem
|
||||
innodb-trx
|
||||
innodb-sys-indexes
|
||||
|
||||
#[xtradb]
|
||||
#innodb
|
||||
#innodb-cmpmem
|
||||
#innodb-trx
|
||||
#innodb-sys-indexes
|
||||
[xtradb]
|
||||
innodb
|
||||
innodb-cmpmem
|
||||
innodb-trx
|
||||
innodb-sys-indexes
|
||||
|
@@ -341,6 +341,7 @@ while ($1)
|
||||
alter table t1 add index i2(key2);
|
||||
alter table t1 add index i3(key3);
|
||||
update t1 set key2=key1,key3=key1;
|
||||
analyze table t1;
|
||||
|
||||
# to test the bug, the following must use "sort_union":
|
||||
--replace_column 9 REF
|
||||
|
19
mysql-test/include/kill_and_restart_mysqld.inc
Normal file
19
mysql-test/include/kill_and_restart_mysqld.inc
Normal file
@@ -0,0 +1,19 @@
|
||||
--let $_server_id= `SELECT @@server_id`
|
||||
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
|
||||
|
||||
if ($restart_parameters)
|
||||
{
|
||||
--echo # Kill and restart: $restart_parameters
|
||||
--exec echo "restart: $restart_parameters" > $_expect_file_name
|
||||
}
|
||||
if (!$restart_parameters)
|
||||
{
|
||||
--echo # Kill and restart
|
||||
--exec echo "restart" > $_expect_file_name
|
||||
}
|
||||
|
||||
--shutdown_server 0
|
||||
--source include/wait_until_disconnected.inc
|
||||
--enable_reconnect
|
||||
--source include/wait_until_connected_again.inc
|
||||
--disable_reconnect
|
7
mysql-test/include/kill_mysqld.inc
Normal file
7
mysql-test/include/kill_mysqld.inc
Normal file
@@ -0,0 +1,7 @@
|
||||
--let $_server_id= `SELECT @@server_id`
|
||||
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
|
||||
|
||||
--echo # Kill the server
|
||||
--exec echo "wait" > $_expect_file_name
|
||||
--shutdown_server 0
|
||||
--source include/wait_until_disconnected.inc
|
@@ -236,6 +236,15 @@ create table t2i (a int);
|
||||
insert into t2m values (5);
|
||||
insert into t2i values (5);
|
||||
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
analyze table t1i;
|
||||
analyze table t1m;
|
||||
analyze table t2i;
|
||||
analyze table t2m;
|
||||
-- enable_result_log
|
||||
-- enable_query_log
|
||||
|
||||
# test with $engine_type
|
||||
select min(a) from t1i;
|
||||
select min(7) from t1i;
|
||||
@@ -411,6 +420,13 @@ if ($test_foreign_keys)
|
||||
INSERT INTO t1 VALUES (1,'A1'),(2,'A2'),(3,'B');
|
||||
INSERT INTO t2 VALUES (1,1),(2,2),(3,2),(4,3),(5,3);
|
||||
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
ANALYZE TABLE t1;
|
||||
ANALYZE TABLE t2;
|
||||
-- enable_result_log
|
||||
-- enable_query_log
|
||||
|
||||
EXPLAIN
|
||||
SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
|
||||
WHERE t1.name LIKE 'A%';
|
||||
@@ -572,12 +588,22 @@ OPTIMIZE TABLE t1;
|
||||
SELECT COUNT(*) FROM t1;
|
||||
SELECT COUNT(*) FROM t1 WHERE acct_id=785;
|
||||
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
ANALYZE TABLE t1;
|
||||
-- enable_result_log
|
||||
-- enable_query_log
|
||||
|
||||
EXPLAIN SELECT COUNT(*) FROM t1 WHERE stat_id IN (1,3) AND acct_id=785;
|
||||
|
||||
INSERT INTO t2 SELECT * FROM t1;
|
||||
OPTIMIZE TABLE t2;
|
||||
|
||||
EXPLAIN SELECT COUNT(*) FROM t2 WHERE stat_id IN (1,3) AND acct_id=785;
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
ANALYZE TABLE t2;
|
||||
-- enable_result_log
|
||||
-- enable_query_log
|
||||
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
@@ -654,9 +680,11 @@ INSERT INTO t2 VALUES (1);
|
||||
|
||||
CONNECTION c2;
|
||||
SET AUTOCOMMIT=0;
|
||||
SET @old_lock_wait_timeout= @@lock_wait_timeout;
|
||||
SET lock_wait_timeout= 1;
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
LOCK TABLES t1 READ, t2 READ;
|
||||
|
||||
SET @@lock_wait_timeout= @old_lock_wait_timeout;
|
||||
CONNECTION c1;
|
||||
COMMIT;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
@@ -702,6 +730,13 @@ INSERT INTO t1(b,c) SELECT b,c FROM t2;
|
||||
UPDATE t2 SET c='2007-01-03';
|
||||
INSERT INTO t1(b,c) SELECT b,c FROM t2;
|
||||
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
ANALYZE TABLE t1;
|
||||
ANALYZE TABLE t2;
|
||||
-- enable_result_log
|
||||
-- enable_query_log
|
||||
|
||||
set @@sort_buffer_size=8192;
|
||||
|
||||
SELECT COUNT(*) FROM t1;
|
||||
@@ -791,6 +826,12 @@ INSERT INTO t1 SELECT a + 16, MOD(a + 16, 20), 1 FROM t1;
|
||||
INSERT INTO t1 SELECT a + 32, MOD(a + 32, 20), 1 FROM t1;
|
||||
INSERT INTO t1 SELECT a + 64, MOD(a + 64, 20), 1 FROM t1;
|
||||
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
ANALYZE TABLE t1;
|
||||
-- enable_result_log
|
||||
-- enable_query_log
|
||||
|
||||
EXPLAIN SELECT b, SUM(c) FROM t1 GROUP BY b;
|
||||
EXPLAIN SELECT SQL_BIG_RESULT b, SUM(c) FROM t1 GROUP BY b;
|
||||
DROP TABLE t1;
|
||||
@@ -853,6 +894,11 @@ CREATE TABLE t1 (a int, b int, PRIMARY KEY (a), KEY bkey (b)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1,2),(3,2),(2,2),(4,2),(5,2),(6,2),(7,2),(8,2);
|
||||
INSERT INTO t1 SELECT a + 8, 2 FROM t1;
|
||||
INSERT INTO t1 SELECT a + 16, 1 FROM t1;
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
ANALYZE TABLE t1;
|
||||
-- enable_result_log
|
||||
-- enable_query_log
|
||||
query_vertical EXPLAIN SELECT * FROM t1 WHERE b=2 ORDER BY a;
|
||||
SELECT * FROM t1 WHERE b=2 ORDER BY a;
|
||||
query_vertical EXPLAIN SELECT * FROM t1 WHERE b BETWEEN 1 AND 2 ORDER BY a;
|
||||
@@ -866,6 +912,12 @@ INSERT INTO t2 VALUES (1,1,1),(3,1,1),(2,1,1),(4,1,1);
|
||||
INSERT INTO t2 SELECT a + 4, 1, 1 FROM t2;
|
||||
INSERT INTO t2 SELECT a + 8, 1, 1 FROM t2;
|
||||
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
ANALYZE TABLE t2;
|
||||
-- enable_result_log
|
||||
-- enable_query_log
|
||||
|
||||
query_vertical EXPLAIN SELECT * FROM t2 WHERE b=1 ORDER BY a;
|
||||
SELECT * FROM t2 WHERE b=1 ORDER BY a;
|
||||
query_vertical EXPLAIN SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY a;
|
||||
@@ -957,7 +1009,7 @@ SELECT * FROM t1 WHERE b=20 FOR UPDATE;
|
||||
|
||||
--connect (conn2, localhost, root,,test)
|
||||
|
||||
# This statement gives a "failed: 1205: Lock wait timeout exceeded; try
|
||||
# This statement gives a "failed: 1205: Lock wait timeout exceeded; try
|
||||
# restarting transaction" message when the bug is present.
|
||||
START TRANSACTION;
|
||||
SELECT * FROM t1 WHERE b=10 ORDER BY A FOR UPDATE;
|
||||
@@ -982,6 +1034,12 @@ CREATE TABLE t1(
|
||||
|
||||
INSERT INTO t1 VALUES (1,1,1,50), (1,2,3,40), (2,1,3,4);
|
||||
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
ANALYZE TABLE t1;
|
||||
-- enable_result_log
|
||||
-- enable_query_log
|
||||
|
||||
EXPLAIN SELECT c,b,d FROM t1 GROUP BY c,b,d;
|
||||
SELECT c,b,d FROM t1 GROUP BY c,b,d;
|
||||
EXPLAIN SELECT c,b,d FROM t1 GROUP BY c,b,d ORDER BY NULL;
|
||||
@@ -1002,6 +1060,12 @@ DROP TABLE t1;
|
||||
CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a), INDEX b (b)) ENGINE=InnoDB;
|
||||
INSERT INTO t1(a,b) VALUES (1,1), (2,2), (3,2);
|
||||
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
ANALYZE TABLE t1;
|
||||
-- enable_result_log
|
||||
-- enable_query_log
|
||||
|
||||
#The two queries below should produce different results, but they don't.
|
||||
query_vertical EXPLAIN SELECT * FROM t1 WHERE b=2 ORDER BY a ASC;
|
||||
SELECT * FROM t1 WHERE b=2 ORDER BY a ASC;
|
||||
@@ -1085,6 +1149,12 @@ CREATE TABLE t1 (id int, type char(6), d int, INDEX idx(id,d)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES
|
||||
(191, 'member', 1), (NULL, 'member', 3), (NULL, 'member', 4), (201, 'member', 2);
|
||||
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
ANALYZE TABLE t1;
|
||||
-- enable_result_log
|
||||
-- enable_query_log
|
||||
|
||||
EXPLAIN SELECT * FROM t1 WHERE id=191 OR id IS NULL ORDER BY d;
|
||||
SELECT * FROM t1 WHERE id=191 OR id IS NULL ORDER BY d;
|
||||
|
||||
@@ -1113,12 +1183,13 @@ CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY (a), KEY t1_b (b))
|
||||
INSERT INTO t1 (a,b,c) VALUES (1,1,1), (2,1,1), (3,1,1), (4,1,1);
|
||||
INSERT INTO t1 (a,b,c) SELECT a+4,b,c FROM t1;
|
||||
|
||||
# should be range access
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
ANALYZE TABLE t1;
|
||||
-- enable_result_log
|
||||
-- enable_query_log
|
||||
|
||||
#
|
||||
# InnoDB uses "where", while xtradb "index condition"
|
||||
#
|
||||
--replace_regex /where/index condition/
|
||||
# should be range access
|
||||
EXPLAIN SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5;
|
||||
|
||||
# should produce '8 7 6 5 4' for a
|
||||
@@ -1512,6 +1583,12 @@ INSERT INTO t1 VALUES
|
||||
(4,1,3,'pk',NULL),(5,1,3,'c2',NULL),
|
||||
(2,1,4,'c_extra',NULL),(3,1,4,'c_extra',NULL);
|
||||
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
ANALYZE TABLE t1;
|
||||
-- enable_result_log
|
||||
-- enable_query_log
|
||||
|
||||
EXPLAIN SELECT * FROM t1 FORCE INDEX (PRIMARY) WHERE tid = 1 AND vid = 3 ORDER BY idx DESC;
|
||||
|
||||
SELECT * FROM t1 FORCE INDEX (PRIMARY) WHERE tid = 1 AND vid = 3 ORDER BY idx DESC;
|
||||
@@ -1529,6 +1606,12 @@ CREATE TABLE t1 (c1 INT, c2 INT, c3 INT, KEY (c3), KEY (c2, c3))
|
||||
ENGINE=$engine_type;
|
||||
INSERT INTO t1 VALUES (1,1,1), (1,1,1), (1,1,2), (1,1,1), (1,1,2);
|
||||
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
ANALYZE TABLE t1;
|
||||
-- enable_result_log
|
||||
-- enable_query_log
|
||||
|
||||
SELECT 1 FROM (SELECT COUNT(DISTINCT c1)
|
||||
FROM t1 WHERE c2 IN (1, 1) AND c3 = 2 GROUP BY c2) x;
|
||||
EXPLAIN
|
||||
@@ -1542,6 +1625,12 @@ CREATE TABLE t1 (c1 REAL, c2 REAL, c3 REAL, KEY (c3), KEY (c2, c3))
|
||||
ENGINE=$engine_type;
|
||||
INSERT INTO t1 VALUES (1,1,1), (1,1,1), (1,1,2), (1,1,1), (1,1,2);
|
||||
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
ANALYZE TABLE t1;
|
||||
-- enable_result_log
|
||||
-- enable_query_log
|
||||
|
||||
SELECT 1 FROM (SELECT COUNT(DISTINCT c1)
|
||||
FROM t1 WHERE c2 IN (1, 1) AND c3 = 2 GROUP BY c2) x;
|
||||
EXPLAIN
|
||||
@@ -1556,6 +1645,12 @@ CREATE TABLE t1 (c1 DECIMAL(12,2), c2 DECIMAL(12,2), c3 DECIMAL(12,2),
|
||||
ENGINE=$engine_type;
|
||||
INSERT INTO t1 VALUES (1,1,1), (1,1,1), (1,1,2), (1,1,1), (1,1,2);
|
||||
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
ANALYZE TABLE t1;
|
||||
-- enable_result_log
|
||||
-- enable_query_log
|
||||
|
||||
SELECT 1 FROM (SELECT COUNT(DISTINCT c1)
|
||||
FROM t1 WHERE c2 IN (1, 1) AND c3 = 2 GROUP BY c2) x;
|
||||
EXPLAIN
|
||||
@@ -1583,6 +1678,13 @@ CREATE TABLE t2 (
|
||||
insert into t1 values (0),(1),(2),(3),(4);
|
||||
insert into t2 select A.a + 10 *B.a, 1, 'filler' from t1 A, t1 B;
|
||||
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
analyze table t1;
|
||||
analyze table t2;
|
||||
-- enable_result_log
|
||||
-- enable_query_log
|
||||
|
||||
explain select * from t1, t2 where t2.a=t1.a and t2.b + 1;
|
||||
select * from t1, t2 where t2.a=t1.a and t2.b + 1;
|
||||
|
||||
|
@@ -205,14 +205,6 @@ INSERT INTO global_suppressions VALUES
|
||||
("==[0-9]*== Warning: invalid file descriptor -1 in syscall write()"),
|
||||
("==[0-9]*== Warning: invalid file descriptor -1 in syscall read()"),
|
||||
|
||||
/*
|
||||
BUG#42147 - Concurrent DML and LOCK TABLE ... READ for InnoDB
|
||||
table cause warnings in errlog
|
||||
Note: This is a temporary suppression until Bug#42147 can be
|
||||
fixed properly. See bug page for more information.
|
||||
*/
|
||||
("Found lock of type 6 that is write and read locked"),
|
||||
|
||||
/*
|
||||
Transient network failures that cause warnings on reconnect.
|
||||
BUG#47743 and BUG#47983.
|
||||
|
@@ -101,16 +101,16 @@ if ($relocate_index_file)
|
||||
--eval LOAD DATA INFILE '$relocate_fix_relay_log_info' INTO TABLE tmp (entry)
|
||||
--let $count= `SELECT count(*) FROM tmp`
|
||||
|
||||
--let $_curr_entry= `SELECT entry FROM tmp WHERE id=1`
|
||||
--let $_curr_entry= `SELECT entry FROM tmp WHERE id=2`
|
||||
--let $_curr_entry_basename= `SELECT RIGHT(RTRIM("$_curr_entry"), LOCATE("$_path_separator",REVERSE(RTRIM("$_curr_entry"))) -1)`
|
||||
|
||||
if ($relocate_is_windows)
|
||||
{
|
||||
--eval UPDATE tmp SET entry='$_to\$_curr_entry_basename' WHERE id=1
|
||||
--eval UPDATE tmp SET entry='$_to\$_curr_entry_basename' WHERE id=2
|
||||
}
|
||||
if (!$relocate_is_windows)
|
||||
{
|
||||
--eval UPDATE tmp SET entry='$_to/$_curr_entry_basename' WHERE id=1
|
||||
--eval UPDATE tmp SET entry='$_to/$_curr_entry_basename' WHERE id=2
|
||||
}
|
||||
|
||||
--remove_file $relocate_fix_relay_log_info
|
||||
|
29
mysql-test/include/reset_master_slave.inc
Normal file
29
mysql-test/include/reset_master_slave.inc
Normal file
@@ -0,0 +1,29 @@
|
||||
#
|
||||
# The include file runs RESET ALL for every replication connection
|
||||
# currently present in SHOW FULL SLAVE STATUS output on the server,
|
||||
# and also runs RESET MASTER on the same server.
|
||||
#
|
||||
|
||||
--let $include_filename= reset_master_slave.inc
|
||||
--source include/begin_include_file.inc
|
||||
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--disable_warnings
|
||||
--let $default_master = `SELECT @@default_master_connection`
|
||||
--let $con_name = query_get_value(show all slaves status, Connection_name, 1)
|
||||
while ($con_name != 'No such row')
|
||||
{
|
||||
eval set default_master_connection = '$con_name';
|
||||
stop slave;
|
||||
--source include/wait_for_slave_to_stop.inc
|
||||
reset slave all;
|
||||
--let $con_name = query_get_value(show all slaves status, Connection_name, 1)
|
||||
}
|
||||
|
||||
--error 0,ER_FLUSH_MASTER_BINLOG_CLOSED
|
||||
reset master;
|
||||
set global gtid_slave_pos='';
|
||||
eval set default_master_connection = '$default_master';
|
||||
--source include/end_include_file.inc
|
||||
|
118
mysql-test/include/rpl_assert.inc
Normal file
118
mysql-test/include/rpl_assert.inc
Normal file
@@ -0,0 +1,118 @@
|
||||
# ==== Purpose ====
|
||||
#
|
||||
# Check if a condition holds, fail with debug info if not.
|
||||
#
|
||||
# The condition is parsed before executed. The following constructs
|
||||
# are supported:
|
||||
#
|
||||
# [SQL STATEMENT, COLUMN, ROW]
|
||||
# The square bracket is replaced by the result from SQL STATEMENT,
|
||||
# in the given COLUMN and ROW.
|
||||
#
|
||||
# <1>
|
||||
# This is a shorthand for the result of the first executed square
|
||||
# bracket. <2> is a shorthand for the second executed square
|
||||
# bracket, and so on.
|
||||
#
|
||||
# ==== Usage ====
|
||||
#
|
||||
# --let $assert_text= Relay_Log_Pos must be smaller than pos.
|
||||
# --let $assert_cond= [SHOW SLAVE STATUS, Relay_Log_Pos, 1] >= $min_pos AND <1> <= $max_pos
|
||||
# [--let $assert_quiet= 1]
|
||||
# [--let $rpl_debug= 1]
|
||||
# --source include/rpl_assert.inc
|
||||
#
|
||||
# Parameters:
|
||||
#
|
||||
# $assert_text
|
||||
# Text that describes what is being checked. By default, this text
|
||||
# is written to the query log.
|
||||
#
|
||||
# $assert_cond
|
||||
# Condition to check. See above for details about the format. The
|
||||
# condition will be executed as `SELECT $assert_cond`. Note: this
|
||||
# condition is parsed using SQL statements, quoted inside single
|
||||
# quotes, so it must not contain single quotes itself (use double
|
||||
# quotes for strings).
|
||||
#
|
||||
# $assert_quiet
|
||||
# Do not print $assert_text to the query log.
|
||||
#
|
||||
# $rpl_debug
|
||||
# Print extra debug info.
|
||||
|
||||
|
||||
if ($rpl_debug)
|
||||
{
|
||||
--echo # debug: assert_text='$assert_text' assert_cond='$assert_cond'
|
||||
}
|
||||
|
||||
# Sanity-check input
|
||||
if (`SELECT "$assert_text" = ""`)
|
||||
{
|
||||
--die ERROR IN TEST: the mysqltest variable rpl_test must be set
|
||||
}
|
||||
|
||||
# Evaluate square brackets in cond.
|
||||
--let $_rpl_assert_substmt_number= 1
|
||||
--let $_rpl_interpolated_cond= $assert_cond
|
||||
--let $_rpl_assert_lbracket= `SELECT LOCATE('[', '$_rpl_interpolated_cond')`
|
||||
while ($_rpl_assert_lbracket)
|
||||
{
|
||||
# Get position of right bracket
|
||||
--let $_rpl_assert_rbracket= `SELECT LOCATE(']', '$_rpl_interpolated_cond')`
|
||||
if (!$_rpl_assert_rbracket)
|
||||
{
|
||||
--echo BUG IN TEST: Mismatching square brackets in assert_cond: '$assert_cond'
|
||||
--die BUG IN TEST: Mismatching square brackets in $assert_cond
|
||||
}
|
||||
# Get sub-statement and result of it
|
||||
--let $_rpl_assert_substmt= `SELECT SUBSTRING('$_rpl_interpolated_cond', $_rpl_assert_lbracket + 1, $_rpl_assert_rbracket - $_rpl_assert_lbracket - 1)`
|
||||
--let $_rpl_assert_substmt_result= query_get_value($_rpl_assert_substmt)
|
||||
if ($rpl_debug)
|
||||
{
|
||||
--echo # debug: sub-statement='$_rpl_assert_substmt' result='$rpl_assert_result'
|
||||
}
|
||||
# Replace sub-statement by its result
|
||||
--let $_rpl_interpolated_cond= `SELECT REPLACE('$_rpl_interpolated_cond', '[$_rpl_assert_substmt]', '$_rpl_assert_substmt_result')`
|
||||
# Replace result references by result
|
||||
--let $_rpl_interpolated_cond= `SELECT REPLACE('$_rpl_interpolated_cond', '<$_rpl_assert_substmt_number>', '$_rpl_assert_substmt_result')`
|
||||
|
||||
--let $_rpl_assert_lbracket= `SELECT LOCATE('[', '$_rpl_interpolated_cond')`
|
||||
|
||||
--inc $_rpl_assert_substmt_number
|
||||
}
|
||||
|
||||
if ($rpl_debug)
|
||||
{
|
||||
--echo # debug: interpolated_cond='$_rpl_interpolated_cond'
|
||||
}
|
||||
|
||||
# Execute.
|
||||
--let $_rpl_assert_result= `SELECT $_rpl_interpolated_cond`
|
||||
|
||||
if ($rpl_debug)
|
||||
{
|
||||
--echo # debug: result='$_rpl_assert_result'
|
||||
}
|
||||
|
||||
# Check.
|
||||
if (!$_rpl_assert_result)
|
||||
{
|
||||
--echo ######## Test assertion failed: $assert_text ########
|
||||
--echo Dumping debug info:
|
||||
--source include/show_rpl_debug_info.inc
|
||||
--echo Assertion text: '$assert_text'
|
||||
--echo Assertion condition: '$assert_cond'
|
||||
--echo Assertion condition, interpolated: '$_rpl_interpolated_cond'
|
||||
--echo Assertion result: '$_rpl_assert_result'
|
||||
--die Test assertion failed in rpl_assertion.inc
|
||||
}
|
||||
|
||||
if (!$assert_quiet)
|
||||
{
|
||||
--echo # Asserted this: $assert_text
|
||||
}
|
||||
|
||||
--let $assert_text=
|
||||
--let $assert_cond=
|
@@ -60,25 +60,30 @@
|
||||
|
||||
perl;
|
||||
use strict;
|
||||
my $search_file= $ENV{'SEARCH_FILE'} or die "SEARCH_FILE not set";
|
||||
die "SEARCH_FILE not set" unless $ENV{'SEARCH_FILE'};
|
||||
my @search_files= glob($ENV{'SEARCH_FILE'});
|
||||
my $search_pattern= $ENV{'SEARCH_PATTERN'} or die "SEARCH_PATTERN not set";
|
||||
my $search_range= $ENV{'SEARCH_RANGE'};
|
||||
my $file_content;
|
||||
my $content;
|
||||
$search_range= 50000 unless $search_range =~ /-?[0-9]+/;
|
||||
open(FILE, '<', $search_file) or die("Unable to open '$search_file': $!\n");
|
||||
if ($search_range >= 0) {
|
||||
read(FILE, $file_content, $search_range, 0);
|
||||
} else {
|
||||
my $size= -s $search_file;
|
||||
$search_range = -$size if $size > -$search_range;
|
||||
seek(FILE, $search_range, 2);
|
||||
read(FILE, $file_content, -$search_range, 0);
|
||||
foreach my $search_file (@search_files) {
|
||||
open(FILE, '<', $search_file) or die("Unable to open '$search_file': $!\n");
|
||||
my $file_content;
|
||||
if ($search_range >= 0) {
|
||||
read(FILE, $file_content, $search_range, 0);
|
||||
} else {
|
||||
my $size= -s $search_file;
|
||||
$search_range = -$size if $size > -$search_range;
|
||||
seek(FILE, $search_range, 2);
|
||||
read(FILE, $file_content, -$search_range, 0);
|
||||
}
|
||||
close(FILE);
|
||||
$content.= $file_content;
|
||||
}
|
||||
close(FILE);
|
||||
$search_file =~ s{^.*?([^/\\]+)$}{$1};
|
||||
if ($file_content =~ m{$search_pattern}) {
|
||||
print "FOUND /$search_pattern/ in $search_file\n"
|
||||
$ENV{'SEARCH_FILE'} =~ s{^.*?([^/\\]+)$}{$1};
|
||||
if ($content =~ m{$search_pattern}) {
|
||||
print "FOUND /$search_pattern/ in $ENV{'SEARCH_FILE'}\n"
|
||||
} else {
|
||||
print "NOT FOUND /$search_pattern/ in $search_file\n"
|
||||
print "NOT FOUND /$search_pattern/ in $ENV{'SEARCH_FILE'}\n"
|
||||
}
|
||||
EOF
|
||||
|
@@ -4,7 +4,7 @@ if ($binlog_start)
|
||||
}
|
||||
if (!$binlog_start)
|
||||
{
|
||||
--let $_binlog_start=249
|
||||
--let $_binlog_start=256
|
||||
}
|
||||
if ($binlog_file)
|
||||
{
|
||||
|
28
mysql-test/include/show_delayed_slave_state.inc
Normal file
28
mysql-test/include/show_delayed_slave_state.inc
Normal file
@@ -0,0 +1,28 @@
|
||||
# ==== Purpose ====
|
||||
#
|
||||
# Display the delay state of the SQL thread.
|
||||
#
|
||||
# ==== Usage ====
|
||||
#
|
||||
# --let $verbose_delayed_slave_state= [0|1]
|
||||
# --source extra/rpl_tests/show_delayed_slave_state.inc
|
||||
#
|
||||
# By default, the output is normalized so that it does not depend on
|
||||
# exact timing or exact binlog positions. If
|
||||
# $verbose_delayed_slave_state is set, then it outputs exact times and
|
||||
# binlog positions. This can be useful for debugging.
|
||||
|
||||
--let $_delayed_slave_status= query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running_State, 1)
|
||||
|
||||
--let $_delayed_slave_remaining_delay= query_get_value(SHOW SLAVE STATUS, SQL_Remaining_Delay, 1)
|
||||
--let $_delayed_slave_qualitative_delay= `SELECT CASE WHEN "$_delayed_slave_remaining_delay" = "NULL" THEN "NULL" WHEN "$_delayed_slave_remaining_delay" = "0" THEN "0" ELSE "greater than zero" END`
|
||||
|
||||
--let $_delayed_slave_io_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1)
|
||||
--let $_delayed_slave_sql_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1)
|
||||
--let $_delayed_slave_qualitative_log_pos= `SELECT IF($_delayed_slave_io_pos > $_delayed_slave_sql_pos, "behind", "in sync with")`
|
||||
|
||||
--echo Slave_SQL_Running_State='$_delayed_slave_status'; SQL_Remaining_Delay is $_delayed_slave_qualitative_delay; SQL thread is $_delayed_slave_qualitative_log_pos IO thread
|
||||
|
||||
if ($verbose_delayed_slave_state) {
|
||||
--echo SQL_Remaining_Delay='$_delayed_slave_remaining_delay'; Read_master_log_pos='$_delayed_slave_io_pos'; Exec_Master_Log_Pos='$_delayed_slave_sql_pos'
|
||||
}
|
@@ -26,6 +26,10 @@ let $_slave_timeout= $slave_timeout;
|
||||
if (!$_slave_timeout)
|
||||
{
|
||||
let $_slave_timeout= 300;
|
||||
if ($VALGRIND_TEST)
|
||||
{
|
||||
let $_slave_timeout= 1500;
|
||||
}
|
||||
}
|
||||
|
||||
--let $_master_log_file= query_get_value(SHOW SLAVE STATUS, Master_Log_File, 1)
|
||||
|
26
mysql-test/include/sync_with_master.inc
Normal file
26
mysql-test/include/sync_with_master.inc
Normal file
@@ -0,0 +1,26 @@
|
||||
# ==== Purpose ====
|
||||
#
|
||||
# This file does the same as the built-in command sync_with_master,
|
||||
# but can be configured to use a custom timeout. This has the benefit
|
||||
# that it accepts the same $slave_timeout and $master_connection
|
||||
# parameters as wait_for_slave_param.inc
|
||||
#
|
||||
#
|
||||
# ==== Usage ====
|
||||
#
|
||||
# --connection master
|
||||
# --source include/save_master_pos.inc
|
||||
# --connection slave
|
||||
# --source include/sync_with_master.inc
|
||||
#
|
||||
# Parameters to this macro are $slave_timeout and
|
||||
# $master_connection. See wait_for_slave_param.inc for
|
||||
# descriptions.
|
||||
|
||||
--let $slave_param= Relay_Master_Log_File
|
||||
--let $slave_param_value= $_master_file
|
||||
--source include/wait_for_slave_param.inc
|
||||
|
||||
--let $slave_param= Exec_Master_Log_Pos
|
||||
--let $slave_param_value= $_master_pos
|
||||
--source include/wait_for_slave_param.inc
|
@@ -50,6 +50,10 @@ let $_slave_timeout= $slave_timeout;
|
||||
if (!$_slave_timeout)
|
||||
{
|
||||
let $_slave_timeout= 300;
|
||||
if ($VALGRIND_TEST)
|
||||
{
|
||||
let $_slave_timeout= 1500;
|
||||
}
|
||||
}
|
||||
|
||||
if ($slave_error_param == '')
|
||||
|
6
mysql-test/include/wait_for_sql_thread_read_all.inc
Normal file
6
mysql-test/include/wait_for_sql_thread_read_all.inc
Normal file
@@ -0,0 +1,6 @@
|
||||
--let $show_statement = show all slaves status
|
||||
--let $field = Slave_SQL_State
|
||||
--let $condition = = 'Slave has read all relay log; waiting for the slave I/O thread to update it'
|
||||
--let $wait_for_all = 1
|
||||
--source include/wait_show_condition.inc
|
||||
|
Reference in New Issue
Block a user