diff options
author | Sergei Golubchik <sergii@pisem.net> | 2014-03-15 18:24:15 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2014-03-15 18:24:15 +0100 |
commit | d7304375e5e0ce30979c2b92e70eb0effaa30a25 (patch) | |
tree | bb9d05f40e948d4b027f4da9c007c433a16fa1a6 /mysql-test | |
parent | cd29dc98216d822ad701d604b3eda886e1db2aaa (diff) | |
parent | e0f3a0fae98bea144b962ef8dbbe62e0935aebb1 (diff) | |
download | mariadb-git-d7304375e5e0ce30979c2b92e70eb0effaa30a25.tar.gz |
mysql-5.1.73 merge
Diffstat (limited to 'mysql-test')
50 files changed, 525 insertions, 178 deletions
diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index 119e1e75260..bd016e3d691 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -1,5 +1,5 @@ -# Copyright (c) 2000, 2011, Oracle and/or its affiliates. -# Copyright (c) 2009-2011, Monty Program Ab +# Copyright (c) 2000, 2013, Oracle and/or its affiliates. +# Copyright (c) 2009, 2013, Monty Program Ab # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public diff --git a/mysql-test/include/default_my.cnf b/mysql-test/include/default_my.cnf index 6fd7a082f05..a5a5238c84b 100644 --- a/mysql-test/include/default_my.cnf +++ b/mysql-test/include/default_my.cnf @@ -1,4 +1,4 @@ -# Copyright (c) 2007 MySQL AB, 2009, 2010 Sun Microsystems, Inc. +# Copyright (c) 2007 MySQL AB # # 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 diff --git a/mysql-test/include/default_mysqld.cnf b/mysql-test/include/default_mysqld.cnf index 921f3c4b009..b1ef0fac897 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 +# Copyright (c) 2007, 2008 MySQL AB # # 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 diff --git a/mysql-test/include/have_innodb_change_buffering.inc b/mysql-test/include/have_innodb_change_buffering.inc new file mode 100644 index 00000000000..aadad84c6a1 --- /dev/null +++ b/mysql-test/include/have_innodb_change_buffering.inc @@ -0,0 +1,6 @@ +if (!`SHOW VARIABLES LIKE 'innodb_change_buffering_debug'`) +{ + # innodb_change_buffering_debug is enabled by UNIV_DEBUG or + # UNIV_IBUF_DEBUG + --skip Test requires binary with UNIV_DEBUG enabled +} diff --git a/mysql-test/include/have_valgrind.inc b/mysql-test/include/have_valgrind.inc new file mode 100644 index 00000000000..8374c2ed4f0 --- /dev/null +++ b/mysql-test/include/have_valgrind.inc @@ -0,0 +1,11 @@ +# include/have_valgrind.inc +# +# If some test should be run with only valgrind then skip it while running test +# without it. +# + +if (!$VALGRIND_TEST) { + --skip Need "--valgrind" +} + + diff --git a/mysql-test/include/rpl_init.inc b/mysql-test/include/rpl_init.inc index 3cf78dc2979..8325b2937b6 100644 --- a/mysql-test/include/rpl_init.inc +++ b/mysql-test/include/rpl_init.inc @@ -7,7 +7,6 @@ # well as extra connections server_1_1, server_2_1, ..., # server_N_1. server_I and server_I_1 are connections to the same # server. -# - Sets up @@auto_increment_increment and @@auto_increment_increment. # - Verifies that @@server_id of all servers are different. # - Calls RESET MASTER, RESET SLAVE, USE test, CHANGE MASTER, START SLAVE. # - Sets the connection to server_1 before exiting. @@ -179,8 +178,6 @@ while ($_rpl_server) RESET MASTER; RESET SLAVE; } - eval SET auto_increment_increment= $rpl_server_count; - eval SET auto_increment_offset= $_rpl_server; --dec $_rpl_server } diff --git a/mysql-test/include/search_pattern_in_file.inc b/mysql-test/include/search_pattern_in_file.inc new file mode 100644 index 00000000000..c047b5bc499 --- /dev/null +++ b/mysql-test/include/search_pattern_in_file.inc @@ -0,0 +1,66 @@ +# Purpose: +# Simple search with Perl for a pattern in some file. +# +# The advantages compared to thinkable auxiliary constructs using the +# mysqltest language and SQL are: +# 1. We do not need a running MySQL server. +# 2. SQL causes "noise" during debugging and increases the size of logs. +# Perl code does not disturb at all. +# +# The environment variables SEARCH_FILE and SEARCH_PATTERN must be set +# before sourcing this routine. +# +# In case of +# - SEARCH_FILE and/or SEARCH_PATTERN is not set +# - SEARCH_FILE cannot be opened +# - SEARCH_FILE does not contain SEARCH_PATTERN +# the test will abort immediate. +# MTR will report something like +# .... +# worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009 +# main.1st [ pass ] 3 +# innodb.innodb_page_size [ fail ] +# Test ended at 2011-11-11 18:15:58 +# +# CURRENT_TEST: innodb.innodb_page_size +# # ERROR: The file '<name>' does not contain the expected pattern <pattern> +# mysqltest: In included file "./include/search_pattern_in_file.inc": +# included from ./include/search_pattern_in_file.inc at line 36: +# At line 25: command "perl" failed with error 255. my_errno=175 +# +# The result from queries just before the failure was: +# ... +# - saving '<some path>' to '<some path>' +# main.1st [ pass ] 2 +# +# Typical use case (check invalid server startup options): +# let $error_log= $MYSQLTEST_VARDIR/log/my_restart.err; +# --error 0,1 +# --remove_file $error_log +# let SEARCH_FILE= $error_log; +# # Stop the server +# let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect; +# --exec echo "wait" > $restart_file +# --shutdown_server 10 +# --source include/wait_until_disconnected.inc +# +# --error 1 +# --exec $MYSQLD_CMD <whatever wrong setting> > $error_log 2>&1 +# # The server restart aborts +# let SEARCH_PATTERN= \[ERROR\] Aborting; +# --source include/search_pattern_in_file.inc +# +# Created: 2011-11-11 mleich +# + +perl; + use strict; + my $search_file= $ENV{'SEARCH_FILE'} or die "SEARCH_FILE not set"; + my $search_pattern= $ENV{'SEARCH_PATTERN'} or die "SEARCH_PATTERN not set"; + open(FILE, "$search_file") or die("Unable to open '$search_file': $!\n"); + read(FILE, my $file_content, 50000, 0); + close(FILE); + if ( not $file_content =~ m{$search_pattern} ) { + die("# ERROR: The file '$search_file' does not contain the expected pattern $search_pattern\n->$file_content<-\n"); + } +EOF diff --git a/mysql-test/lib/My/Find.pm b/mysql-test/lib/My/Find.pm index a636b0e88f7..6ab8d8a7279 100644 --- a/mysql-test/lib/My/Find.pm +++ b/mysql-test/lib/My/Find.pm @@ -1,5 +1,5 @@ # -*- cperl -*- -# Copyright (c) 2007, 2011, Oracle and/or its affiliates. +# Copyright (c) 2007, 2012, 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 diff --git a/mysql-test/lib/My/SafeProcess/CMakeLists.txt b/mysql-test/lib/My/SafeProcess/CMakeLists.txt index 5150fcaafff..8a5338a20be 100644 --- a/mysql-test/lib/My/SafeProcess/CMakeLists.txt +++ b/mysql-test/lib/My/SafeProcess/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008 MySQL AB +# Copyright (c) 2007 MySQL AB # # 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 diff --git a/mysql-test/lib/My/SafeProcess/safe_process.cc b/mysql-test/lib/My/SafeProcess/safe_process.cc index 69756cd94c6..d852b9d25b8 100644 --- a/mysql-test/lib/My/SafeProcess/safe_process.cc +++ b/mysql-test/lib/My/SafeProcess/safe_process.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2010, Oracle and/or its affiliates +/* Copyright (c) 2008, 2012, 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 diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm index a09f8048324..9696901af20 100644 --- a/mysql-test/lib/mtr_cases.pm +++ b/mysql-test/lib/mtr_cases.pm @@ -1,5 +1,5 @@ # -*- cperl -*- -# Copyright (c) 2005, 2011, Oracle and/or its affiliates +# Copyright (c) 2005, 2012, 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 diff --git a/mysql-test/lib/mtr_match.pm b/mysql-test/lib/mtr_match.pm index 6fc9832ac43..b5f512d77e0 100644 --- a/mysql-test/lib/mtr_match.pm +++ b/mysql-test/lib/mtr_match.pm @@ -1,5 +1,5 @@ # -*- cperl -*- -# Copyright (C) 2004-2008 MySQL AB +# Copyright (c) 2004, 2006, 2008 MySQL AB # # 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 diff --git a/mysql-test/lib/v1/mysql-test-run.pl b/mysql-test/lib/v1/mysql-test-run.pl index 0e47ec885bd..dec0da4ea33 100755 --- a/mysql-test/lib/v1/mysql-test-run.pl +++ b/mysql-test/lib/v1/mysql-test-run.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl # -*- cperl -*- -# Copyright (c) 2008, 2009 Sun Microsystems, Inc. +# Copyright (c) 2008-2010 Sun Microsystems, Inc. # Use is subject to license terms. # # This program is free software; you can redistribute it and/or modify @@ -4172,7 +4172,7 @@ sub mysqld_arguments ($$$$) { } mtr_add_arg($args, "%s--key_buffer_size=1M", $prefix); - mtr_add_arg($args, "%s--sort_buffer=256K", $prefix); + mtr_add_arg($args, "%s--sort_buffer_size=256K", $prefix); mtr_add_arg($args, "%s--max_heap_table_size=1M", $prefix); if ( $opt_ssl_supported ) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 60725b4448e..775480240b5 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1,8 +1,8 @@ #!/usr/bin/perl # -*- cperl -*- -# Copyright (c) 2004, 2012, Oracle and/or its affiliates. -# Copyright (c) 2009, 2011, Monty Program Ab +# Copyright (c) 2004, 2013, Oracle and/or its affiliates. +# Copyright (c) 2009, 2013, Monty Program Ab # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public @@ -664,9 +664,11 @@ sub run_test_server ($$$) { mtr_report("\nRetrying test $tname, ". "attempt($retries/$opt_retry)...\n"); #saving the log file as filename.failed in case of retry - my $worker_logdir= $result->{savedir}; - my $log_file_name=dirname($worker_logdir)."/".$result->{shortname}.".log"; - rename $log_file_name,$log_file_name.".failed"; + if ( $result->is_failed() ) { + my $worker_logdir= $result->{savedir}; + my $log_file_name=dirname($worker_logdir)."/".$result->{shortname}.".log"; + rename $log_file_name,$log_file_name.".failed"; + } delete($result->{result}); $result->{retries}= $retries+1; $result->write_test($sock, 'TESTCASE'); @@ -1901,7 +1903,17 @@ sub executable_setup () { } else { - $exe_mysqltest= mtr_exe_exists("$path_client_bindir/mysqltest"); + if ( defined $ENV{'MYSQL_TEST'} ) + { + $exe_mysqltest=$ENV{'MYSQL_TEST'}; + print "===========================================================\n"; + print "WARNING:The mysqltest binary is fetched from $exe_mysqltest\n"; + print "===========================================================\n"; + } + else + { + $exe_mysqltest= mtr_exe_exists("$path_client_bindir/mysqltest"); + } } } @@ -3851,6 +3863,7 @@ my %old_env; sub run_testcase ($$) { my ($tinfo, $server_socket)= @_; + my $print_freq=20; mtr_verbose("Running test:", $tinfo->{name}); @@ -4028,6 +4041,7 @@ sub run_testcase ($$) { my $test= start_mysqltest($tinfo); # Set only when we have to keep waiting after expectedly died server my $keep_waiting_proc = 0; + my $print_timeout= start_timer($print_freq * 60); while (1) { @@ -4052,7 +4066,22 @@ sub run_testcase ($$) { } if (! $keep_waiting_proc) { - $proc= My::SafeProcess->wait_any_timeout($test_timeout); + if($test_timeout > $print_timeout) + { + $proc= My::SafeProcess->wait_any_timeout($print_timeout); + if ( $proc->{timeout} ) + { + #print out that the test is still on + mtr_print("Test still running: $tinfo->{name}"); + #reset the timer + $print_timeout= start_timer($print_freq * 60); + next; + } + } + else + { + $proc= My::SafeProcess->wait_any_timeout($test_timeout); + } } # Will be restored if we need to keep waiting diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index d7a7503707b..fc0d79e9568 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -477,4 +477,22 @@ WHERE CAST(a as BINARY)=x'62736D697468' AND CAST(a AS BINARY)=x'65736D697468'; a DROP TABLE t1; +# +# Bug#13581962 HIGH MEMORY USAGE ATTEMPT, THEN CRASH WITH +# LONGTEXT, UNION, USER VARIABLE +# Bug#14096619 UNABLE TO RESTORE DATABASE DUMP +# +CREATE TABLE t1 AS SELECT CONCAT(CAST(REPEAT('9', 1000) AS SIGNED)), +CONCAT(CAST(REPEAT('9', 1000) AS UNSIGNED)); +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999' +Warning 1292 Truncated incorrect INTEGER value: '99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999' +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `CONCAT(CAST(REPEAT('9', 1000) AS SIGNED))` varbinary(21) NOT NULL DEFAULT '', + `CONCAT(CAST(REPEAT('9', 1000) AS UNSIGNED))` varbinary(21) NOT NULL DEFAULT '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# End of test for Bug#13581962, Bug#14096619 End of 5.1 tests diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index db2c3430784..c2a5c1f4666 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -2617,13 +2617,13 @@ Warning 1292 Truncated incorrect DECIMAL value: '' # and other crashes # CREATE TABLE t1 ( a TEXT ); -SELECT 'aaaaaaaaaaaaaa' INTO OUTFILE 'bug58165.txt'; +SELECT 'aaaaaaaaaaaaaa' INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug58165.txt';; SELECT insert( substring_index( 'a', 'a', 'b' ), 1, 0, 'x' ); insert( substring_index( 'a', 'a', 'b' ), 1, 0, 'x' ) x Warnings: Warning 1292 Truncated incorrect INTEGER value: 'b' -LOAD DATA INFILE 'bug58165.txt' INTO TABLE t1; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug58165.txt' INTO TABLE t1;; SELECT * FROM t1; a aaaaaaaaaaaaaa diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result index e7636573201..78d03f5ad30 100644 --- a/mysql-test/r/join_outer.result +++ b/mysql-test/r/join_outer.result @@ -1595,4 +1595,36 @@ EXECUTE prep_stmt; f 1 DROP TABLE t1; +# +# Bug#13068506 - QUERY WITH GROUP BY ON NON-AGGR COLUMN RETURNS +# WRONG RESULT +# +CREATE TABLE t1 (i1 int); +INSERT INTO t1 VALUES (100), (101); +CREATE TABLE t2 (i2 int, i3 int); +INSERT INTO t2 VALUES (20,1),(10,2); +CREATE TABLE t3 (i4 int(11)); +INSERT INTO t3 VALUES (1),(2); + +SELECT ( +SELECT MAX( t2.i2 ) +FROM t3 RIGHT JOIN t2 ON ( t2.i3 = 2 ) +WHERE t2.i3 <> t1.i1 +) AS field1 +FROM t1;; +field1 +20 +20 + +SELECT ( +SELECT MAX( t2.i2 ) +FROM t3 RIGHT JOIN t2 ON ( t2.i3 = 2 ) +WHERE t2.i3 <> t1.i1 +) AS field1 +FROM t1 GROUP BY field1;; +field1 +20 + +drop table t1,t2,t3; +# End of test for Bug#13068506 End of 5.1 tests diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 8412b87ea9a..8439e05507b 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -1989,7 +1989,7 @@ DROP TABLE IF EXISTS `v2`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v2` ( - `a` varchar(30) + `a` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; /*!50001 DROP TABLE IF EXISTS `v2`*/; @@ -2083,7 +2083,7 @@ DROP TABLE IF EXISTS `v1`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v1` ( - `a` int(11) + `a` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; /*!50001 DROP TABLE IF EXISTS `v1`*/; @@ -2157,7 +2157,7 @@ DROP TABLE IF EXISTS `v2`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v2` ( - `a` varchar(30) + `a` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; /*!50001 DROP TABLE IF EXISTS `v2`*/; @@ -2271,9 +2271,9 @@ DROP TABLE IF EXISTS `v1`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v1` ( - `a` int(11), - `b` int(11), - `c` varchar(30) + `a` tinyint NOT NULL, + `b` tinyint NOT NULL, + `c` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; DROP TABLE IF EXISTS `v2`; @@ -2281,7 +2281,7 @@ DROP TABLE IF EXISTS `v2`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v2` ( - `a` int(11) + `a` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; DROP TABLE IF EXISTS `v3`; @@ -2289,9 +2289,9 @@ DROP TABLE IF EXISTS `v3`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v3` ( - `a` int(11), - `b` int(11), - `c` varchar(30) + `a` tinyint NOT NULL, + `b` tinyint NOT NULL, + `c` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; /*!50001 DROP TABLE IF EXISTS `v1`*/; @@ -3028,9 +3028,9 @@ DROP TABLE IF EXISTS `v0`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v0` ( - `a` int(11), - `b` varchar(32), - `c` varchar(32) + `a` tinyint NOT NULL, + `b` tinyint NOT NULL, + `c` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; DROP TABLE IF EXISTS `v1`; @@ -3038,9 +3038,9 @@ DROP TABLE IF EXISTS `v1`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v1` ( - `a` int(11), - `b` varchar(32), - `c` varchar(32) + `a` tinyint NOT NULL, + `b` tinyint NOT NULL, + `c` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; DROP TABLE IF EXISTS `v2`; @@ -3048,9 +3048,9 @@ DROP TABLE IF EXISTS `v2`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v2` ( - `a` int(11), - `b` varchar(32), - `c` varchar(32) + `a` tinyint NOT NULL, + `b` tinyint NOT NULL, + `c` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; @@ -3430,7 +3430,7 @@ DROP TABLE IF EXISTS `v1`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v1` ( - `id` int(11) + `id` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; @@ -3490,7 +3490,7 @@ USE `mysqldump_views`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `nasishnasifu` ( - `id` bigint(20) unsigned + `id` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; @@ -3883,7 +3883,7 @@ DROP TABLE IF EXISTS `v2`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v2` ( - `c` int(11) + `c` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; /*!50001 DROP TABLE IF EXISTS `v2`*/; @@ -4300,7 +4300,7 @@ DROP TABLE IF EXISTS `v1`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v1` ( - `id` int(11) + `id` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; diff --git a/mysql-test/r/partition_error.result b/mysql-test/r/partition_error.result index 269b6875430..e5ac1371a9b 100644 --- a/mysql-test/r/partition_error.result +++ b/mysql-test/r/partition_error.result @@ -662,8 +662,8 @@ test.t1 check Error Incorrect information in file: './test/t1.frm' test.t1 check error Corrupt SELECT * FROM t1; ERROR HY000: Failed to read from the .par file -# Note that it is currently impossible to drop a partitioned table -# without the .par file +# Note that we will remove the frm file when we detect that +# .par file has been deleted. DROP TABLE t1; ERROR 42S02: Unknown table 't1' # diff --git a/mysql-test/suite/binlog/t/binlog_killed_simulate.test b/mysql-test/suite/binlog/t/binlog_killed_simulate.test index b87d47559fe..fcedd884183 100644 --- a/mysql-test/suite/binlog/t/binlog_killed_simulate.test +++ b/mysql-test/suite/binlog/t/binlog_killed_simulate.test @@ -20,11 +20,9 @@ reset master; update t1 set a=2 /* will be "killed" after work has been done */; # a proof the query is binlogged with no error -#todo: introduce a suite private macro that provides numeric values -# for some constants like the offset of the first real event -# that is different between severs versions. +--let $binlog_load_data= query_get_value(SHOW BINLOG EVENTS, Pos, 2) let $MYSQLD_DATADIR= `select @@datadir`; ---exec $MYSQL_BINLOG --force-if-open --start-position=106 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog +--exec $MYSQL_BINLOG --force-if-open --start-position=$binlog_load_data $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval select (@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) @@ -48,11 +46,12 @@ reset master; load data infile '../../std_data/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */; +--let $binlog_load_data= query_get_value(SHOW BINLOG EVENTS, Pos, 2) # a proof the query is binlogged with an error - source include/show_binlog_events.inc; ---exec $MYSQL_BINLOG --force-if-open --start-position=98 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog +--mkdir $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571 +--exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571 --force-if-open --start-position=$binlog_load_data $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval select (@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) @@ -64,6 +63,8 @@ eval select $error_code /* must return 0 to mean the killed query is in */; # cleanup for the sub-case remove_file $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog; +--remove_files_wildcard $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571 * +--rmdir $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571 drop table t1,t2; diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql.result b/mysql-test/suite/funcs_1/r/is_columns_mysql.result index 2b285d7cc56..090eeff9f07 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_mysql.result +++ b/mysql-test/suite/funcs_1/r/is_columns_mysql.result @@ -66,7 +66,7 @@ NULL mysql general_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NUL NULL mysql help_category help_category_id 1 NULL NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned PRI select,insert,update,references NULL mysql help_category name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI select,insert,update,references NULL mysql help_category parent_category_id 3 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned select,insert,update,references -NULL mysql help_category url 4 NULL NO char 128 384 NULL NULL utf8 utf8_general_ci char(128) select,insert,update,references +NULL mysql help_category url 4 NULL NO text 65535 65535 NULL NULL utf8 utf8_general_ci text select,insert,update,references NULL mysql help_keyword help_keyword_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references NULL mysql help_keyword name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI select,insert,update,references NULL mysql help_relation help_keyword_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references @@ -76,7 +76,7 @@ NULL mysql help_topic example 5 NULL NO text 65535 65535 NULL NULL utf8 utf8_gen NULL mysql help_topic help_category_id 3 NULL NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned select,insert,update,references NULL mysql help_topic help_topic_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references NULL mysql help_topic name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI select,insert,update,references -NULL mysql help_topic url 6 NULL NO char 128 384 NULL NULL utf8 utf8_general_ci char(128) select,insert,update,references +NULL mysql help_topic url 6 NULL NO text 65535 65535 NULL NULL utf8 utf8_general_ci text select,insert,update,references NULL mysql host Alter_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NULL mysql host Alter_routine_priv 18 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NULL mysql host Create_priv 7 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references @@ -348,7 +348,7 @@ NULL mysql general_log server_id int NULL NULL NULL NULL int(10) unsigned NULL mysql help_category help_category_id smallint NULL NULL NULL NULL smallint(5) unsigned 3.0000 mysql help_category name char 64 192 utf8 utf8_general_ci char(64) NULL mysql help_category parent_category_id smallint NULL NULL NULL NULL smallint(5) unsigned -3.0000 mysql help_category url char 128 384 utf8 utf8_general_ci char(128) +1.0000 mysql help_category url text 65535 65535 utf8 utf8_general_ci text NULL mysql help_keyword help_keyword_id int NULL NULL NULL NULL int(10) unsigned 3.0000 mysql help_keyword name char 64 192 utf8 utf8_general_ci char(64) NULL mysql help_relation help_topic_id int NULL NULL NULL NULL int(10) unsigned @@ -358,7 +358,7 @@ NULL mysql help_topic help_topic_id int NULL NULL NULL NULL int(10) unsigned NULL mysql help_topic help_category_id smallint NULL NULL NULL NULL smallint(5) unsigned 1.0000 mysql help_topic description text 65535 65535 utf8 utf8_general_ci text 1.0000 mysql help_topic example text 65535 65535 utf8 utf8_general_ci text -3.0000 mysql help_topic url char 128 384 utf8 utf8_general_ci char(128) +1.0000 mysql help_topic url text 65535 65535 utf8 utf8_general_ci text 3.0000 mysql host Host char 60 180 utf8 utf8_bin char(60) 3.0000 mysql host Db char 64 192 utf8 utf8_bin char(64) 3.0000 mysql host Select_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result index 983f9dd833e..8cc2db6d12f 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result @@ -66,7 +66,7 @@ NULL mysql general_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NUL NULL mysql help_category help_category_id 1 NULL NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned PRI NULL mysql help_category name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI NULL mysql help_category parent_category_id 3 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned -NULL mysql help_category url 4 NULL NO char 128 384 NULL NULL utf8 utf8_general_ci char(128) +NULL mysql help_category url 4 NULL NO text 65535 65535 NULL NULL utf8 utf8_general_ci text NULL mysql help_keyword help_keyword_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI NULL mysql help_keyword name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI NULL mysql help_relation help_keyword_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI @@ -76,7 +76,7 @@ NULL mysql help_topic example 5 NULL NO text 65535 65535 NULL NULL utf8 utf8_gen NULL mysql help_topic help_category_id 3 NULL NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned NULL mysql help_topic help_topic_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI NULL mysql help_topic name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI -NULL mysql help_topic url 6 NULL NO char 128 384 NULL NULL utf8 utf8_general_ci char(128) +NULL mysql help_topic url 6 NULL NO text 65535 65535 NULL NULL utf8 utf8_general_ci text NULL mysql host Alter_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') NULL mysql host Alter_routine_priv 18 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') NULL mysql host Create_priv 7 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') @@ -348,7 +348,7 @@ NULL mysql general_log server_id int NULL NULL NULL NULL int(10) unsigned NULL mysql help_category help_category_id smallint NULL NULL NULL NULL smallint(5) unsigned 3.0000 mysql help_category name char 64 192 utf8 utf8_general_ci char(64) NULL mysql help_category parent_category_id smallint NULL NULL NULL NULL smallint(5) unsigned -3.0000 mysql help_category url char 128 384 utf8 utf8_general_ci char(128) +1.0000 mysql help_category url text 65535 65535 utf8 utf8_general_ci text NULL mysql help_keyword help_keyword_id int NULL NULL NULL NULL int(10) unsigned 3.0000 mysql help_keyword name char 64 192 utf8 utf8_general_ci char(64) NULL mysql help_relation help_topic_id int NULL NULL NULL NULL int(10) unsigned @@ -358,7 +358,7 @@ NULL mysql help_topic help_topic_id int NULL NULL NULL NULL int(10) unsigned NULL mysql help_topic help_category_id smallint NULL NULL NULL NULL smallint(5) unsigned 1.0000 mysql help_topic description text 65535 65535 utf8 utf8_general_ci text 1.0000 mysql help_topic example text 65535 65535 utf8 utf8_general_ci text -3.0000 mysql help_topic url char 128 384 utf8 utf8_general_ci char(128) +1.0000 mysql help_topic url text 65535 65535 utf8 utf8_general_ci text 3.0000 mysql host Host char 60 180 utf8 utf8_bin char(60) 3.0000 mysql host Db char 64 192 utf8 utf8_bin char(64) 3.0000 mysql host Select_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') diff --git a/mysql-test/suite/funcs_1/r/is_tables_mysql.result b/mysql-test/suite/funcs_1/r/is_tables_mysql.result index b41318d9bae..3d58af72550 100644 --- a/mysql-test/suite/funcs_1/r/is_tables_mysql.result +++ b/mysql-test/suite/funcs_1/r/is_tables_mysql.result @@ -133,7 +133,7 @@ TABLE_NAME help_category TABLE_TYPE BASE TABLE ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Fixed +ROW_FORMAT Dynamic TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# diff --git a/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result index a8b2813b162..9e191842e64 100644 --- a/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result @@ -133,7 +133,7 @@ TABLE_NAME help_category TABLE_TYPE BASE TABLE ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Fixed +ROW_FORMAT Dynamic TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -678,7 +678,7 @@ TABLE_NAME help_category TABLE_TYPE BASE TABLE ENGINE MYISAM_OR_MARIA VERSION 10 -ROW_FORMAT Fixed +ROW_FORMAT Dynamic TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# diff --git a/mysql-test/suite/innodb/t/innodb_bug12400341.test b/mysql-test/suite/innodb/t/innodb_bug12400341.test index 2ab1be81f6d..ab69e20c495 100644 --- a/mysql-test/suite/innodb/t/innodb_bug12400341.test +++ b/mysql-test/suite/innodb/t/innodb_bug12400341.test @@ -7,6 +7,10 @@ if (`select count(*)=0 from information_schema.global_variables where variable_n --skip Test requires InnoDB built with UNIV_DEBUG definition. } +# Don't test under valgrind, undo slots of the previous test might exist still +# and cause unstable result. +--source include/not_valgrind.inc + call mtr.add_suppression("InnoDB: Warning: cannot find a free slot for an undo log. Do you have too"); --disable_query_log diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug12400341.test b/mysql-test/suite/innodb_plugin/t/innodb_bug12400341.test index b9e40e0dff3..2ecf30edfa7 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb_bug12400341.test +++ b/mysql-test/suite/innodb_plugin/t/innodb_bug12400341.test @@ -7,6 +7,10 @@ if (`select count(*)=0 from information_schema.global_variables where variable_n --skip Test requires InnoDB built with UNIV_DEBUG definition. } +# Don't test under valgrind, undo slots of the previous test might exist still +# and cause unstable result. +--source include/not_valgrind.inc + call mtr.add_suppression("InnoDB: Warning: cannot find a free slot for an undo log. Do you have too"); --disable_query_log diff --git a/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result index 412021d6446..66974762ebc 100644 --- a/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result +++ b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result @@ -1,6 +1,18 @@ *** Set up circular replication on four servers *** include/rpl_init.inc [topology=1->2->3->4->1] +[connection server_4] +SET auto_increment_increment= 4; +SET auto_increment_offset= 4; +[connection server_3] +SET auto_increment_increment= 4; +SET auto_increment_offset= 3; +[connection server_2] +SET auto_increment_increment= 4; +SET auto_increment_offset= 2; +[connection server_1] +SET auto_increment_increment= 4; +SET auto_increment_offset= 1; *** Preparing data *** CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=MyISAM; CREATE TABLE t2 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=InnoDB; diff --git a/mysql-test/suite/rpl/r/rpl_dump_events_twice_bug.result b/mysql-test/suite/rpl/r/rpl_dump_events_twice_bug.result new file mode 100644 index 00000000000..8e6c8c122b5 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_dump_events_twice_bug.result @@ -0,0 +1,15 @@ +include/master-slave.inc +[connection master] +CALL mtr.add_suppression("Failed to read an event from active binlog.*"); +SET @debug_saved= @@GLOBAL.DEBUG; +CREATE TABLE t1(c1 INT); +INSERT INTO t1 VALUES(1); +[connection master] +SET GLOBAL debug='+d,dump_fake_io_error'; +INSERT INTO t1 VALUES(2); +INSERT INTO t1 VALUES(3); +include/diff_tables.inc [master:t1, slave:t1] +[connection master] +SET @@GLOBAL.DEBUG= @debug_saved; +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_m.result b/mysql-test/suite/rpl/r/rpl_loaddata_m.result index ad9fb6e0896..58339811a1a 100644 --- a/mysql-test/suite/rpl/r/rpl_loaddata_m.result +++ b/mysql-test/suite/rpl/r/rpl_loaddata_m.result @@ -32,5 +32,5 @@ SELECT COUNT(*) FROM mysqltest.t1; COUNT(*) 2 DROP DATABASE mysqltest; -DROP TABLE test.t1; +DROP TABLE IF EXISTS test.t1; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_log_pos.result b/mysql-test/suite/rpl/r/rpl_log_pos.result index f07eaac94e9..a3cc88fe229 100644 --- a/mysql-test/suite/rpl/r/rpl_log_pos.result +++ b/mysql-test/suite/rpl/r/rpl_log_pos.result @@ -3,7 +3,7 @@ include/master-slave.inc create table if not exists t1 (n int); drop table t1; call mtr.add_suppression ("Slave I/O: Got fatal error 1236 from master when reading data from binary"); -call mtr.add_suppression ("Error in Log_event::read_log_event"); +CALL mtr.add_suppression("Failed to read an event from active binlog.*"); show master status; File Position Binlog_Do_DB Binlog_Ignore_DB master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB> diff --git a/mysql-test/suite/rpl/r/rpl_lost_events_on_rotate.result b/mysql-test/suite/rpl/r/rpl_lost_events_on_rotate.result new file mode 100644 index 00000000000..eee2effccea --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_lost_events_on_rotate.result @@ -0,0 +1,14 @@ +include/master-slave.inc +[connection master] +SET @debug_saved= @@GLOBAL.DEBUG; +CREATE TABLE t (i INT); +SET GLOBAL DEBUG= "d,wait_after_binlog_EOF"; +INSERT INTO t VALUES (1); +INSERT INTO t VALUES (2); +FLUSH LOGS; +SET DEBUG_SYNC= 'now SIGNAL signal.rotate_finished'; +include/diff_tables.inc [master:t,slave:t] +SET @@GLOBAL.DEBUG= @debug_saved; +SET DEBUG_SYNC= 'RESET'; +DROP TABLE t; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_until.result b/mysql-test/suite/rpl/r/rpl_row_until.result index be8f17c6f01..5ab39a00946 100644 --- a/mysql-test/suite/rpl/r/rpl_row_until.result +++ b/mysql-test/suite/rpl/r/rpl_row_until.result @@ -27,12 +27,6 @@ n 3 4 include/check_slave_param.inc [Exec_Master_Log_Pos] -include/wait_for_slave_sql_to_stop.inc -SELECT * FROM t2; -n -1 -2 -include/check_slave_param.inc [Exec_Master_Log_Pos] START SLAVE; include/wait_for_slave_to_start.inc include/stop_slave.inc @@ -54,6 +48,18 @@ START SLAVE; START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS; Warnings: Note 1254 Slave is already running -include/stop_slave.inc -RESET SLAVE; +include/start_slave.inc +Warnings: +Note 1254 Slave is already running +include/rpl_reset.inc +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1); +include/stop_slave_sql.inc +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +include/sync_slave_io_with_master.inc +include/wait_for_slave_sql_to_stop.inc +include/assert.inc [table t1 should have two rows.] +include/start_slave.inc +DROP TABLE t1; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_stm_until.result b/mysql-test/suite/rpl/r/rpl_stm_until.result index 72495831f6e..a4a0cdaf595 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_until.result +++ b/mysql-test/suite/rpl/r/rpl_stm_until.result @@ -94,17 +94,4 @@ one 1 drop table t1; start slave; -include/rpl_reset.inc -drop table if exists t1; -stop slave; -flush logs; -flush logs; -reset slave; -start slave until master_log_file='master-bin.000001', master_log_pos=294 /* to stop right before DROP */; -include/wait_for_slave_sql_to_stop.inc -show tables /* t1 must exist */; -Tables_in_test -t1 -drop table t1; -stop slave; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def index d33f85091ff..d3339c1bfe8 100644 --- a/mysql-test/suite/rpl/t/disabled.def +++ b/mysql-test/suite/rpl/t/disabled.def @@ -12,5 +12,3 @@ rpl_row_create_table : Bug#11759274 Feb 27 2010 andrei failed different way than earlier with bug#45576 rpl_get_master_version_and_clock : Bug#11766137 Jan 05 2011 joro Valgrind warnings rpl_get_master_version_and_clock -rpl_stm_until : BUG#59543 Jan 26 2011 alfranio Replication test from eits suite rpl_row_until times out -rpl_row_until @macosx : BUG#15965353 RPL.RPL_ROW_UNTIL FAILS ON PB2 , PLATFORM= MACOSX10.6 X86_64 MAX diff --git a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test index 1380b3d97cf..f1d42089869 100644 --- a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test +++ b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test @@ -20,6 +20,18 @@ --source include/rpl_init.inc --echo +#set auto inc variables at each server +--let $_rpl_server= $rpl_server_count +while ($_rpl_server) +{ + --let $rpl_connection_name= server_$_rpl_server + --source include/rpl_connection.inc + eval SET auto_increment_increment= $rpl_server_count; + eval SET auto_increment_offset= $_rpl_server; + + --dec $_rpl_server +} + # Preparing data. --echo *** Preparing data *** --connection server_1 diff --git a/mysql-test/suite/rpl/t/rpl_dump_events_twice_bug.test b/mysql-test/suite/rpl/t/rpl_dump_events_twice_bug.test new file mode 100644 index 00000000000..de82769010e --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_dump_events_twice_bug.test @@ -0,0 +1,28 @@ +# +# Verify dump thread can send events in active file, correctly after +# encountering an IO error. +# +--source include/have_debug.inc +--source include/master-slave.inc + +CALL mtr.add_suppression("Failed to read an event from active binlog.*"); +SET @debug_saved= @@GLOBAL.DEBUG; + +CREATE TABLE t1(c1 INT); +INSERT INTO t1 VALUES(1); + +--sync_slave_with_master + +--source include/rpl_connection_master.inc +SET GLOBAL debug='+d,dump_fake_io_error'; +INSERT INTO t1 VALUES(2); +INSERT INTO t1 VALUES(3); + +--sync_slave_with_master +--let $diff_tables= master:t1, slave:t1 +--source include/diff_tables.inc + +--source include/rpl_connection_master.inc +SET @@GLOBAL.DEBUG= @debug_saved; +DROP TABLE t1; +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_m.test b/mysql-test/suite/rpl/t/rpl_loaddata_m.test index bbe11bbb887..034fefa95f5 100644 --- a/mysql-test/suite/rpl/t/rpl_loaddata_m.test +++ b/mysql-test/suite/rpl/t/rpl_loaddata_m.test @@ -46,7 +46,7 @@ SELECT COUNT(*) FROM mysqltest.t1; # Cleanup connection master; DROP DATABASE mysqltest; -DROP TABLE test.t1; +DROP TABLE IF EXISTS test.t1; sync_slave_with_master; # End of test diff --git a/mysql-test/suite/rpl/t/rpl_log_pos.test b/mysql-test/suite/rpl/t/rpl_log_pos.test index 0e746d55935..d5a788bacd1 100644 --- a/mysql-test/suite/rpl/t/rpl_log_pos.test +++ b/mysql-test/suite/rpl/t/rpl_log_pos.test @@ -20,7 +20,7 @@ create table if not exists t1 (n int); drop table t1; call mtr.add_suppression ("Slave I/O: Got fatal error 1236 from master when reading data from binary"); -call mtr.add_suppression ("Error in Log_event::read_log_event"); +CALL mtr.add_suppression("Failed to read an event from active binlog.*"); source include/show_master_status.inc; sync_slave_with_master; source include/stop_slave.inc; diff --git a/mysql-test/suite/rpl/t/rpl_lost_events_on_rotate.test b/mysql-test/suite/rpl/t/rpl_lost_events_on_rotate.test new file mode 100644 index 00000000000..08884ee8e26 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_lost_events_on_rotate.test @@ -0,0 +1,51 @@ +# +# Whenever the mysql_binlog_send method (dump thread) reaches the +# end of file when reading events from the binlog, before checking +# if it should wait for more events, there was a test to check if +# the file being read was still active, i.e, it was the last known +# binlog. However, it was possible that something was written to +# the binary log and then a rotation would happen, after EOF was +# detected and before the check for active was performed. In this +# case, the end of the binary log would not be read by the dump +# thread, and this would cause the slave to lose updates. +# +# This test verifies that the problem has been fixed. It waits +# during this window while forcing a rotation in the binlog. +# +--source include/have_debug.inc +--source include/master-slave.inc + +--connection master + +SET @debug_saved= @@GLOBAL.DEBUG; + +CREATE TABLE t (i INT); + +# When reaching the EOF the dump thread will wait before deciding if +# it should move to a new binlong file. +SET GLOBAL DEBUG= "d,wait_after_binlog_EOF"; + +INSERT INTO t VALUES (1); + +--sleep 1 + +# A insert and a rotate happens before the decision +INSERT INTO t VALUES (2); +FLUSH LOGS; + +SET DEBUG_SYNC= 'now SIGNAL signal.rotate_finished'; + +--sync_slave_with_master + +# All the rows should be sent to the slave. +--let $diff_tables=master:t,slave:t +--source include/diff_tables.inc + +##Clean up +--connection master + +SET @@GLOBAL.DEBUG= @debug_saved; +SET DEBUG_SYNC= 'RESET'; + +DROP TABLE t; +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_row_until.test b/mysql-test/suite/rpl/t/rpl_row_until.test index eaa99c29694..1e5bc341b1a 100644 --- a/mysql-test/suite/rpl/t/rpl_row_until.test +++ b/mysql-test/suite/rpl/t/rpl_row_until.test @@ -2,7 +2,13 @@ -- source include/have_binlog_format_row.inc -- source include/master-slave.inc -# Note: The test is dependent on binlog positions +############################################################################## +# The test is dependent on binlog positions. The test is divided into two +# sections. The first section checks START SLAVE UNTIL MASTER_LOG_FILE = +# 'log_name', MASTER_LOG_POS = log_pos followed by a couple of failure +# scenarios. The second section checks START SLAVE UNTIL RELAY_LOG_FILE = +# 'log_name', RELAY_LOG_POS = log_pos. +############################################################################## # Create some events on master connection master; @@ -22,14 +28,8 @@ let $master_pos_create_t2= query_get_value(SHOW BINLOG EVENTS, Pos, 8); INSERT INTO t2 VALUES (1),(2); save_master_pos; # Save master log position for query INSERT INTO t2 VALUES (1),(2); -let $master_pos_insert1_t2= query_get_value(SHOW BINLOG EVENTS, End_log_pos, 12); -sync_slave_with_master; - -# Save relay log position for query INSERT INTO t2 VALUES (1),(2); -let $relay_log_file= query_get_value(show slave status, Relay_Log_File,1); -let $relay_pos_insert1_t2= query_get_value(show slave status, Relay_Log_Pos, 1); +let $master_pos_insert1_t2= query_get_value(SHOW MASTER STATUS, Position, 1); -connection master; INSERT INTO t2 VALUES (3),(4); DROP TABLE t2; # Save master log position for query INSERT INTO t2 VALUES (1),(2); @@ -68,17 +68,6 @@ SELECT * FROM t1; --let $slave_param_value= $master_pos_drop_t1 --source include/check_slave_param.inc -# Try replicate all up to and not including the second insert to t2; ---disable_query_log -eval START SLAVE UNTIL RELAY_LOG_FILE='$relay_log_file', RELAY_LOG_POS=$relay_pos_insert1_t2; ---enable_query_log ---source include/wait_for_slave_sql_to_stop.inc -SELECT * FROM t2; - ---let $slave_param= Exec_Master_Log_Pos ---let $slave_param_value= $master_pos_insert1_t2 ---source include/check_slave_param.inc - # clean up START SLAVE; --source include/wait_for_slave_to_start.inc @@ -119,9 +108,49 @@ START SLAVE; --replace_result 740 MASTER_LOG_POS START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=740; ---source include/stop_slave.inc -# Clear slave IO error. -RESET SLAVE; +--source include/start_slave.inc + +############################################################################## +# The second section - checks START SLAVE UNTIL RELAY_LOG_FILE =# 'log_name', +# RELAY_LOG_POS = log_pos. This section of the test does the following: +# 1) At master, create a table and inserts a value. Let slave replicate this. +# 2) Stop slave sql thread. +# 3) Insert some more values at master. Note that io thread copies this insert +# 4) Use start slave until to start the sql thread and check if it +# stops at the correct position. +############################################################################## ---let $rpl_only_running_threads= 1 +--source include/rpl_reset.inc + +--connection master +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1); + +--sync_slave_with_master +--source include/stop_slave_sql.inc + +--connection master +INSERT INTO t1 VALUES (2); +--let $master_log_pos= query_get_value(SHOW MASTER STATUS, Position, 1) +INSERT INTO t1 VALUES (3); + +--source include/sync_slave_io_with_master.inc + +--let $relay_log_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File,1) +--source include/get_relay_log_pos.inc + +--disable_query_log +--eval start slave until relay_log_file='$relay_log_file', relay_log_pos=$relay_log_pos +--enable_query_log +--source include/wait_for_slave_sql_to_stop.inc + +--let $assert_cond= COUNT(*) = 2 FROM t1 +--let $assert_text= table t1 should have two rows. +--source include/assert.inc + +#cleanup +--source include/start_slave.inc +--connection master +DROP TABLE t1; +--sync_slave_with_master --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_stm_until.test b/mysql-test/suite/rpl/t/rpl_stm_until.test index feac9b21c84..3db3731194e 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_until.test +++ b/mysql-test/suite/rpl/t/rpl_stm_until.test @@ -184,44 +184,6 @@ connection slave; start slave; sync_with_master; - # Bug #47142 "slave start until" stops 1 event too late in 4.1 to 5.0 replication -# -# testing fixes that refine the start position of prior-5.0 master's event -# and by that provide correct execution of -# START SLAVE UNTIL ... master_log_pos= x; -# Keep the test at the end of the file because it manipulates with binlog files -# to substitute the genuine one with a prepared on 4.1 server. -# - ---source include/rpl_reset.inc - -connection master; ---disable_warnings -drop table if exists t1; # there is create table t1 in bug47142_master-bin.000001 ---enable_warnings -sync_slave_with_master; -connection slave; -stop slave; -connection master; - -flush logs; -let $MYSQLD_DATADIR= `select @@datadir`; ---remove_file $MYSQLD_DATADIR/master-bin.000001 ---copy_file $MYSQL_TEST_DIR/std_data/bug47142_master-bin.000001 $MYSQLD_DATADIR/master-bin.000001 -flush logs; - -connection slave; -reset slave; -start slave until master_log_file='master-bin.000001', master_log_pos=294 /* to stop right before DROP */; ---source include/wait_for_slave_sql_to_stop.inc - -show tables /* t1 must exist */; - -# clean-up of Bug #47142 testing - -drop table t1; # drop on slave only, master does not have t1. -stop slave; - # End of tests --let $rpl_only_running_threads= 1 --source include/rpl_end.inc diff --git a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_evict_basic.result b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_evict_basic.result new file mode 100644 index 00000000000..459ad95bdc6 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_evict_basic.result @@ -0,0 +1,7 @@ +SELECT @@global.innodb_buffer_pool_evict; +@@global.innodb_buffer_pool_evict + +SET GLOBAL innodb_buffer_pool_evict = 'uncompressed'; +SELECT @@global.innodb_buffer_pool_evict; +@@global.innodb_buffer_pool_evict + diff --git a/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result b/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result index bdb586e84c2..ede412c28b7 100644 --- a/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result +++ b/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result @@ -1,9 +1,5 @@ -stop slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -reset master; -reset slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -start slave; +include/master-slave.inc +[connection master] connection slave SET @start_max_connections= @@global.max_connections; SET @start_init_slave= @@global.init_slave; @@ -18,23 +14,19 @@ SELECT @@global.init_slave = 'SET @@global.max_connections = @@global.max_connec @@global.init_slave = 'SET @@global.max_connections = @@global.max_connections + 1' 1 Expect 1 -SELECT @@global.max_connections= @start_max_connections; -@@global.max_connections= @start_max_connections -1 -Expect 1 +include/assert.inc [@@global.max_connections = @start_max_connections] STOP SLAVE; RESET MASTER; RESET SLAVE; START SLAVE; -SELECT @@global.max_connections = @start_max_connections + 1; -@@global.max_connections = @start_max_connections + 1 -1 -Expect 1 +include/wait_for_slave_to_start.inc +include/assert.inc [@@global.max_connections = @start_max_connections + 1] SET @@global.init_slave = "SET @a=5"; STOP SLAVE; RESET MASTER; RESET SLAVE; START SLAVE; +include/wait_for_slave_to_start.inc SHOW VARIABLES LIKE 'init_slave'; Variable_name Value init_slave SET @a=5 @@ -44,3 +36,4 @@ NULL Expect NULL SET @@global.max_connections= @start_max_connections; SET @@global.init_slave= @start_init_slave; +include/rpl_end.inc diff --git a/mysql-test/suite/sys_vars/t/disabled.def b/mysql-test/suite/sys_vars/t/disabled.def index 866172fb51a..98625a2ec54 100644 --- a/mysql-test/suite/sys_vars/t/disabled.def +++ b/mysql-test/suite/sys_vars/t/disabled.def @@ -9,5 +9,14 @@ # Do not use any TAB characters for whitespace. # ############################################################################## -sys_vars.max_binlog_cache_size_basic_64 : bug#11763668 2010-08-31 Horst -sys_vars.max_binlog_cache_size_basic_32 : bug#11763668 2010-08-31 Horst +sys_vars.max_allowed_packet_basic : bug#16295372 2013-02-09 veduggir +sys_vars.max_allowed_packet_func : bug#16295372 2013-02-09 veduggir +sys_vars.net_buffer_length_basic : bug#16295372 2013-02-09 veduggir +sys_vars.insert_id_basic : bug#16295418 2013-02-09 veduggir +sys_vars.key_cache_age_threshold_basic_64 : bug#16295418 2013-02-09 veduggir +sys_vars.key_cache_block_size_basic_64 : bug#16295418 2013-02-09 veduggir +sys_vars.key_cache_division_limit_basic_64 : bug#16295418 2013-02-09 veduggir +sys_vars.identity_basic : bug#16295418 2013-02-09 veduggir +sys_vars.key_buffer_size_basic_64 : bug#16295418 2013-02-09 veduggir +sys_vars.key_buffer_size_func : bug#16295418 2013-02-09 veduggir +sys_vars.timestamp_basic_64 : bug#16295457 2013-02-09 veduggir diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_evict_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_evict_basic.test new file mode 100644 index 00000000000..2350d55c57b --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_evict_basic.test @@ -0,0 +1,10 @@ +-- source include/have_innodb_plugin.inc +# This is a debug variable for now +-- source include/have_debug.inc + +SELECT @@global.innodb_buffer_pool_evict; + +SET GLOBAL innodb_buffer_pool_evict = 'uncompressed'; + +# Should always be empty. +SELECT @@global.innodb_buffer_pool_evict; diff --git a/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test b/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test index d4607dc6bf1..edc77816c9c 100644 --- a/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test +++ b/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test @@ -59,8 +59,9 @@ let $wait_timeout= 240; let $wait_condition= SELECT @@global.max_connections = @start_max_connections; --source include/wait_condition_sp.inc # check that the action in init_slave does not happen immediately -SELECT @@global.max_connections= @start_max_connections; ---echo Expect 1 +--let $assert_text= @@global.max_connections = @start_max_connections +--let $assert_cond= @@global.max_connections = @start_max_connections +--source include/assert.inc # # reset of the server STOP SLAVE; @@ -75,8 +76,9 @@ let $wait_timeout= 90; let $wait_condition= SELECT @@global.max_connections = @start_max_connections + 1; --source include/wait_condition_sp.inc # check that the action in init_slave was executed and had the intended effect -SELECT @@global.max_connections = @start_max_connections + 1; ---echo Expect 1 +--let $assert_text= @@global.max_connections = @start_max_connections + 1 +--let $assert_cond= @@global.max_connections = @start_max_connections + 1 +--source include/assert.inc # # Setting a variable(which is local to a session) and must not be visible SET @@global.init_slave = "SET @a=5"; diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test index 4474736200c..27eb5e88c54 100644 --- a/mysql-test/t/cast.test +++ b/mysql-test/t/cast.test @@ -309,4 +309,17 @@ WHERE CAST(a as BINARY)=x'62736D697468' DROP TABLE t1; +--echo # +--echo # Bug#13581962 HIGH MEMORY USAGE ATTEMPT, THEN CRASH WITH +--echo # LONGTEXT, UNION, USER VARIABLE +--echo # Bug#14096619 UNABLE TO RESTORE DATABASE DUMP +--echo # + +CREATE TABLE t1 AS SELECT CONCAT(CAST(REPEAT('9', 1000) AS SIGNED)), + CONCAT(CAST(REPEAT('9', 1000) AS UNSIGNED)); +SHOW CREATE TABLE t1; +DROP TABLE t1; + +--echo # End of test for Bug#13581962, Bug#14096619 + --echo End of 5.1 tests diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index f49fa633925..df8f6df27b3 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -1374,9 +1374,11 @@ SELECT CONVERT(('' IN (REVERSE(CAST(('') AS DECIMAL)), '')), CHAR(3)); --echo # and other crashes --echo # CREATE TABLE t1 ( a TEXT ); -SELECT 'aaaaaaaaaaaaaa' INTO OUTFILE 'bug58165.txt'; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--eval SELECT 'aaaaaaaaaaaaaa' INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug58165.txt'; SELECT insert( substring_index( 'a', 'a', 'b' ), 1, 0, 'x' ); -LOAD DATA INFILE 'bug58165.txt' INTO TABLE t1; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/bug58165.txt' INTO TABLE t1; SELECT * FROM t1; DROP TABLE t1; diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test index 5e18f77c422..91f1c90a308 100644 --- a/mysql-test/t/join_outer.test +++ b/mysql-test/t/join_outer.test @@ -1160,5 +1160,35 @@ EXECUTE prep_stmt; DROP TABLE t1; +--echo # +--echo # Bug#13068506 - QUERY WITH GROUP BY ON NON-AGGR COLUMN RETURNS +--echo # WRONG RESULT +--echo # + +CREATE TABLE t1 (i1 int); +INSERT INTO t1 VALUES (100), (101); + +CREATE TABLE t2 (i2 int, i3 int); +INSERT INTO t2 VALUES (20,1),(10,2); + +CREATE TABLE t3 (i4 int(11)); +INSERT INTO t3 VALUES (1),(2); + +let $query= SELECT ( + SELECT MAX( t2.i2 ) + FROM t3 RIGHT JOIN t2 ON ( t2.i3 = 2 ) + WHERE t2.i3 <> t1.i1 +) AS field1 +FROM t1; + +--echo +--eval $query; +--echo +--eval $query GROUP BY field1; + +--echo +drop table t1,t2,t3; + +--echo # End of test for Bug#13068506 --echo End of 5.1 tests diff --git a/mysql-test/t/partition_error.test b/mysql-test/t/partition_error.test index 7e574fd6a42..746e52bd623 100644 --- a/mysql-test/t/partition_error.test +++ b/mysql-test/t/partition_error.test @@ -698,11 +698,10 @@ FLUSH TABLES; CHECK TABLE t1; --error ER_UNKNOWN_ERROR SELECT * FROM t1; ---echo # Note that it is currently impossible to drop a partitioned table ---echo # without the .par file +--echo # Note that we will remove the frm file when we detect that +--echo # .par file has been deleted. --error ER_BAD_TABLE_ERROR DROP TABLE t1; ---remove_file $MYSQLD_DATADIR/test/t1.frm --remove_file $MYSQLD_DATADIR/test/t1#P#p0.MYI --remove_file $MYSQLD_DATADIR/test/t1#P#p0.MYD |