diff options
Diffstat (limited to 'mysql-test/include')
77 files changed, 563 insertions, 877 deletions
diff --git a/mysql-test/include/check-warnings.test b/mysql-test/include/check-warnings.test index 41b0a98e43b..fab7fb2cff6 100644 --- a/mysql-test/include/check-warnings.test +++ b/mysql-test/include/check-warnings.test @@ -16,6 +16,7 @@ set SQL_LOG_BIN=0; --error 0,1193 set debug=""; + use mtr; create temporary table error_log ( diff --git a/mysql-test/include/default_my.cnf b/mysql-test/include/default_my.cnf index f4c9a617cd9..6fd7a082f05 100644 --- a/mysql-test/include/default_my.cnf +++ b/mysql-test/include/default_my.cnf @@ -21,9 +21,6 @@ # Run the master.sh script before starting this process #!run-master-sh -log-bin= master-bin - - [mysqlbinlog] disable-force-if-open diff --git a/mysql-test/include/default_mysqld.cnf b/mysql-test/include/default_mysqld.cnf index 8990bcbb5c0..921f3c4b009 100644 --- a/mysql-test/include/default_mysqld.cnf +++ b/mysql-test/include/default_mysqld.cnf @@ -1,4 +1,4 @@ -# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2010, Oracle and/or its affiliates # # 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 @@ -17,7 +17,7 @@ [mysqld] open-files-limit= 1024 local-infile -default-character-set= latin1 +character-set-server= latin1 # Increase default connect_timeout to avoid intermittent # disconnects when test servers are put under load see BUG#28359 @@ -28,9 +28,12 @@ key_buffer_size= 1M sort_buffer= 256K max_heap_table_size= 1M +loose-skip-innodb +loose-skip-pbxt +loose-skip-feedback +loose-feedback-user-info= mysql-test + loose-innodb_data_file_path= ibdata1:10M:autoextend slave-net-timeout=120 -log-bin=mysqld-bin - diff --git a/mysql-test/include/diff_tables.inc b/mysql-test/include/diff_tables.inc index 94921b02f13..42a8b11740b 100644 --- a/mysql-test/include/diff_tables.inc +++ b/mysql-test/include/diff_tables.inc @@ -178,13 +178,16 @@ while (`SELECT '$_dt_tables' != ''`) } --diff_files $_dt_prev_outfile $_dt_outfile # Remove previous outfile. Keep current file for comparison with next table. + --disable_warnings --remove_file $_dt_prev_outfile + --enable_warnings } --let $_dt_prev_outfile= $_dt_outfile } +--disable_warnings --remove_file $_dt_prev_outfile - +--enable_warnings --let $include_filename= diff_tables.inc [$diff_tables] --source include/end_include_file.inc diff --git a/mysql-test/include/get_relay_log_pos.inc b/mysql-test/include/get_relay_log_pos.inc index 61ee07fc655..93dbc7d284b 100644 --- a/mysql-test/include/get_relay_log_pos.inc +++ b/mysql-test/include/get_relay_log_pos.inc @@ -66,5 +66,11 @@ let $relay_log_pos= `SELECT SUBSTRING(a.c2, 5) FROM events_at a, events_pos b WHERE a.c1=b.c1+1 and b.c2 LIKE '% $master_log_pos%'`; DROP TEMPORARY TABLE mysqlbinlog_events, events_at, events_pos; + +if (!$relay_log_pos) +{ + --echo 'Failed to read from relay_log_file: $relay_log_file pos: $master_log_pos' + --die 'variable $relay_log_pos is null' +} --remove_file $_tmp_file --enable_query_log diff --git a/mysql-test/include/gis_keys.inc b/mysql-test/include/gis_keys.inc index ad00c7e1ef9..cc8ec68f7d1 100644 --- a/mysql-test/include/gis_keys.inc +++ b/mysql-test/include/gis_keys.inc @@ -33,6 +33,7 @@ EXPLAIN SELECT COUNT(*) FROM t1 WHERE p=POINTFROMTEXT('POINT(1 2)'); SELECT COUNT(*) FROM t1 WHERE p=POINTFROMTEXT('POINT(1 2)'); +--replace_column 9 # EXPLAIN SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)'); SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)'); diff --git a/mysql-test/include/handler.inc b/mysql-test/include/handler.inc deleted file mode 100644 index 6e7f53ba9b2..00000000000 --- a/mysql-test/include/handler.inc +++ /dev/null @@ -1,731 +0,0 @@ -# include/handler.inc -# -# The variables -# $engine_type -- storage engine to be tested -# $other_engine_type -- storage engine <> $engine_type -# $other_handler_engine_type -- storage engine <> $engine_type, if possible -# 1. $other_handler_engine_type must support handler -# 2. $other_handler_engine_type must point to an all -# time available storage engine -# 2006-08 MySQL 5.1 MyISAM and MEMORY only -# have to be set before sourcing this script. --- source include/not_embedded.inc -# -# test of HANDLER ... -# -# Last update: -# 2006-07-31 ML test refactored (MySQL 5.1) -# code of t/handler.test and t/innodb_handler.test united -# main testing code put into include/handler.inc -# - -eval SET SESSION STORAGE_ENGINE = $engine_type; - ---disable_warnings -drop table if exists t1,t3,t4,t5; ---enable_warnings - -create table t1 (a int, b char(10), key a(a), key b(a,b)); -insert into t1 values -(17,"ddd"),(18,"eee"),(19,"fff"),(19,"yyy"), -(14,"aaa"),(15,"bbb"),(16,"ccc"),(16,"xxx"), -(20,"ggg"),(21,"hhh"),(22,"iii"); -handler t1 open as t2; --- error 1064 -handler t2 read a=(SELECT 1); -handler t2 read a first; -handler t2 read a next; -handler t2 read a next; -handler t2 read a prev; -handler t2 read a last; -handler t2 read a prev; -handler t2 read a prev; - -handler t2 read a first; -handler t2 read a prev; - -handler t2 read a last; -handler t2 read a prev; -handler t2 read a next; -handler t2 read a next; - -handler t2 read a=(15); -handler t2 read a=(16); - ---error 1070 -handler t2 read a=(19,"fff"); - -handler t2 read b=(19,"fff"); -handler t2 read b=(19,"yyy"); -handler t2 read b=(19); - ---error 1109 -handler t1 read a last; - -handler t2 read a=(11); -handler t2 read a>=(11); - -handler t2 read a=(18); -handler t2 read a>=(18); -handler t2 read a>(18); -handler t2 read a<=(18); -handler t2 read a<(18); - -handler t2 read a first limit 5; -handler t2 read a next limit 3; -handler t2 read a prev limit 10; - -handler t2 read a>=(16) limit 4; -handler t2 read a>=(16) limit 2,2; -handler t2 read a last limit 3; - -handler t2 read a=(19); -handler t2 read a=(19) where b="yyy"; - -handler t2 read first; -handler t2 read next; -handler t2 read next; ---error 1064 -handler t2 read last; -handler t2 close; - -handler t1 open; -handler t1 read a next; # this used to crash as a bug#5373 -handler t1 read a next; -handler t1 close; - -handler t1 open; -handler t1 read a prev; # this used to crash as a bug#5373 -handler t1 read a prev; -handler t1 close; - -handler t1 open as t2; -handler t2 read first; -eval alter table t1 engine = $engine_type; ---error 1109 -handler t2 read first; - -# -# DROP TABLE / ALTER TABLE -# -handler t1 open as t2; -drop table t1; -create table t1 (a int); -insert into t1 values (17); ---error 1109 -handler t2 read first; -handler t1 open as t2; -eval alter table t1 engine=$other_engine_type; ---error 1109 -handler t2 read first; -drop table t1; - -# -# Test case for the bug #787 -# -create table t1 (a int); -insert into t1 values (1),(2),(3),(4),(5),(6); -delete from t1 limit 2; -handler t1 open; -handler t1 read first; -handler t1 read first limit 1,1; -handler t1 read first limit 2,2; -delete from t1 limit 3; -handler t1 read first; -drop table t1; - -# -# Test for #751 -# -create table t1(a int, index(a)); -insert into t1 values (1), (2), (3); -handler t1 open; ---error 1054 -handler t1 read a=(W); ---error 1210 -handler t1 read a=(a); -drop table t1; -# -# BUG#2304 -# -create table t1 (a char(5)); -insert into t1 values ("Ok"); -handler t1 open as t; -handler t read first; -use mysql; -handler t read first; -handler t close; -handler test.t1 open as t; -handler t read first; -handler t close; -use test; -drop table t1; - -# -# BUG#3649 -# -create table t1 ( a int, b int, INDEX a (a) ); -insert into t1 values (1,2), (2,1); -handler t1 open; -handler t1 read a=(1) where b=2; -handler t1 read a=(1) where b=3; -handler t1 read a=(1) where b=1; -handler t1 close; -drop table t1; - -# -# Check if two database names beginning the same are seen as different. -# -# This database begins like the usual 'test' database. -# ---disable_warnings -drop database if exists test_test; ---enable_warnings -create database test_test; -use test_test; -create table t1(table_id char(20) primary key); -insert into t1 values ('test_test.t1'); -insert into t1 values (''); -handler t1 open; -handler t1 read first limit 9; -create table t2(table_id char(20) primary key); -insert into t2 values ('test_test.t2'); -insert into t2 values (''); -handler t2 open; -handler t2 read first limit 9; -# -# This is the usual 'test' database. -# -use test; ---disable_warnings -drop table if exists t1; ---enable_warnings -create table t1(table_id char(20) primary key); -insert into t1 values ('test.t1'); -insert into t1 values (''); ---error 1066 -handler t1 open; -# -# Check accesibility of all the tables. -# -use test; ---error 1064 -handler test.t1 read first limit 9; ---error 1064 -handler test_test.t1 read first limit 9; -handler t1 read first limit 9; ---error 1064 -handler test_test.t2 read first limit 9; -handler t2 read first limit 9; - -# -# Cleanup. -# - ---error 1064 -handler test_test.t1 close; -handler t1 close; -drop table test_test.t1; ---error 1064 -handler test_test.t2 close; -handler t2 close; -drop table test_test.t2; -drop database test_test; - -# -use test; ---error 1064 -handler test.t1 close; ---error 1109 -handler t1 close; -drop table test.t1; - -# -# BUG#4335 -# ---disable_warnings -drop database if exists test_test; -drop table if exists t1; -drop table if exists t2; -drop table if exists t3; ---enable_warnings -create database test_test; -use test_test; -create table t1 (c1 char(20)); -insert into t1 values ('test_test.t1'); -create table t3 (c1 char(20)); -insert into t3 values ('test_test.t3'); -handler t1 open; -handler t1 read first limit 9; -handler t1 open h1; -handler h1 read first limit 9; -use test; -create table t1 (c1 char(20)); -create table t2 (c1 char(20)); -create table t3 (c1 char(20)); -insert into t1 values ('t1'); -insert into t2 values ('t2'); -insert into t3 values ('t3'); ---error 1066 -handler t1 open; ---error 1066 -handler t2 open t1; ---error 1066 -handler t3 open t1; -handler t1 read first limit 9; ---error 1064 -handler test.t1 close; ---error 1066 -handler test.t1 open h1; ---error 1066 -handler test_test.t1 open h1; -handler test_test.t3 open h3; -handler test.t1 open h2; -handler t1 read first limit 9; -handler h1 read first limit 9; -handler h2 read first limit 9; -handler h3 read first limit 9; -handler h2 read first limit 9; ---error 1064 -handler test.h1 close; -handler t1 close; -handler h1 close; -handler h2 close; ---error 1109 -handler t1 read first limit 9; ---error 1109 -handler h1 read first limit 9; ---error 1109 -handler h2 read first limit 9; -handler h3 read first limit 9; -handler h3 read first limit 9; -use test_test; -handler h3 read first limit 9; ---error 1064 -handler test.h3 read first limit 9; -handler h3 close; -use test; -drop table t3; -drop table t2; -drop table t1; -drop database test_test; - -# -# Test if fix for BUG#4286 correctly closes handler tables. -# -create table t1 (c1 char(20)); -insert into t1 values ("t1"); -handler t1 open as h1; -handler h1 read first limit 9; -create table t2 (c1 char(20)); -insert into t2 values ("t2"); -handler t2 open as h2; -handler h2 read first limit 9; -create table t3 (c1 char(20)); -insert into t3 values ("t3"); -handler t3 open as h3; -handler h3 read first limit 9; -create table t4 (c1 char(20)); -insert into t4 values ("t4"); -handler t4 open as h4; -handler h4 read first limit 9; -create table t5 (c1 char(20)); -insert into t5 values ("t5"); -handler t5 open as h5; -handler h5 read first limit 9; -# close first -eval alter table t1 engine=$other_handler_engine_type; ---error 1109 -handler h1 read first limit 9; -handler h2 read first limit 9; -handler h3 read first limit 9; -handler h4 read first limit 9; -handler h5 read first limit 9; -# close last -eval alter table t5 engine=$other_handler_engine_type; ---error 1109 -handler h1 read first limit 9; -handler h2 read first limit 9; -handler h3 read first limit 9; -handler h4 read first limit 9; ---error 1109 -handler h5 read first limit 9; -# close middle -eval alter table t3 engine=$other_handler_engine_type; ---error 1109 -handler h1 read first limit 9; -handler h2 read first limit 9; ---error 1109 -handler h3 read first limit 9; -handler h4 read first limit 9; ---error 1109 -handler h5 read first limit 9; -handler h2 close; -handler h4 close; -# close all depending handler tables -handler t1 open as h1_1; -handler t1 open as h1_2; -handler t1 open as h1_3; -handler h1_1 read first limit 9; -handler h1_2 read first limit 9; -handler h1_3 read first limit 9; -eval alter table t1 engine=$engine_type; ---error 1109 -handler h1_1 read first limit 9; ---error 1109 -handler h1_2 read first limit 9; ---error 1109 -handler h1_3 read first limit 9; -drop table t1; -drop table t2; -drop table t3; -drop table t4; -drop table t5; - -# -# Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash -# -create table t1 (c1 int); -insert into t1 values (1); -# client 1 -handler t1 open; -handler t1 read first; -# client 2 -connect (con2,localhost,root,,); -connection con2; ---exec echo send the below to another connection, do not wait for the result -send optimize table t1; ---sleep 1 -# client 1 ---exec echo proceed with the normal connection -connection default; -handler t1 read next; -handler t1 close; -# client 2 ---exec echo read the result from the other connection -connection con2; -reap; -# client 1 ---exec echo proceed with the normal connection -connection default; -drop table t1; - -CREATE TABLE t1 ( no1 smallint(5) NOT NULL default '0', no2 int(10) NOT NULL default '0', PRIMARY KEY (no1,no2)); -INSERT INTO t1 VALUES (1,274),(1,275),(2,6),(2,8),(4,1),(4,2); -HANDLER t1 OPEN; -HANDLER t1 READ `primary` = (1, 1000); -HANDLER t1 READ `primary` PREV; -DROP TABLE t1; - -# End of 4.1 tests - -# -# Addendum to Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash -# Show that DROP TABLE can no longer deadlock against -# FLUSH TABLES WITH READ LOCK. This is a 5.0 issue. -# -create table t1 (c1 int); -insert into t1 values (14397); -flush tables with read lock; -# The thread with the global read lock cannot drop the table itself: ---error 1223 -drop table t1; -# -# client 2 -# We need a second connection to try the drop. -# The drop waits for the global read lock to go away. -# Without the addendum fix it locked LOCK_open before entering the wait loop. -connection con2; ---exec echo send the below to another connection, do not wait for the result -send drop table t1; ---sleep 1 -# -# client 1 -# Now we need something that wants LOCK_open. A simple table access which -# opens the table does the trick. ---exec echo proceed with the normal connection -connection default; -# This would hang on LOCK_open without the 5.0 addendum fix. -select * from t1; -# Release the read lock. This should make the DROP go through. -unlock tables; -# -# client 2 -# Read the result of the drop command. -connection con2; ---exec echo read the result from the other connection -reap; -# -# client 1 -# Now back to normal operation. The table should not exist any more. ---exec echo proceed with the normal connection -connection default; ---error 1146 -select * from t1; -# Just to be sure and not confuse the next test case writer. -drop table if exists t1; - -# -# Bug#25856 - HANDLER table OPEN in one connection lock DROP TABLE in another one -# ---disable_warnings -drop table if exists t1; ---enable_warnings -eval create table t1 (a int) ENGINE=$other_engine_type; ---echo --> client 2 -connection con2; ---error 1031 -handler t1 open; ---echo --> client 1 -connection default; -drop table t1; -disconnect con2; - -# -# Bug#30632 HANDLER read failure causes hang -# ---disable_warnings -drop table if exists t1; ---enable_warnings -create table t1 (a int); -handler t1 open as t1_alias; ---error 1176 -handler t1_alias read a next; ---error 1054 -handler t1_alias READ a next where inexistent > 0; ---error 1176 -handler t1_alias read a next; ---error 1054 -handler t1_alias READ a next where inexistent > 0; -handler t1_alias close; -drop table t1; - -# -# Bug#21587 FLUSH TABLES causes server crash when used with HANDLER statements -# - ---disable_warnings -drop table if exists t1,t2; ---enable_warnings -create table t1 (c1 int); -create table t2 (c1 int); -insert into t1 values (1); -insert into t2 values (2); ---echo connection: default -handler t1 open; -handler t1 read first; -connect (flush,localhost,root,,); -connection flush; ---echo connection: flush ---send flush tables; -connection default; ---echo connection: default -let $wait_condition= - select count(*) = 1 from information_schema.processlist - where state = "Flushing tables"; ---source include/wait_condition.inc -handler t2 open; -handler t2 read first; -handler t1 read next; -handler t1 close; -handler t2 close; -connection flush; -reap; -connection default; -drop table t1,t2; -disconnect flush; - -# -# Bug#31409 RENAME TABLE causes server crash or deadlock when used with HANDLER statements -# - ---disable_warnings -drop table if exists t1,t2; ---enable_warnings -create table t1 (c1 int); ---echo connection: default -handler t1 open; -handler t1 read first; -connect (flush,localhost,root,,); -connection flush; ---echo connection: flush ---send rename table t1 to t2; -connection default; ---echo connection: default -let $wait_condition= - select count(*) = 1 from information_schema.processlist - where state = "Waiting for table" and info = "rename table t1 to t2"; ---source include/wait_condition.inc -handler t2 open; -handler t2 read first; ---error ER_NO_SUCH_TABLE -handler t1 read next; -handler t1 close; -handler t2 close; -connection flush; -reap; -connection default; -drop table t2; -disconnect flush; - -# -# Bug#30882 Dropping a temporary table inside a stored function may cause a server crash -# -# Test HANDLER statements in conjunction with temporary tables. While the temporary table -# is open by a HANDLER, no other statement can access it. -# - ---disable_warnings -drop table if exists t1; ---enable_warnings -create temporary table t1 (a int, b char(1), key a(a), key b(a,b)); -insert into t1 values (0,"a"),(1,"b"),(2,"c"),(3,"d"),(4,"e"), - (5,"f"),(6,"g"),(7,"h"),(8,"i"),(9,"j"); -select a,b from t1; -handler t1 open as a1; -handler a1 read a first; -handler a1 read a next; -handler a1 read a next; ---error ER_CANT_REOPEN_TABLE -select a,b from t1; -handler a1 read a prev; -handler a1 read a prev; -handler a1 read a=(6) where b="g"; -handler a1 close; -select a,b from t1; -handler t1 open as a2; -handler a2 read a first; -handler a2 read a last; -handler a2 read a prev; -handler a2 close; -drop table t1; - -# -# Bug#31397 Inconsistent drop table behavior of handler tables. -# - ---disable_warnings -drop table if exists t1,t2; ---enable_warnings -create table t1 (a int); -handler t1 open as t1_alias; -drop table t1; -create table t1 (a int); -handler t1 open as t1_alias; -flush tables; -drop table t1; -create table t1 (a int); -handler t1 open as t1_alias; -handler t1_alias close; -drop table t1; -create table t1 (a int); -handler t1 open as t1_alias; -handler t1_alias read first; -drop table t1; ---error ER_UNKNOWN_TABLE -handler t1_alias read next; - -# Test that temporary tables associated with handlers are properly dropped. - -create table t1 (a int); -create temporary table t2 (a int, key(a)); -handler t1 open as a1; -handler t2 open as a2; -handler a2 read a first; -drop table t1, t2; ---error ER_UNKNOWN_TABLE -handler a2 read a next; ---error ER_UNKNOWN_TABLE -handler a1 close; - -# Alter table drop handlers - -create table t1 (a int, key(a)); -create table t2 like t1; -handler t1 open as a1; -handler t2 open as a2; -handler a1 read a first; -handler a2 read a first; -alter table t1 add b int; ---error ER_UNKNOWN_TABLE -handler a1 close; -handler a2 close; -drop table t1, t2; - -# Rename table drop handlers - -create table t1 (a int, key(a)); -handler t1 open as a1; -handler a1 read a first; -rename table t1 to t2; ---error ER_UNKNOWN_TABLE -handler a1 read a first; -drop table t2; - -# Optimize table drop handlers - -create table t1 (a int, key(a)); -create table t2 like t1; -handler t1 open as a1; -handler t2 open as a2; -handler a1 read a first; -handler a2 read a first; -optimize table t1; ---error ER_UNKNOWN_TABLE -handler a1 close; -handler a2 close; -drop table t1, t2; - -# Flush tables causes handlers reopen - -create table t1 (a int, b char(1), key a(a), key b(a,b)); -insert into t1 values (0,"a"),(1,"b"),(2,"c"),(3,"d"),(4,"e"), - (5,"f"),(6,"g"),(7,"h"),(8,"i"),(9,"j"); -handler t1 open; -handler t1 read a first; -handler t1 read a next; -flush tables; -handler t1 read a next; -handler t1 read a next; -flush tables with read lock; -handler t1 read a next; -unlock tables; -drop table t1; ---error ER_UNKNOWN_TABLE -handler t1 read a next; - -# -# Bug#41110: crash with handler command when used concurrently with alter table -# Bug#41112: crash in mysql_ha_close_table/get_lock_data with alter table -# - ---disable_warnings -drop table if exists t1; ---enable_warnings -create table t1 (a int); -insert into t1 values (1); -handler t1 open; -connect(con1,localhost,root,,); -send alter table t1 engine=memory; -connection default; -let $wait_condition= - select count(*) = 1 from information_schema.processlist - where state = "rename result table" and info = "alter table t1 engine=memory"; ---source include/wait_condition.inc ---error ER_ILLEGAL_HA -handler t1 read a next; -handler t1 close; -connection con1; ---reap -drop table t1; -disconnect con1; ---source include/wait_until_disconnected.inc -connection default; - -# -# Bug#44151 using handler commands on information_schema tables crashes server -# -USE information_schema; ---error ER_WRONG_USAGE -HANDLER COLUMNS OPEN; -USE test; diff --git a/mysql-test/include/have_archive.inc b/mysql-test/include/have_archive.inc index 82399ca4c6c..0fd85fa576f 100644 --- a/mysql-test/include/have_archive.inc +++ b/mysql-test/include/have_archive.inc @@ -1,4 +1,5 @@ ---disable_query_log ---require r/true.require -select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'archive'; ---enable_query_log +if (!`SELECT count(*) FROM information_schema.engines WHERE + (support = 'YES' OR support = 'DEFAULT') AND + engine = 'archive'`){ + skip Need archive engine; +} diff --git a/mysql-test/include/have_archive.opt b/mysql-test/include/have_archive.opt new file mode 100644 index 00000000000..cf9309d9fb0 --- /dev/null +++ b/mysql-test/include/have_archive.opt @@ -0,0 +1,2 @@ +--loose-archive +--plugin-load=$HA_ARCHIVE_SO diff --git a/mysql-test/include/have_big5.inc b/mysql-test/include/have_big5.inc index dad4a0a8eeb..d6ef1202bae 100644 --- a/mysql-test/include/have_big5.inc +++ b/mysql-test/include/have_big5.inc @@ -1,4 +1,2 @@ --- require r/have_big5.require -disable_query_log; -show collation like 'big5_chinese_ci'; -enable_query_log; +let collation=big5_chinese_ci; +--source include/have_collation.inc diff --git a/mysql-test/include/have_binlog_format_mixed.opt b/mysql-test/include/have_binlog_format_mixed.opt new file mode 100644 index 00000000000..01cf3e0520f --- /dev/null +++ b/mysql-test/include/have_binlog_format_mixed.opt @@ -0,0 +1 @@ +--binlog-format=mixed diff --git a/mysql-test/include/have_binlog_format_row.opt b/mysql-test/include/have_binlog_format_row.opt new file mode 100644 index 00000000000..83ed8522e72 --- /dev/null +++ b/mysql-test/include/have_binlog_format_row.opt @@ -0,0 +1 @@ +--binlog-format=row diff --git a/mysql-test/include/have_binlog_format_statement.opt b/mysql-test/include/have_binlog_format_statement.opt new file mode 100644 index 00000000000..0dac5e9fb9c --- /dev/null +++ b/mysql-test/include/have_binlog_format_statement.opt @@ -0,0 +1,2 @@ +--binlog-format=statement + diff --git a/mysql-test/include/have_blackhole.opt b/mysql-test/include/have_blackhole.opt new file mode 100644 index 00000000000..b600b468390 --- /dev/null +++ b/mysql-test/include/have_blackhole.opt @@ -0,0 +1,2 @@ +--loose-blackhole +--plugin-load=$HA_BLACKHOLE_SO diff --git a/mysql-test/include/have_collation.inc b/mysql-test/include/have_collation.inc new file mode 100644 index 00000000000..99270fd4d3d --- /dev/null +++ b/mysql-test/include/have_collation.inc @@ -0,0 +1,3 @@ +if (!`SELECT count(*) AS 'true' FROM information_schema.collations WHERE collation_name LIKE '$collation'`) { + skip Test needs character set '$collation'; +} diff --git a/mysql-test/include/have_cp1250_ch.inc b/mysql-test/include/have_cp1250_ch.inc index 426fa658597..93fde6e9fe6 100644 --- a/mysql-test/include/have_cp1250_ch.inc +++ b/mysql-test/include/have_cp1250_ch.inc @@ -1,4 +1,2 @@ --- require r/have_cp1250_ch.require -disable_query_log; -show collation like 'cp1250_czech_cs'; -enable_query_log; +let collation=cp1250_czech_cs; +--source include/have_collation.inc diff --git a/mysql-test/include/have_cp1251.inc b/mysql-test/include/have_cp1251.inc index 2d5f1b3b529..32e9e7220fc 100644 --- a/mysql-test/include/have_cp1251.inc +++ b/mysql-test/include/have_cp1251.inc @@ -1,7 +1,2 @@ ---require r/have_cp1251.require - ---disable_query_log - -SHOW COLLATION LIKE 'cp1251_general_ci'; - ---enable_query_log +let collation=cp1251_general_ci; +--source include/have_collation.inc diff --git a/mysql-test/include/have_cp866.inc b/mysql-test/include/have_cp866.inc index 27390d87d51..549ea22a0e3 100644 --- a/mysql-test/include/have_cp866.inc +++ b/mysql-test/include/have_cp866.inc @@ -1,7 +1,2 @@ ---require r/have_cp866.require - ---disable_query_log - -SHOW COLLATION LIKE 'cp866_general_ci'; - ---enable_query_log +let collation=cp866_general_ci; +--source include/have_collation.inc diff --git a/mysql-test/include/have_cp932.inc b/mysql-test/include/have_cp932.inc index ecad979c02a..6e436b8b3f5 100644 --- a/mysql-test/include/have_cp932.inc +++ b/mysql-test/include/have_cp932.inc @@ -1,4 +1,2 @@ --- require r/have_cp932.require -disable_query_log; -show collation like 'cp932_japanese_ci'; -enable_query_log; +let collation=cp932_japanese_ci; +--source include/have_collation.inc diff --git a/mysql-test/include/have_eucjpms.inc b/mysql-test/include/have_eucjpms.inc index 6d96eefcc31..c38af5299c7 100644 --- a/mysql-test/include/have_eucjpms.inc +++ b/mysql-test/include/have_eucjpms.inc @@ -1,4 +1,2 @@ --- require r/have_eucjpms.require -disable_query_log; -show collation like 'eucjpms_japanese_ci'; -enable_query_log; +let collation=eucjpms_japanese_ci; +--source include/have_collation.inc diff --git a/mysql-test/include/have_euckr.inc b/mysql-test/include/have_euckr.inc index 4b4e870cf47..4da1a8363a3 100644 --- a/mysql-test/include/have_euckr.inc +++ b/mysql-test/include/have_euckr.inc @@ -1,4 +1,2 @@ --- require r/have_euckr.require -disable_query_log; -show collation like 'euckr_korean_ci'; -enable_query_log; +let collation=euckr_korean_ci; +--source include/have_collation.inc diff --git a/mysql-test/include/have_example_plugin.inc b/mysql-test/include/have_example_plugin.inc index a2fffc17b97..a344b79700b 100644 --- a/mysql-test/include/have_example_plugin.inc +++ b/mysql-test/include/have_example_plugin.inc @@ -5,9 +5,9 @@ --source include/have_dynamic_loading.inc # -# Check if the variable EXAMPLE_PLUGIN is set +# Check if the variable HA_EXAMPLE_SO is set # --require r/have_example_plugin.require disable_query_log; -eval select LENGTH('$EXAMPLE_PLUGIN') > 0 as 'have_example_plugin'; +eval select LENGTH('$HA_EXAMPLE_SO') > 0 as 'have_example_plugin'; enable_query_log; diff --git a/mysql-test/include/have_federated_plugin.inc b/mysql-test/include/have_federated_plugin.inc deleted file mode 100644 index 5c7549de53f..00000000000 --- a/mysql-test/include/have_federated_plugin.inc +++ /dev/null @@ -1,5 +0,0 @@ -if (`select plugin_library IS NULL from information_schema.plugins where plugin_name LIKE '%federated%'`) -{ - --skip federated plugin not available -} - diff --git a/mysql-test/include/have_gb2312.inc b/mysql-test/include/have_gb2312.inc index 27591c01b6c..6a9a0588be0 100644 --- a/mysql-test/include/have_gb2312.inc +++ b/mysql-test/include/have_gb2312.inc @@ -1,4 +1,2 @@ --- require r/have_gb2312.require -disable_query_log; -show collation like 'gb2312_chinese_ci'; -enable_query_log; +let collation=gb2312_chinese_ci; +--source include/have_collation.inc diff --git a/mysql-test/include/have_gbk.inc b/mysql-test/include/have_gbk.inc index 72252d6b00d..b8177aa655d 100644 --- a/mysql-test/include/have_gbk.inc +++ b/mysql-test/include/have_gbk.inc @@ -1,4 +1,2 @@ --- require r/have_gbk.require -disable_query_log; -show collation like 'gbk_chinese_ci'; -enable_query_log; +let collation=gbk_chinese_ci; +--source include/have_collation.inc diff --git a/mysql-test/include/have_innodb.opt b/mysql-test/include/have_innodb.opt new file mode 100644 index 00000000000..4fb96229a7b --- /dev/null +++ b/mysql-test/include/have_innodb.opt @@ -0,0 +1,2 @@ +--loose-innodb +--plugin-load=$HA_XTRADB_SO diff --git a/mysql-test/include/have_innodb_plugin.inc b/mysql-test/include/have_innodb_plugin.inc index df876deb2d7..5f67fb1f97d 100644 --- a/mysql-test/include/have_innodb_plugin.inc +++ b/mysql-test/include/have_innodb_plugin.inc @@ -1,5 +1,5 @@ ---source include/not_embedded.inc -disable_query_log; ---require r/true.require -SELECT (plugin_library LIKE 'ha_innodb_plugin%') AS `TRUE` FROM information_schema.plugins WHERE LOWER(plugin_name) = 'innodb' AND LOWER(plugin_status) = 'active'; -enable_query_log; +if (!`SELECT COUNT(*) FROM INFORMATION_SCHEMA.PLUGINS + WHERE PLUGIN_NAME = 'innodb' AND PLUGIN_STATUS = 'active' AND + (PLUGIN_LIBRARY LIKE 'ha_innodb_plugin%' OR PLUGIN_DESCRIPTION LIKE '%xtradb%')`) { + skip Need InnoDB plugin or XtraDB; +} diff --git a/mysql-test/include/have_koi8r.inc b/mysql-test/include/have_koi8r.inc index 1fe163565ba..02647f4555f 100644 --- a/mysql-test/include/have_koi8r.inc +++ b/mysql-test/include/have_koi8r.inc @@ -1,7 +1,2 @@ ---require r/have_koi8r.require - ---disable_query_log - -SHOW COLLATION LIKE 'koi8r_general_ci'; - ---enable_query_log +let collation=koi8r_general_ci; +--source include/have_collation.inc diff --git a/mysql-test/include/have_latin2_ch.inc b/mysql-test/include/have_latin2_ch.inc index 215715a6aaf..f1e0d4e26aa 100644 --- a/mysql-test/include/have_latin2_ch.inc +++ b/mysql-test/include/have_latin2_ch.inc @@ -1,4 +1,2 @@ --- require r/have_latin2_ch.require -disable_query_log; -show collation like 'latin2_czech_cs'; -enable_query_log; +let collation=latin2_czech_cs; +--source include/have_collation.inc diff --git a/mysql-test/include/have_log_bin-master.opt b/mysql-test/include/have_log_bin-master.opt new file mode 100644 index 00000000000..9ce5d80d7e8 --- /dev/null +++ b/mysql-test/include/have_log_bin-master.opt @@ -0,0 +1 @@ +--log-bin=master-bin diff --git a/mysql-test/include/have_log_bin-slave.opt b/mysql-test/include/have_log_bin-slave.opt new file mode 100644 index 00000000000..92012982830 --- /dev/null +++ b/mysql-test/include/have_log_bin-slave.opt @@ -0,0 +1 @@ +--log-bin=slave-bin diff --git a/mysql-test/include/have_log_bin.inc b/mysql-test/include/have_log_bin.inc index 369af9b8e1d..e51205d25ad 100644 --- a/mysql-test/include/have_log_bin.inc +++ b/mysql-test/include/have_log_bin.inc @@ -6,6 +6,8 @@ # # source include/have_log_bin.inc; +source include/not_embedded.inc; + -- require r/have_log_bin.require disable_query_log; show variables like 'log_bin'; diff --git a/mysql-test/include/have_exampledb.inc b/mysql-test/include/have_maria.inc index db3985e3c7c..474e9db12b9 100644 --- a/mysql-test/include/have_exampledb.inc +++ b/mysql-test/include/have_maria.inc @@ -1,4 +1,4 @@ disable_query_log; --require r/true.require -select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'example'; +select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'maria'; enable_query_log; diff --git a/mysql-test/include/have_ndb.inc b/mysql-test/include/have_ndb.inc index cfc5b5d0ff8..1266f80c8cd 100644 --- a/mysql-test/include/have_ndb.inc +++ b/mysql-test/include/have_ndb.inc @@ -1,10 +1,2 @@ # Check that server is compiled and started with support for NDB -#disable_query_log; -#--require r/true.require -#select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'ndbcluster'; -#--source include/ndb_not_readonly.inc -#enable_query_log; -# always make sure we have both mysql servers started ok before test starts -# there are some initial startup bugs that are avoided by doing this, avoiding sporadic -# failures in mysql-test-run --source include/have_multi_ndb.inc diff --git a/mysql-test/include/have_not_innodb_plugin.inc b/mysql-test/include/have_not_innodb_plugin.inc index aaefbaf661c..e40fd811021 100644 --- a/mysql-test/include/have_not_innodb_plugin.inc +++ b/mysql-test/include/have_not_innodb_plugin.inc @@ -1,4 +1,4 @@ disable_query_log; --require r/not_true.require -select (PLUGIN_LIBRARY LIKE 'ha_innodb_plugin%') as `TRUE` from information_schema.plugins where PLUGIN_NAME='InnoDB'; +select (PLUGIN_LIBRARY LIKE 'ha_innodb_plugin%' OR PLUGIN_DESCRIPTION LIKE '%xtradb%') as `TRUE` from information_schema.plugins where PLUGIN_NAME='InnoDB'; enable_query_log; diff --git a/mysql-test/include/have_pbxt.inc b/mysql-test/include/have_pbxt.inc new file mode 100644 index 00000000000..b11aee2617f --- /dev/null +++ b/mysql-test/include/have_pbxt.inc @@ -0,0 +1,5 @@ +if (!`SELECT count(*) FROM information_schema.engines WHERE + (support = 'YES' OR support = 'DEFAULT') AND + engine = 'pbxt'`){ + skip Need PBXT engine; +} diff --git a/mysql-test/include/have_pbxt.opt b/mysql-test/include/have_pbxt.opt new file mode 100644 index 00000000000..54ba9495053 --- /dev/null +++ b/mysql-test/include/have_pbxt.opt @@ -0,0 +1 @@ +--loose-pbxt diff --git a/mysql-test/include/have_pool_of_threads.inc b/mysql-test/include/have_pool_of_threads.inc new file mode 100644 index 00000000000..ab93a62d568 --- /dev/null +++ b/mysql-test/include/have_pool_of_threads.inc @@ -0,0 +1,4 @@ +-- require r/have_pool_of_threads.require +disable_query_log; +show variables like 'thread_handling'; +enable_query_log; diff --git a/mysql-test/include/have_real_innodb_plugin.inc b/mysql-test/include/have_real_innodb_plugin.inc new file mode 100644 index 00000000000..99a79465f52 --- /dev/null +++ b/mysql-test/include/have_real_innodb_plugin.inc @@ -0,0 +1,4 @@ +disable_query_log; +--require r/true.require +SELECT (plugin_library LIKE 'ha_innodb_plugin%') AS `TRUE` FROM information_schema.plugins WHERE LOWER(plugin_name) = 'innodb' AND LOWER(plugin_status) = 'active'; +enable_query_log; diff --git a/mysql-test/include/have_simple_parser.inc b/mysql-test/include/have_simple_parser.inc index 5a4dc93ec81..44187c4331b 100644 --- a/mysql-test/include/have_simple_parser.inc +++ b/mysql-test/include/have_simple_parser.inc @@ -9,5 +9,5 @@ # --require r/have_simple_parser.require disable_query_log; -eval select LENGTH('$SIMPLE_PARSER') > 0 as 'have_simple_parser'; +eval select LENGTH('$MYPLUGLIB_SO') > 0 as 'have_simple_parser'; enable_query_log; diff --git a/mysql-test/include/have_sjis.inc b/mysql-test/include/have_sjis.inc index ac6531ca868..a25dc51dfa7 100644 --- a/mysql-test/include/have_sjis.inc +++ b/mysql-test/include/have_sjis.inc @@ -1,4 +1,2 @@ --- require r/have_sjis.require -disable_query_log; -show collation like 'sjis_japanese_ci'; -enable_query_log; +let collation=sjis_japanese_ci; +--source include/have_collation.inc diff --git a/mysql-test/include/have_tis620.inc b/mysql-test/include/have_tis620.inc index ad5ba9dea69..d385ff2c621 100644 --- a/mysql-test/include/have_tis620.inc +++ b/mysql-test/include/have_tis620.inc @@ -1,4 +1,2 @@ --- require r/have_tis620.require -disable_query_log; -show collation like 'tis620_thai_ci'; -enable_query_log; +let collation=tis620_thai_ci; +--source include/have_collation.inc diff --git a/mysql-test/include/have_ucs2.inc b/mysql-test/include/have_ucs2.inc index 324ed52dd02..885e20297aa 100644 --- a/mysql-test/include/have_ucs2.inc +++ b/mysql-test/include/have_ucs2.inc @@ -1,4 +1,2 @@ --- require r/have_ucs2.require -disable_query_log; -show collation like 'ucs2_general_ci'; -enable_query_log; +let collation=ucs2_general_ci; +--source include/have_collation.inc diff --git a/mysql-test/include/have_udf.inc b/mysql-test/include/have_udf.inc index 7be57bbb7a9..cb8ba3f5ccd 100644 --- a/mysql-test/include/have_udf.inc +++ b/mysql-test/include/have_udf.inc @@ -9,5 +9,5 @@ # --require r/have_udf_example.require disable_query_log; -eval select LENGTH('$UDF_EXAMPLE_LIB') > 0 as 'have_udf_example_lib'; +eval select LENGTH('$UDF_EXAMPLE_SO') > 0 as 'have_udf_example_lib'; enable_query_log; diff --git a/mysql-test/include/have_ujis.inc b/mysql-test/include/have_ujis.inc index e4b2f50cf93..222c027ca5a 100644 --- a/mysql-test/include/have_ujis.inc +++ b/mysql-test/include/have_ujis.inc @@ -1,4 +1,2 @@ --- require r/have_ujis.require -disable_query_log; -show collation like 'ujis_japanese_ci'; -enable_query_log; +let collation=ujis_japanese_ci; +--source include/have_collation.inc diff --git a/mysql-test/include/have_utf8.inc b/mysql-test/include/have_utf8.inc index 58b74f4072f..177d39abfdc 100644 --- a/mysql-test/include/have_utf8.inc +++ b/mysql-test/include/have_utf8.inc @@ -1,7 +1,2 @@ ---require r/have_utf8.require - ---disable_query_log - -SHOW COLLATION LIKE 'utf8_general_ci'; - ---enable_query_log +let collation=utf8_general_ci; +--source include/have_collation.inc diff --git a/mysql-test/include/have_working_dns.inc b/mysql-test/include/have_working_dns.inc new file mode 100644 index 00000000000..8fed5cd3df5 --- /dev/null +++ b/mysql-test/include/have_working_dns.inc @@ -0,0 +1,11 @@ +# +# Check if we have a working DNS. +# Some 'wildcard dns' return some address even for non-existing hosts. This +# makes it hard to test connections to such host names. +# The actual check for working DNS is done in Perl, and the result available +# in an environment variable. +# +--require r/have_working_dns.require +disable_query_log; +eval SELECT LENGTH('$HAVE_BROKEN_DNS') = 0 AS 'have_working_dns'; +enable_query_log; diff --git a/mysql-test/include/have_xtradb.inc b/mysql-test/include/have_xtradb.inc new file mode 100644 index 00000000000..6c2fc5155a9 --- /dev/null +++ b/mysql-test/include/have_xtradb.inc @@ -0,0 +1,4 @@ +disable_query_log; +--require r/true.require +SELECT (plugin_description LIKE '%xtradb%') AS `TRUE` FROM information_schema.plugins WHERE LOWER(plugin_name) = 'innodb' AND LOWER(plugin_status) = 'active'; +enable_query_log; diff --git a/mysql-test/include/index_merge2.inc b/mysql-test/include/index_merge2.inc index d21562d000c..566e151dc7f 100644 --- a/mysql-test/include/index_merge2.inc +++ b/mysql-test/include/index_merge2.inc @@ -122,12 +122,14 @@ insert into t1 (key1a, key1b, key2a, key2b, key3a, key3b) analyze table t1; select count(*) from t1; +--replace_column 9 REF explain select count(*) from t1 where key1a = 2 and key1b is null and key2a = 2 and key2b is null; select count(*) from t1 where key1a = 2 and key1b is null and key2a = 2 and key2b is null; +--replace_column 9 REF explain select count(*) from t1 where key1a = 2 and key1b is null and key3a = 2 and key3b is null; diff --git a/mysql-test/include/innodb-index.inc b/mysql-test/include/innodb-index.inc new file mode 100644 index 00000000000..37de3162abe --- /dev/null +++ b/mysql-test/include/innodb-index.inc @@ -0,0 +1,26 @@ +--eval create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb default charset=$charset +insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,2,'ad','ad'),(4,4,'afe','afe'); +commit; +--error ER_DUP_ENTRY +alter table t1 add unique index (b); +insert into t1 values(8,9,'fff','fff'); +select * from t1; +show create table t1; +alter table t1 add index (b); +insert into t1 values(10,10,'kkk','iii'); +select * from t1; +select * from t1 force index(b) order by b; +explain select * from t1 force index(b) order by b; +show create table t1; +alter table t1 add unique index (c), add index (d); +insert into t1 values(11,11,'aaa','mmm'); +select * from t1; +select * from t1 force index(b) order by b; +select * from t1 force index(c) order by c; +select * from t1 force index(d) order by d; +explain select * from t1 force index(b) order by b; +explain select * from t1 force index(c) order by c; +explain select * from t1 force index(d) order by d; +show create table t1; +check table t1; +drop table t1; diff --git a/mysql-test/include/long_test.inc b/mysql-test/include/long_test.inc new file mode 100644 index 00000000000..d9a3b338229 --- /dev/null +++ b/mysql-test/include/long_test.inc @@ -0,0 +1,4 @@ +# We use this --source include to mark a test as taking long to run. +# We can use this to schedule such test early (to not be left with +# only one or two long tests running, and rests of works idle), or to +# run a quick test skipping long-running test cases. diff --git a/mysql-test/include/maria_empty_logs.inc b/mysql-test/include/maria_empty_logs.inc new file mode 100644 index 00000000000..e8b6a423953 --- /dev/null +++ b/mysql-test/include/maria_empty_logs.inc @@ -0,0 +1,94 @@ +# Maria help script. +# Cleans up all logs to give recovery a fresh start. +# +# Note that this script relies on the number of threads connect at start of +# this script, so one should run this script with a freshly started server +# for it to work. +# +# API: set mel_keep_control_file=1 if want to keep control file; +# uses vardir, port and socket. + +connection default; +let $default_db=`select database()`; +let $MYSQLD_DATADIR= `SELECT @@datadir`; + +#it will used at end of test for wait_for_status_var.inc primitive +#let $status_var= Threads_connected; +#let $status_var_value= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1); + +connection admin; +-- echo * shut down mysqld, removed logs, restarted it +append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect; +wait-maria_empty_logs.inc +EOF + +--source include/mysqladmin_shutdown.inc + +--disable_warnings +if (!$mel_keep_control_file) +{ + --error 0,1 + remove_file $MYSQLD_DATADIR/$MARIA_LOG/maria_log_control; +} +-- error 0,1 +remove_file $MYSQLD_DATADIR/$MARIA_LOG/maria_log.00000001; +-- error 0,1 +remove_file $MYSQLD_DATADIR/$MARIA_LOG/maria_log.00000002; +-- error 0,1 +remove_file $MYSQLD_DATADIR/$MARIA_LOG/maria_log.00000003; +-- error 0,1 +remove_file $MYSQLD_DATADIR/$MARIA_LOG/maria_log.00000004; +-- error 0,1 +remove_file $MYSQLD_DATADIR/$MARIA_LOG/maria_log.00000005; +-- error 0,1 +remove_file $MYSQLD_DATADIR/$MARIA_LOG/maria_log.00000006; +-- error 0,1 +remove_file $MYSQLD_DATADIR/$MARIA_LOG/maria_log.00000007; +-- error 0,1 +remove_file $MYSQLD_DATADIR/$MARIA_LOG/maria_log.00000008; +-- error 0,1 +remove_file $MYSQLD_DATADIR/$MARIA_LOG/maria_log.00000009; +-- error 0,1 +remove_file $MYSQLD_DATADIR/$MARIA_LOG/maria_log.00000010; +-- error 0,1 +remove_file $MYSQLD_DATADIR/$MARIA_LOG/maria_log.00000011; +-- error 0,1 +remove_file $MYSQLD_DATADIR/$MARIA_LOG/maria_log.00000012; +-- error 0,1 +remove_file $MYSQLD_DATADIR/$MARIA_LOG/maria_log.00000013; +-- error 0,1 +remove_file $MYSQLD_DATADIR/$MARIA_LOG/maria_log.00000014; +-- error 0,1 +remove_file $MYSQLD_DATADIR/$MARIA_LOG/maria_log.00000015; +-- error 0,1 +remove_file $MYSQLD_DATADIR/$MARIA_LOG/maria_log.00000016; +-- error 0,1 +remove_file $MYSQLD_DATADIR/$MARIA_LOG/maria_log.00000017; +-- error 0,1 +remove_file $MYSQLD_DATADIR/$MARIA_LOG/maria_log.00000018; +-- error 0,1 +remove_file $MYSQLD_DATADIR/$MARIA_LOG/maria_log.00000019; +-- error 0,1 +remove_file $MYSQLD_DATADIR/$MARIA_LOG/maria_log.00000020; +# hope there are not more than these logs... + +-- error 0,1 +remove_file $MYSQLD_DATADIR/maria_recovery.trace; +--enable_warnings + +append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect; +restart-maria_empty_logs.inc +EOF + +connection default; +--source include/wait_until_connected_again.inc + +# Make sure that all connections are restored +# This is disabled as 'Threads_connected' can't be trusted' +# (It may be affected by 'check_testcase()') +# --source include/wait_for_status_var.inc +# Restore current database as the effect of "use" was lost after restart + +--disable_query_log +eval use $default_db; +--enable_query_log diff --git a/mysql-test/include/maria_make_snapshot.inc b/mysql-test/include/maria_make_snapshot.inc new file mode 100644 index 00000000000..8f45f6b63a9 --- /dev/null +++ b/mysql-test/include/maria_make_snapshot.inc @@ -0,0 +1,53 @@ +# Maria helper script +# Copies table' data and index file to other directory, or back, or compares. +# The other directory looks like a database directory, so that we can +# read copies from inside mysqld, that's also why we copy the frm. + +# "mms" is a namespace for Maria_Make_Snapshot + +# API: +# 1) set one of +# $mms_copy : to copy table from database to spare directory +# $mms_reverse : to copy it back +# $mms_compare_physically : to compare both byte-for-byte +# 2) set $mms_tname to a string and set $mms_table_to_use to a number: tables +# will be mysqltest.$mms_tname$mms_table_to_use. +# 3) set $mms_purpose to say what this copy is for (influences the naming +# of the spare directory). + +if ($mms_copy) +{ + --echo * copied $mms_tname$mms_table_to_use for $mms_purpose + copy_file $MYSQLD_DATADIR/mysqltest/$mms_tname$mms_table_to_use.MAD $MYSQLD_DATADIR/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.MAD; + copy_file $MYSQLD_DATADIR/mysqltest/$mms_tname$mms_table_to_use.MAI $MYSQLD_DATADIR/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.MAI; + copy_file $MYSQLD_DATADIR/mysqltest/$mms_tname$mms_table_to_use.frm $MYSQLD_DATADIR/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.frm; +} + +if ($mms_reverse_copy) +{ + # do not call this without flushing target table first! + --disable_warnings + --echo * copied $mms_tname$mms_table_to_use back for $mms_purpose + -- error 0,1 + remove_file $MYSQLD_DATADIR/mysqltest/$mms_tname$mms_table_to_use.MAD; + --enable_warnings + copy_file $MYSQLD_DATADIR/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.MAD $MYSQLD_DATADIR/mysqltest/$mms_tname$mms_table_to_use.MAD; + --disable_warnings + -- error 0,1 + remove_file $MYSQLD_DATADIR/mysqltest/$mms_tname$mms_table_to_use.MAI; + --enable_warnings + copy_file $MYSQLD_DATADIR/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.MAI $MYSQLD_DATADIR/mysqltest/$mms_tname$mms_table_to_use.MAI; +} + +if ($mms_compare_physically) +{ + # After the UNDO phase this is normally impossible + # (UNDO execution has created new log records => pages have new LSNs). + # So, do this only when testing REDO phase. + # If UNDO phase, we nevertheless compare checksums + # (see maria_verify_recovery.inc). + --echo * compared $mms_tname$mms_table_to_use to old version + diff_files $MYSQLD_DATADIR/mysqltest/$mms_tname$mms_table_to_use.MAD $MYSQLD_DATADIR/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.MAD; +# index file not yet recovered +# diff_files $MYSQLD_DATADIR/mysqltest/$mms_tname$mms_table_to_use.MAI $MYSQLD_DATADIR/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.MAI; +} diff --git a/mysql-test/include/maria_make_snapshot_for_comparison.inc b/mysql-test/include/maria_make_snapshot_for_comparison.inc new file mode 100644 index 00000000000..0c71bd10408 --- /dev/null +++ b/mysql-test/include/maria_make_snapshot_for_comparison.inc @@ -0,0 +1,32 @@ +# Maria helper script +# Copies clean tables' data and index file to other directory +# Tables are $mms_tname1...$mms_tname[$mms_tables] +# They are later used as a reference to see if recovery works. + +# API: +# set $mms_tname to a string, and $mms_tables to a number N, the script will +# cover tables mysqltest.$mms_tname1,...$mms_tnameN + +connection admin; +--source include/wait_until_connected_again.inc + +let $mms_table_to_use=$mms_tables; +let $mms_purpose=comparison; +let $mms_copy=1; + +--disable_query_log +--disable_warnings +eval drop database if exists mysqltest_for_$mms_purpose; +--enable_warnings +eval create database mysqltest_for_$mms_purpose; +--enable_query_log + +while ($mms_table_to_use) +{ + # to serve as a reference, table must be in a clean state + eval flush table $mms_tname$mms_table_to_use; + -- source include/maria_make_snapshot.inc + dec $mms_table_to_use; +} +let $mms_copy=0; +connection default; diff --git a/mysql-test/include/maria_make_snapshot_for_feeding_recovery.inc b/mysql-test/include/maria_make_snapshot_for_feeding_recovery.inc new file mode 100644 index 00000000000..8a2a99c28eb --- /dev/null +++ b/mysql-test/include/maria_make_snapshot_for_feeding_recovery.inc @@ -0,0 +1,41 @@ +# Maria helper script +# Copies tables' data and index file to other directory, and control file. +# Tables are $mms_tname1...$mms_tname[$mms_tables]. +# Later, mysqld is shutdown, and that snapshot is put back into the +# datadir, control file too ("flashing recovery's brain"), and recovery is let +# to run on it (see maria_verify_recovery.inc). + +# API: +# set $mms_tname to a string, and $mms_tables to a number N, the script will +# cover tables mysqltest.$mms_tname1,...$mms_tnameN + + +connection admin; +--source include/wait_until_connected_again.inc + +let $mms_table_to_use=$mms_tables; +let $mms_purpose=feeding_recovery; +let $mms_copy=1; + +--disable_query_log +--disable_warnings +eval drop database if exists mysqltest_for_$mms_purpose; +--enable_warnings +eval create database mysqltest_for_$mms_purpose; +--enable_query_log + +while ($mms_table_to_use) +{ + -- source include/maria_make_snapshot.inc + dec $mms_table_to_use; +} +let $mms_copy=0; + +let $MYSQLD_DATADIR= `SELECT @@datadir`; +--disable_warnings +-- error 0,1 +remove_file $MYSQLTEST_VARDIR/tmp/mms_for_$mms_purpose.maria_log_control; +--enable_warnings +copy_file $MYSQLD_DATADIR/$MARIA_LOG/maria_log_control $MYSQLTEST_VARDIR/tmp/mms_for_$mms_purpose.maria_log_control; + +connection default; diff --git a/mysql-test/include/maria_verify_recovery.inc b/mysql-test/include/maria_verify_recovery.inc new file mode 100644 index 00000000000..e8354c43837 --- /dev/null +++ b/mysql-test/include/maria_verify_recovery.inc @@ -0,0 +1,97 @@ +# Maria helper script. +# Runs recovery, compare with expected table data. + +# API: +# 1) set $mms_tname to a string, and $mms_tables to a number N, the script +# will cover tables mysqltest.$mms_tname1,...$mms_tnameN +# 2) set $mvr_debug_option to the crash way +# 3) set $mvr_crash_statement to the statement which will trigger a crash +# 4) set $mvr_restore_old_snapshot to 1 if you want recovery to run on +# an old copy of tables and of the control file, 0 for normal recovery. +# 5) set $mms_compare_physically to 1 if you want a physical byte-for-byte +# comparison with expected table. Checksum comparison is always done. +# "mvr" is a namespace for Maria_Verify_Recovery + +connection admin; + +# we may do a copy-back of tables before comparison, so save comparison +# request made by caller: +let $mms_compare_physically_save=$mms_compare_physically; +let $mms_compare_physically=0; + +# warn mtr that mysqld is going to die and should not be restarted immediately +#append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect; +#wait-maria_verify_recovery.inc +#EOF +# todo: remove this "system" and uncomment above when BUG#32296 is fixed +system echo wait-maria_verify_recovery.inc >> $MYSQLTEST_VARDIR/tmp/mysqld.1.expect; + +# flush page cache and log, only log, or nothing, and kill mysqld with +# abort(). +# When we restore an old snapshot, we could just kill mysqld nicely, +# but that would implicitely commit all work, which the tester may +# not want (tester may want to observe rollback happening). + +eval SET SESSION debug=$mvr_debug_option; +--echo * crashing mysqld intentionally +--error 2013 +eval $mvr_crash_statement; # this will crash (DBUG magic) + +if ($mvr_restore_old_snapshot) +{ + + # copy snapshot made by maria_make_snapshot_for_feeding_recovery back + # into datadir. + + let $mms_table_to_use=$mms_tables; + let $mms_purpose=feeding_recovery; + let $mms_reverse_copy=1; + while ($mms_table_to_use) + { + -- source include/maria_make_snapshot.inc + dec $mms_table_to_use; + } + let $mms_reverse_copy=0; + + # also copy back control file, to force recovery to start from an early + # point, ignoring further checkpoints. + -- error 0,1 + remove_file $MYSQLD_DATADIR/$MARIA_LOG/maria_log_control; + copy_file $MYSQLTEST_VARDIR/tmp/mms_for_$mms_purpose.maria_log_control $MYSQLD_DATADIR/$MARIA_LOG/maria_log_control; +} + +--echo * recovery happens +# let mtr restart mysqld (and thus execute the maria log) +#append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect; +#restart-maria_verify_recovery.inc +#EOF +system echo restart-maria_verify_recovery.inc >> $MYSQLTEST_VARDIR/tmp/mysqld.1.expect; + +--source include/wait_until_connected_again.inc + +# Compare that tables of $mms_tables are identical to old. +# We always compare with CHECKSUM TABLE, and if requested (which makes sense +# only for testing the REDO phase, as UNDO phase generates new records so new +# LSNs on pages.) with a physical byte-for-byte comparison. +let $mms_table_to_use=$mms_tables; +let $mms_purpose=comparison; +let $mms_compare_physically=$mms_compare_physically_save; +while ($mms_table_to_use) +{ + eval check table $mms_tname$mms_table_to_use extended; + --echo * testing that checksum after recovery is as expected + let $new_checksum=`CHECKSUM TABLE $mms_tname$mms_table_to_use`; + let $old_checksum=`CHECKSUM TABLE mysqltest_for_$mms_purpose.$mms_tname$mms_table_to_use`; + # the $ text variables above are of the form "db.tablename\tchecksum", + # as db differs, we use substring(). + --disable_query_log + eval select if(substring("$new_checksum",instr("$new_checksum",".t1")) = substring("$old_checksum",instr("$old_checksum",".t1")),"ok","failure") as "Checksum-check"; + --enable_query_log + # this script may compare physically or do nothing + -- source include/maria_make_snapshot.inc + dec $mms_table_to_use; +} + +connection default; +# the effect of "use" is lost after a restart so we are back into db "test" +use mysqltest; diff --git a/mysql-test/include/mix1.inc b/mysql-test/include/mix1.inc index 10f0d4546ed..f408544ef59 100644 --- a/mysql-test/include/mix1.inc +++ b/mysql-test/include/mix1.inc @@ -1363,7 +1363,17 @@ INSERT INTO t1 VALUES (1,'init'); DELIMITER |; CREATE PROCEDURE p1() BEGIN - UPDATE t1 SET b = CONCAT(b, '+con2') WHERE a = 1; + # retry the UPDATE in case it times out the lock before con1 has time + # to COMMIT. + DECLARE do_retry INT DEFAULT 0; + DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET do_retry = 1; + retry_loop:LOOP + UPDATE t1 SET b = CONCAT(b, '+con2') WHERE a = 1; + IF do_retry = 0 THEN + LEAVE retry_loop; + END IF; + SET do_retry = 0; + END LOOP; INSERT INTO t2 VALUES (); END| DELIMITER ;| diff --git a/mysql-test/include/mix2.inc b/mysql-test/include/mix2.inc index 123d049855a..ba11937dfb9 100644 --- a/mysql-test/include/mix2.inc +++ b/mysql-test/include/mix2.inc @@ -1222,7 +1222,7 @@ drop table t2; # Clean up filename -- embedded server reports whole path without .frm, # regular server reports relative path with .frm (argh!) ---replace_result \\ / $MYSQL_TEST_DIR . /var/master-data/ / t2.frm t2 +--replace_result \\ / $MYSQL_TEST_DIR . /var/mysqld.1/data/ / t2.frm t2 --error 1005 eval create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = $engine_type; @@ -1467,7 +1467,7 @@ source include/varchar.inc; # Clean up filename -- embedded server reports whole path without .frm, # regular server reports relative path with .frm (argh!) ---replace_result \\ / $MYSQL_TEST_DIR . /var/master-data/ / t1.frm t1 +--replace_result \\ / $MYSQL_TEST_DIR . /var/mysqld.1/data/ / t1.frm t1 create table t1 (v varchar(65530), key(v)); drop table t1; create table t1 (v varchar(65536)); @@ -1778,7 +1778,7 @@ if ($test_foreign_keys) set foreign_key_checks=0; eval create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = $engine_type; ---replace_result $MYSQLTEST_VARDIR . master-data/ '' +--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ '' -- error 1005 eval create table t1(a char(10) primary key, b varchar(20)) engine = $engine_type; set foreign_key_checks=1; @@ -1789,7 +1789,7 @@ drop table t2; set foreign_key_checks=0; eval create table t1(a varchar(10) primary key) engine = $engine_type DEFAULT CHARSET=latin1; ---replace_result $MYSQLTEST_VARDIR . master-data/ '' +--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ '' -- error 1005 eval create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = $engine_type DEFAULT CHARSET=utf8; set foreign_key_checks=1; @@ -1819,7 +1819,7 @@ drop table t2,t1; set foreign_key_checks=0; eval create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = $engine_type DEFAULT CHARSET=latin1; eval create table t3(a varchar(10) primary key) engine = $engine_type DEFAULT CHARSET=utf8; ---replace_result $MYSQLTEST_VARDIR . master-data/ '' +--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ '' -- error 1025 rename table t3 to t1; set foreign_key_checks=1; diff --git a/mysql-test/include/mtr_check.sql b/mysql-test/include/mtr_check.sql index 71d1137d833..f5af58fc577 100644 --- a/mysql-test/include/mtr_check.sql +++ b/mysql-test/include/mtr_check.sql @@ -1,4 +1,4 @@ --- Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. +-- Copyright (c) 2008, 2011, Oracle and/or its affiliates -- -- 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 @@ -27,8 +27,11 @@ BEGIN -- Dump all global variables except those -- that are supposed to change SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE variable_name NOT IN ('timestamp', 'innodb_file_format_check') - ORDER BY VARIABLE_NAME; + WHERE variable_name != 'timestamp' + AND variable_name not like "Last_IO_Err*" + AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND + variable_name != 'INNODB_FILE_FORMAT_CHECK' + ORDER BY variable_name; -- Dump all databases, there should be none -- except those that was created during bootstrap diff --git a/mysql-test/include/mtr_warnings.sql b/mysql-test/include/mtr_warnings.sql index 950d9c64a16..b8b4f60224c 100644 --- a/mysql-test/include/mtr_warnings.sql +++ b/mysql-test/include/mtr_warnings.sql @@ -1,4 +1,4 @@ --- Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. +-- Copyright (c) 2008, 2011, Oracle and/or its affiliates -- -- 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 @@ -154,6 +154,17 @@ INSERT INTO global_suppressions VALUES ("Slave: Unknown table 't1' Error_code: 1051"), + /* Maria storage engine dependent tests */ + + /* maria-recovery.test has warning about missing log file */ + ("File '.*maria_log.000.*' not found \\(Errcode: 2\\)"), + /* and about marked-corrupted table */ + ("Table '..mysqltest.t_corrupted1' is crashed, skipping it. Please repair"), + /* maria-recover.test corrupts tables on purpose */ + ("Checking table: '..mysqltest.t_corrupted2'"), + ("Table '..mysqltest.t_corrupted2' is marked as crashed and should be"), + ("Incorrect key file for table '..mysqltest.t_corrupted2.MAI'"), + /* Messages from valgrind */ ("==[0-9]*== Memcheck,"), ("==[0-9]*== Copyright"), diff --git a/mysql-test/include/mysqladmin_shutdown.inc b/mysql-test/include/mysqladmin_shutdown.inc new file mode 100644 index 00000000000..16b33c2baf8 --- /dev/null +++ b/mysql-test/include/mysqladmin_shutdown.inc @@ -0,0 +1,7 @@ +# Initiates a clean shutdown of the server and waits for its completion + +--exec $MYSQLADMIN --no-defaults -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= shutdown 2>&1; + +# On Windows mysqladmin does not wait for shutdown to be finished, +# so we have to monitor this with our connection: +--source include/wait_until_disconnected.inc diff --git a/mysql-test/include/mysqlhotcopy.inc b/mysql-test/include/mysqlhotcopy.inc index fcf57a68644..779ed7f36e0 100644 --- a/mysql-test/include/mysqlhotcopy.inc +++ b/mysql-test/include/mysqlhotcopy.inc @@ -89,7 +89,9 @@ USE hotcopy_test; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --list_files $MYSQLTEST_VARDIR/tmp/hotcopy_test #--exec rm -rf $MYSQLTEST_VARDIR/tmp/hotcopy_test +--disable_warnings --remove_files_wildcard $MYSQLTEST_VARDIR/tmp/hotcopy_test * +--enable_warnings --rmdir $MYSQLTEST_VARDIR/tmp/hotcopy_test # backup without full index files diff --git a/mysql-test/include/ndb_backup.inc b/mysql-test/include/ndb_backup.inc index 5262f1231a2..eef3bf2bd1e 100644 --- a/mysql-test/include/ndb_backup.inc +++ b/mysql-test/include/ndb_backup.inc @@ -18,8 +18,10 @@ CREATE TABLE helper1(c1 VARCHAR(20)); # dump raw data to file let $ndb_backup_file1= $MYSQLTEST_VARDIR/ndb_backup_tmp.dat; let $ndb_backup_file2= $MYSQLTEST_VARDIR/tmp.dat; +--disable_warnings --error 0,1 --remove_file $ndb_backup_file1 +--enable_warnings --exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="$NDB_CONNECTSTRING" -d sys --delimiter=',' SYSTAB_0 > $ndb_backup_file1 # load the table from the raw data file eval LOAD DATA INFILE '$ndb_backup_file1' INTO TABLE helper1; diff --git a/mysql-test/include/ndb_backup_print.inc b/mysql-test/include/ndb_backup_print.inc index 7527f125686..69faa8f421b 100644 --- a/mysql-test/include/ndb_backup_print.inc +++ b/mysql-test/include/ndb_backup_print.inc @@ -1,7 +1,9 @@ --exec $NDB_TOOLS_DIR/ndb_restore --no-defaults $ndb_restore_opts -b $the_backup_id -n 1 $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id $ndb_restore_filter > $MYSQLTEST_VARDIR/tmp/tmp.dat --exec $NDB_TOOLS_DIR/ndb_restore --no-defaults $ndb_restore_opts -b $the_backup_id -n 2 $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id $ndb_restore_filter >> $MYSQLTEST_VARDIR/tmp/tmp.dat --exec sort $MYSQLTEST_VARDIR/tmp/tmp.dat +--disable_warnings --error 0,1 --remove_file $MYSQLTEST_VARDIR/tmp/tmp.dat +--enable_warnings --let ndb_restore_opts= --let ndb_restore_filter= diff --git a/mysql-test/include/not_debug.inc b/mysql-test/include/not_debug.inc new file mode 100644 index 00000000000..5ea01fe2935 --- /dev/null +++ b/mysql-test/include/not_debug.inc @@ -0,0 +1,6 @@ +let $is_debug = `select version() like '%debug%'`; +if ($is_debug) +{ + skip Does not run in with debug binaries; +} + diff --git a/mysql-test/include/not_staging.inc b/mysql-test/include/not_staging.inc new file mode 100644 index 00000000000..bd3813ead2f --- /dev/null +++ b/mysql-test/include/not_staging.inc @@ -0,0 +1,4 @@ +--require r/not_staging.require +disable_query_log; +eval select $STAGING_RUN as using_staging_run; +enable_query_log; diff --git a/mysql-test/include/ps_conv.inc b/mysql-test/include/ps_conv.inc index 195d1061664..9ac943d5bdd 100644 --- a/mysql-test/include/ps_conv.inc +++ b/mysql-test/include/ps_conv.inc @@ -30,6 +30,9 @@ --disable_warnings drop table if exists t5 ; --enable_warnings +--disable_query_log +SET TIME_ZONE= '+03:00'; +--enable_query_log set @arg01= 8; set @arg02= 8.0; set @arg03= 80.00000000000e-1; @@ -52,7 +55,7 @@ set @arg14= 'abc'; set @arg14= NULL ; set @arg15= CAST('abc' as binary) ; set @arg15= NULL ; -create table t5 as select +eval create table t5 engine = MyISAM as select 8 as const01, @arg01 as param01, 8.0 as const02, @arg02 as param02, 80.00000000000e-1 as const03, @arg03 as param03, diff --git a/mysql-test/include/read_many_rows.inc b/mysql-test/include/read_many_rows.inc index ff57c0ca13d..d40086b01df 100644 --- a/mysql-test/include/read_many_rows.inc +++ b/mysql-test/include/read_many_rows.inc @@ -71,8 +71,8 @@ CREATE TRIGGER t1_bi before INSERT BEGIN DECLARE CONTINUE HANDLER FOR SQLSTATE '40001' SET @a:= 'deadlock'; DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET @a:= 'exception'; - INSERT INTO t2 (f2) VALUES (1); - DELETE FROM t2 WHERE f2 = 1; + INSERT INTO t2 (f2) VALUES (NEW.f1); + DELETE FROM t2 WHERE f2 = NEW.f1; END;| CREATE PROCEDURE proc24989() @@ -109,7 +109,7 @@ send insert into t1 values(1); connection con1; --sleep 1 -insert into t1 values(1); +insert into t1 values(123); connection con2; --error 1213 @@ -130,7 +130,7 @@ send call proc24989(); connection con1; --sleep 1 -insert into t1 values(1); +insert into t1 values(123); connection con2; reap; @@ -150,7 +150,7 @@ send call proc24989_2(); connection con1; --sleep 1 -insert into t1 values(1); +insert into t1 values(123); commit; connection con2; diff --git a/mysql-test/include/restart_slave_sql.inc b/mysql-test/include/restart_slave_sql.inc index ee6c6d7ced6..55e87f4b57f 100644 --- a/mysql-test/include/restart_slave_sql.inc +++ b/mysql-test/include/restart_slave_sql.inc @@ -40,4 +40,4 @@ source include/wait_for_slave_sql_to_start.inc; --let $include_filename= restart_slave.inc ---source include/end_include_file.inc
\ No newline at end of file +--source include/end_include_file.inc diff --git a/mysql-test/include/rpl_connection_master.inc b/mysql-test/include/rpl_connection_master.inc index e54e34071c8..fa09cc8a610 100644 --- a/mysql-test/include/rpl_connection_master.inc +++ b/mysql-test/include/rpl_connection_master.inc @@ -1,2 +1,2 @@ let $rpl_connection_name= master; -source include/rpl_connection.inc;
\ No newline at end of file +source include/rpl_connection.inc; diff --git a/mysql-test/include/rpl_connection_slave.inc b/mysql-test/include/rpl_connection_slave.inc index ef3876394d6..8dcfb3b611b 100644 --- a/mysql-test/include/rpl_connection_slave.inc +++ b/mysql-test/include/rpl_connection_slave.inc @@ -1,2 +1,2 @@ let $rpl_connection_name= slave; -source include/rpl_connection.inc;
\ No newline at end of file +source include/rpl_connection.inc; diff --git a/mysql-test/include/rpl_connection_slave1.inc b/mysql-test/include/rpl_connection_slave1.inc index 8aee6defbdd..a408d14596b 100644 --- a/mysql-test/include/rpl_connection_slave1.inc +++ b/mysql-test/include/rpl_connection_slave1.inc @@ -1,2 +1,2 @@ let $rpl_connection_name= slave1; -source include/rpl_connection.inc;
\ No newline at end of file +source include/rpl_connection.inc; diff --git a/mysql-test/include/rpl_udf.inc b/mysql-test/include/rpl_udf.inc index 30f39d79d49..3b4ddc2b897 100644 --- a/mysql-test/include/rpl_udf.inc +++ b/mysql-test/include/rpl_udf.inc @@ -27,13 +27,13 @@ drop table if exists t1; --echo "*** Test 1) Test UDFs via loadable libraries *** --echo "Running on the master" --enable_info ---replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB -eval CREATE FUNCTION myfunc_double RETURNS REAL SONAME "$UDF_EXAMPLE_LIB"; ---replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB -eval CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "$UDF_EXAMPLE_LIB"; ---replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB +--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB +eval CREATE FUNCTION myfunc_double RETURNS REAL SONAME "$UDF_EXAMPLE_SO"; +--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB +eval CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "$UDF_EXAMPLE_SO"; +--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB --error ER_CANT_FIND_DL_ENTRY -eval CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "$UDF_EXAMPLE_LIB"; +eval CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "$UDF_EXAMPLE_SO"; --replace_column 3 UDF_LIB SELECT * FROM mysql.func ORDER BY name; --disable_info diff --git a/mysql-test/include/varchar.inc b/mysql-test/include/varchar.inc index 15306ed8385..4501659158d 100644 --- a/mysql-test/include/varchar.inc +++ b/mysql-test/include/varchar.inc @@ -11,6 +11,11 @@ enable_query_log; # Simple basic test that endspace is saved # +# +# Remember to check that one doesn't get a warning or a note +# from a char field when end spaces get removed. SQL standard! +# + create table t1 (v varchar(10), c char(10), t text); insert into t1 values('+ ', '+ ', '+ '); set @a=repeat(' ',20); @@ -81,6 +86,8 @@ explain select count(*) from t1 where v between 'a' and 'a '; --replace_column 9 # explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; +# Which duplicate entry triggers error is not deterministic. +--replace_regex /Duplicate entry '[^']+' for key/Duplicate entry '{ ' for key/ --error ER_DUP_ENTRY alter table t1 add unique(v); alter table t1 add key(v); diff --git a/mysql-test/include/wait_for_status_var.inc b/mysql-test/include/wait_for_status_var.inc index 9f4962aeaed..c3d6599e4d2 100644 --- a/mysql-test/include/wait_for_status_var.inc +++ b/mysql-test/include/wait_for_status_var.inc @@ -51,11 +51,12 @@ if (!$_status_var_comparsion) } let $_show_status_value= query_get_value("SHOW $status_type STATUS LIKE '$status_var'", Value, 1); + while (`SELECT NOT('$_show_status_value' $_status_var_comparsion '$status_var_value')`) { if (!$_status_timeout_counter) { - --echo **** ERROR: failed while waiting for $status_type $status_var $_status_var_comparison $status_var_value **** + --echo **** ERROR: failed while waiting for '$status_type' '$status_var' $_status_var_comparsion '$status_var_value' **** --echo Note: the following output may have changed since the failure was detected --echo **** Showing STATUS, PROCESSLIST **** eval SHOW $status_type STATUS LIKE '$status_var'; diff --git a/mysql-test/include/wait_until_connected_again.inc b/mysql-test/include/wait_until_connected_again.inc index c7bb774929a..aff92141a8b 100644 --- a/mysql-test/include/wait_until_connected_again.inc +++ b/mysql-test/include/wait_until_connected_again.inc @@ -1,9 +1,13 @@ # # Include this script to wait until the connection to the -# server has been restored or timeout occurs +# server has been restored or timeout occurs. +# You should have done --enable_reconnect first +# When you change this file you may have to chance its cousin +# wait_until_disconnected.inc + --disable_result_log --disable_query_log -let $counter= 500; +let $counter= 5000; let $mysql_errno= 9999; while ($mysql_errno) { diff --git a/mysql-test/include/wait_until_disconnected.inc b/mysql-test/include/wait_until_disconnected.inc index 8a989becc18..c274fbbe089 100644 --- a/mysql-test/include/wait_until_disconnected.inc +++ b/mysql-test/include/wait_until_disconnected.inc @@ -1,12 +1,17 @@ -# -# Include this script to wait until the connection to the -# server has been dropped +# Include this script after a shutdown to wait until the connection +# to the server has been lost or timeout occurs. +# When you change this file you may have to chance its cousin +# wait_until_connected_again.inc + --disable_result_log --disable_query_log -let $counter= 500; +let $counter= 600; let $mysql_errno= 0; while (!$mysql_errno) { + # Strangely enough, the server might return "Too many connections" + # while being shutdown, thus 1040 is an "allowed" error. + # See BUG#36228. --error 0,1040,1053,2002,2003,2006,2013 show status; @@ -15,7 +20,7 @@ while (!$mysql_errno) { --die Server failed to dissapear } - --sleep 0.1 + --real_sleep 0.1 } --enable_query_log --enable_result_log |