summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/Makefile.am14
-rw-r--r--mysql-test/include/have_ndb.inc8
-rw-r--r--mysql-test/include/wait_until_connected_again.inc2
-rw-r--r--mysql-test/lib/mtr_cases.pl16
-rw-r--r--mysql-test/lib/mtr_process.pl8
-rw-r--r--mysql-test/mysql-test-run-shell.sh (renamed from mysql-test/mysql-test-run.sh)0
-rwxr-xr-xmysql-test/mysql-test-run.pl161
-rw-r--r--mysql-test/r/analyse.result13
-rw-r--r--mysql-test/r/ctype_utf8.result12
-rw-r--r--mysql-test/r/execution_constants.result12
-rw-r--r--mysql-test/r/func_time.result12
-rw-r--r--mysql-test/r/have_ndb_status_ok.require2
-rw-r--r--mysql-test/r/mysqltest.result5
-rw-r--r--mysql-test/r/partition.result6
-rw-r--r--mysql-test/r/ps.result48
-rw-r--r--mysql-test/r/strict.result4
-rw-r--r--mysql-test/r/type_bit.result8
-rw-r--r--mysql-test/r/type_float.result7
-rw-r--r--mysql-test/r/warnings.result56
-rw-r--r--mysql-test/r/windows.result28
-rw-r--r--mysql-test/t/analyse.test13
-rw-r--r--mysql-test/t/crash_commit_before-master.opt2
-rw-r--r--mysql-test/t/crash_commit_before.test5
-rw-r--r--mysql-test/t/ctype_utf8.test11
-rw-r--r--mysql-test/t/disabled.def3
-rw-r--r--mysql-test/t/execution_constants.test74
-rw-r--r--mysql-test/t/func_time.test19
-rw-r--r--mysql-test/t/lowercase_fs_off.test1
-rw-r--r--mysql-test/t/mysqltest.test12
-rw-r--r--mysql-test/t/type_bit.test8
-rw-r--r--mysql-test/t/type_float.test11
-rw-r--r--mysql-test/t/warnings.test58
-rw-r--r--mysql-test/t/windows.test39
-rw-r--r--mysql-test/valgrind.supp23
34 files changed, 543 insertions, 158 deletions
diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am
index 61bac05b224..f0bc1e9b20a 100644
--- a/mysql-test/Makefile.am
+++ b/mysql-test/Makefile.am
@@ -22,14 +22,15 @@ DIST_SUBDIRS=ndb
benchdir_root= $(prefix)
testdir = $(benchdir_root)/mysql-test
-EXTRA_SCRIPTS = mysql-test-run.sh install_test_db.sh valgrind.supp $(PRESCRIPTS)
-EXTRA_DIST = $(EXTRA_SCRIPTS)
-GENSCRIPTS = mysql-test-run install_test_db mtr
+EXTRA_SCRIPTS = mysql-test-run-shell.sh install_test_db.sh \
+ valgrind.supp $(PRESCRIPTS)
+EXTRA_DIST = $(EXTRA_SCRIPTS)
+GENSCRIPTS = mysql-test-run-shell install_test_db mtr mysql-test-run
PRESCRIPTS = mysql-test-run.pl
test_SCRIPTS = $(GENSCRIPTS) $(PRESCRIPTS)
test_DATA = std_data/client-key.pem std_data/client-cert.pem \
std_data/cacert.pem std_data/server-cert.pem \
- std_data/server-key.pem
+ std_data/server-key.pem
CLEANFILES = $(GENSCRIPTS)
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I..
@@ -118,6 +119,11 @@ mtr:
$(RM) -f mtr
$(LN_S) mysql-test-run.pl mtr
+# mysql-test-run - a shortcut for executing mysql-test-run.pl
+mysql-test-run:
+ $(RM) -f mysql-test-run
+ $(LN_S) mysql-test-run.pl mysql-test-run
+
SUFFIXES = .sh
.sh:
diff --git a/mysql-test/include/have_ndb.inc b/mysql-test/include/have_ndb.inc
index be339d41238..8cbeab07a4f 100644
--- a/mysql-test/include/have_ndb.inc
+++ b/mysql-test/include/have_ndb.inc
@@ -4,12 +4,4 @@ disable_query_log;
select support = 'Enabled' as `TRUE` from information_schema.engines where engine = 'ndbcluster';
enable_query_log;
-# Check that NDB is installed and known to be working
-# This will disable ndb from the shell script 'mysql-test-run'
-
--- require r/have_ndb_status_ok.require
-disable_query_log;
-eval select "$NDB_STATUS_OK" as ndb_status_ok;
-enable_query_log;
-
diff --git a/mysql-test/include/wait_until_connected_again.inc b/mysql-test/include/wait_until_connected_again.inc
index 5ae722e6db7..dc96f646cb3 100644
--- a/mysql-test/include/wait_until_connected_again.inc
+++ b/mysql-test/include/wait_until_connected_again.inc
@@ -3,7 +3,7 @@
# server has been restored or timeout occurs
--disable_result_log
--disable_query_log
-let $counter= 100;
+let $counter= 500;
while ($mysql_errno)
{
--error 0,2002,2006
diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl
index cfd07abb9e0..bb92730444c 100644
--- a/mysql-test/lib/mtr_cases.pl
+++ b/mysql-test/lib/mtr_cases.pl
@@ -62,7 +62,7 @@ sub collect_test_cases ($) {
foreach my $tname ( @::opt_cases ) { # Run in specified order, no sort
my $elem= undef;
my $component_id= undef;
-
+
# Get rid of directory part (path). Leave the extension since it is used
# to understand type of the test.
@@ -390,6 +390,7 @@ sub collect_one_test_case($$$$$$$) {
{
$tinfo->{'skip'}= 1;
$tinfo->{'comment'}= "No tests with sh scripts on Windows";
+ return;
}
else
{
@@ -404,6 +405,7 @@ sub collect_one_test_case($$$$$$$) {
{
$tinfo->{'skip'}= 1;
$tinfo->{'comment'}= "No tests with sh scripts on Windows";
+ return;
}
else
{
@@ -448,6 +450,7 @@ sub collect_one_test_case($$$$$$$) {
{
$tinfo->{'skip'}= 1;
$tinfo->{'disable'}= 1; # Sub type of 'skip'
+ return;
}
}
@@ -457,16 +460,19 @@ sub collect_one_test_case($$$$$$$) {
{
$tinfo->{'skip'}= 1;
$tinfo->{'comment'}= "No IM with embedded server";
+ return;
}
elsif ( $::opt_ps_protocol )
{
$tinfo->{'skip'}= 1;
$tinfo->{'comment'}= "No IM with --ps-protocol";
+ return;
}
elsif ( $::opt_skip_im )
{
$tinfo->{'skip'}= 1;
$tinfo->{'comment'}= "No IM tests(--skip-im)";
+ return;
}
}
else
@@ -477,18 +483,21 @@ sub collect_one_test_case($$$$$$$) {
{
$tinfo->{'skip'}= 1;
$tinfo->{'comment'}= "Test need 'big-test' option";
+ return;
}
if ( $tinfo->{'ndb_extra'} and ! $::opt_ndb_extra_test )
{
$tinfo->{'skip'}= 1;
$tinfo->{'comment'}= "Test need 'ndb_extra' option";
+ return;
}
if ( $tinfo->{'require_manager'} )
{
$tinfo->{'skip'}= 1;
$tinfo->{'comment'}= "Test need the _old_ manager(to be removed)";
+ return;
}
if ( defined $tinfo->{'binlog_format'} and
@@ -496,12 +505,14 @@ sub collect_one_test_case($$$$$$$) {
{
$tinfo->{'skip'}= 1;
$tinfo->{'comment'}= "Not running with binlog format '$tinfo->{'binlog_format'}'";
+ return;
}
if ( $tinfo->{'need_debug'} && ! $::debug_compiled_binaries )
{
$tinfo->{'skip'}= 1;
$tinfo->{'comment'}= "Test need debug binaries";
+ return;
}
}
@@ -512,6 +523,7 @@ sub collect_one_test_case($$$$$$$) {
{
$tinfo->{'skip'}= 1;
$tinfo->{'comment'}= "Can't restart a running server";
+ return;
}
}
@@ -538,8 +550,6 @@ sub mtr_options_from_test_file($$) {
while ( my $line= <$F> )
{
- chomp;
-
next if ( $line !~ /^--/ );
# Match this line against tag in "tags" array
diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl
index 027f5e0f95e..868b6d4f1ec 100644
--- a/mysql-test/lib/mtr_process.pl
+++ b/mysql-test/lib/mtr_process.pl
@@ -461,14 +461,6 @@ sub mtr_kill_leftovers () {
mtr_debug("Got pid: $pid from file '$pidfile'");
- # Race, could have been removed between I tested with -f
- # and the unlink() below, so I better check again with -f
-
- if ( ! unlink($pidfile) and -f $pidfile )
- {
- mtr_error("can't remove $pidfile");
- }
-
if ( $::glob_cygwin_perl or kill(0, $pid) )
{
mtr_debug("There is process with pid $pid -- scheduling for kill.");
diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run-shell.sh
index f2200c4be07..f2200c4be07 100644
--- a/mysql-test/mysql-test-run.sh
+++ b/mysql-test/mysql-test-run-shell.sh
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index d9a74102e8f..e5ed8a99304 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -257,7 +257,7 @@ our $opt_result_ext;
our $opt_skip;
our $opt_skip_rpl;
-our $use_slaves;
+our $max_slave_num= 0;
our $use_innodb;
our $opt_skip_test;
our $opt_skip_im;
@@ -269,7 +269,7 @@ our $opt_sleep_time_for_delete= 10;
our $opt_testcase_timeout;
our $opt_suite_timeout;
my $default_testcase_timeout= 15; # 15 min max
-my $default_suite_timeout= 120; # 2 hours max
+my $default_suite_timeout= 180; # 3 hours max
our $opt_socket;
@@ -428,7 +428,13 @@ sub main () {
{
$need_ndbcluster||= $test->{ndb_test};
$need_im||= $test->{component_id} eq 'im';
- $use_slaves||= $test->{slave_num};
+
+ # Count max number of slaves used by a test case
+ if ( $test->{slave_num} > $max_slave_num)
+ {
+ $max_slave_num= $test->{slave_num};
+ mtr_error("Too many slaves") if $max_slave_num > 3;
+ }
$use_innodb||= $test->{'innodb_test'};
}
$opt_skip_ndbcluster= $opt_skip_ndbcluster_slave= 1
@@ -906,13 +912,13 @@ sub command_line_setup () {
if ( ! $opt_testcase_timeout )
{
$opt_testcase_timeout= $default_testcase_timeout;
- $opt_testcase_timeout*= 10 if defined $opt_valgrind;
+ $opt_testcase_timeout*= 10 if $opt_valgrind;
}
if ( ! $opt_suite_timeout )
{
$opt_suite_timeout= $default_suite_timeout;
- $opt_suite_timeout*= 4 if defined $opt_valgrind;
+ $opt_suite_timeout*= 6 if $opt_valgrind;
}
# Increase times to wait for executables to start if using valgrind
@@ -944,6 +950,7 @@ sub command_line_setup () {
$master->[0]=
{
+ pid => 0,
type => "master",
idx => 0,
path_myddir => "$opt_vardir/master-data",
@@ -959,6 +966,7 @@ sub command_line_setup () {
$master->[1]=
{
+ pid => 0,
type => "master",
idx => 1,
path_myddir => "$opt_vardir/master1-data",
@@ -974,6 +982,7 @@ sub command_line_setup () {
$slave->[0]=
{
+ pid => 0,
type => "slave",
idx => 0,
path_myddir => "$opt_vardir/slave-data",
@@ -990,6 +999,7 @@ sub command_line_setup () {
$slave->[1]=
{
+ pid => 0,
type => "slave",
idx => 1,
path_myddir => "$opt_vardir/slave1-data",
@@ -1005,6 +1015,7 @@ sub command_line_setup () {
$slave->[2]=
{
+ pid => 0,
type => "slave",
idx => 2,
path_myddir => "$opt_vardir/slave2-data",
@@ -1067,7 +1078,7 @@ sub command_line_setup () {
connect_string => "$opt_ndbconnectstring",
path_pid => "$data_dir/ndb_3.pid", # Nodes + 1
pid => 0, # pid of ndb_mgmd
- installed_ok => 'NO',
+ installed_ok => 0,
};
$data_dir= "$opt_vardir/ndbcluster-$opt_ndbcluster_port_slave";
@@ -1080,7 +1091,7 @@ sub command_line_setup () {
connect_string => "$opt_ndbconnectstring_slave",
path_pid => "$data_dir/ndb_2.pid", # Nodes + 1
pid => 0, # pid of ndb_mgmd
- installed_ok => 'NO',
+ installed_ok => 0,
};
# Init pids of ndbd's
@@ -1120,11 +1131,9 @@ sub snapshot_setup () {
$master->[0]->{'path_myddir'},
$master->[1]->{'path_myddir'});
- if ($use_slaves)
+ for (my $idx= 0; $idx < $max_slave_num; $idx++)
{
- push @data_dir_lst, ($slave->[0]->{'path_myddir'},
- $slave->[1]->{'path_myddir'},
- $slave->[2]->{'path_myddir'});
+ push(@data_dir_lst, $slave->[$idx]->{'path_myddir'});
}
unless ($opt_skip_im)
@@ -1175,9 +1184,9 @@ sub executable_setup () {
"$path_client_bindir/mysqld-nt",
"$path_client_bindir/mysqld",
"$path_client_bindir/mysqld-max",
+ "$path_client_bindir/mysqld-debug",
"$glob_basedir/sql/release/mysqld",
"$glob_basedir/sql/debug/mysqld");
- "$path_client_bindir/mysqld-debug",
$path_language= mtr_path_exists("$glob_basedir/share/english/",
"$glob_basedir/sql/share/english/");
$path_charsetsdir= mtr_path_exists("$glob_basedir/share/charsets",
@@ -1340,7 +1349,7 @@ sub environment_setup () {
umask(022);
- my $extra_ld_library_paths;
+ my @ld_library_paths;
# --------------------------------------------------------------------------
# Setup LD_LIBRARY_PATH so the libraries from this distro/clone
@@ -1348,34 +1357,50 @@ sub environment_setup () {
# --------------------------------------------------------------------------
if ( $opt_source_dist )
{
- $extra_ld_library_paths= "$glob_basedir/libmysql/.libs/" .
- ":$glob_basedir/libmysql_r/.libs/";
+ push(@ld_library_paths, "$glob_basedir/libmysql/.libs/",
+ "$glob_basedir/libmysql_r/.libs/");
}
else
{
- $extra_ld_library_paths= "$glob_basedir/lib";
+ push(@ld_library_paths, "$glob_basedir/lib");
+ }
+
+ # --------------------------------------------------------------------------
+ # Add the path where libndbclient can be found
+ # --------------------------------------------------------------------------
+ if ( $opt_ndbcluster_supported )
+ {
+ push(@ld_library_paths, "$glob_basedir/storage/ndb/src/.libs");
}
# --------------------------------------------------------------------------
# Add the path where mysqld will find udf_example.so
# --------------------------------------------------------------------------
- $extra_ld_library_paths .= ":" .
- ($lib_udf_example ? dirname($lib_udf_example) : "");
+ if ( $lib_udf_example )
+ {
+ push(@ld_library_paths, dirname($lib_udf_example));
+ }
# --------------------------------------------------------------------------
- # Add the path where libndbclient can be found
+ # Valgrind need to be run with debug libraries otherwise it's almost
+ # impossible to add correct supressions, that means if "/usr/lib/debug"
+ # is available, it should be added to
+ # LD_LIBRARY_PATH
# --------------------------------------------------------------------------
- if ( $opt_ndbcluster_supported )
+ my $debug_libraries_path= "/usr/lib/debug";
+ if ( $opt_valgrind and -d $debug_libraries_path )
{
- $extra_ld_library_paths .= ":$glob_basedir/storage/ndb/src/.libs";
+ push(@ld_library_paths, $debug_libraries_path);
}
- $ENV{'LD_LIBRARY_PATH'}=
- "$extra_ld_library_paths" .
- ($ENV{'LD_LIBRARY_PATH'} ? ":$ENV{'LD_LIBRARY_PATH'}" : "");
- $ENV{'DYLD_LIBRARY_PATH'}=
- "$extra_ld_library_paths" .
- ($ENV{'DYLD_LIBRARY_PATH'} ? ":$ENV{'DYLD_LIBRARY_PATH'}" : "");
+ $ENV{'LD_LIBRARY_PATH'}= join(":", @ld_library_paths,
+ split(':', $ENV{'LD_LIBRARY_PATH'}));
+ mtr_debug("LD_LIBRARY_PATH: $ENV{'LD_LIBRARY_PATH'}");
+
+ $ENV{'DYLD_LIBRARY_PATH'}= join(":", @ld_library_paths,
+ split(':', $ENV{'DYLD_LIBRARY_PATH'}));
+ mtr_debug("DYLD_LIBRARY_PATH: $ENV{'DYLD_LIBRARY_PATH'}");
+
# --------------------------------------------------------------------------
# Also command lines in .opt files may contain env vars
@@ -1542,7 +1567,8 @@ sub environment_setup () {
my $cmdline_mysql=
"$exe_mysql --no-defaults --host=localhost --user=root --password= " .
"--port=$master->[0]->{'port'} " .
- "--socket=$master->[0]->{'path_sock'}";
+ "--socket=$master->[0]->{'path_sock'} ".
+ "--character-sets-dir=$path_charsetsdir";
$ENV{'MYSQL'}= $cmdline_mysql;
@@ -1665,7 +1691,7 @@ sub kill_running_server () {
{
# Ensure that no old mysqld test servers are running
# This is different from terminating processes we have
- # started from ths run of the script, this is terminating
+ # started from this run of the script, this is terminating
# leftovers from previous runs.
mtr_kill_leftovers();
@@ -2253,11 +2279,10 @@ sub mysql_install_db () {
# FIXME check if testcase really is using second master
copy_install_db('master', $master->[1]->{'path_myddir'});
- if ( $use_slaves )
+ # Install the number of slave databses needed
+ for (my $idx= 0; $idx < $max_slave_num; $idx++)
{
- install_db('slave', $slave->[0]->{'path_myddir'});
- install_db('slave', $slave->[1]->{'path_myddir'});
- install_db('slave', $slave->[2]->{'path_myddir'});
+ copy_install_db("slave".($idx+1), $slave->[$idx]->{'path_myddir'});
}
if ( ! $opt_skip_im )
@@ -2268,7 +2293,7 @@ sub mysql_install_db () {
my $cluster_started_ok= 1; # Assume it can be started
if (ndbcluster_start_install($clusters->[0]) ||
- $use_slaves && ndbcluster_start_install($clusters->[1]))
+ $max_slave_num && ndbcluster_start_install($clusters->[1]))
{
mtr_warning("Failed to start install of cluster");
$cluster_started_ok= 0;
@@ -2279,21 +2304,18 @@ sub mysql_install_db () {
next if !$cluster->{'pid'};
- $cluster->{'installed_ok'}= "YES"; # Assume install suceeds
+ $cluster->{'installed_ok'}= 1; # Assume install suceeds
if (ndbcluster_wait_started($cluster, ""))
{
# failed to install, disable usage and flag that its no ok
mtr_report("ndbcluster_install of $cluster->{'name'} failed");
- $cluster->{"installed_ok"}= "NO";
+ $cluster->{"installed_ok"}= 0;
$cluster_started_ok= 0;
}
}
- $ENV{'NDB_STATUS_OK'}= $clusters->[0]->{'installed_ok'};
- $ENV{'NDB_SLAVE_STATUS_OK'}= $clusters->[1]->{'installed_ok'};;
-
if ( ! $cluster_started_ok )
{
if ( $opt_force)
@@ -2371,6 +2393,12 @@ sub install_db ($$) {
mtr_add_arg($args, "--skip-ndbcluster");
mtr_add_arg($args, "--tmpdir=.");
+ if ( $opt_debug )
+ {
+ mtr_add_arg($args, "--debug=d:t:i:A,%s/log/bootstrap_%s.trace",
+ $opt_vardir_trace, $type);
+ }
+
if ( ! $opt_netware )
{
mtr_add_arg($args, "--language=%s", $path_language);
@@ -2485,6 +2513,28 @@ sub im_prepare_data_dir($) {
}
}
+
+
+#
+# Restore snapshot of the installed slave databases
+# if the snapshot exists
+#
+sub restore_slave_databases ($) {
+ my ($num_slaves)= @_;
+
+ if ( -d $path_snapshot)
+ {
+ for (my $idx= 0; $idx < $num_slaves; $idx++)
+ {
+ my $data_dir= $slave->[$idx]->{'path_myddir'};
+ my $name= basename($data_dir);
+ rmtree($data_dir);
+ mtr_copy_dir("$path_snapshot/$name", $data_dir);
+ }
+ }
+}
+
+
sub run_testcase_check_skip_test($)
{
my ($tinfo)= @_;
@@ -2504,7 +2554,7 @@ sub run_testcase_check_skip_test($)
}
# If test needs cluster, check that master installed ok
- if ( $tinfo->{'ndb_test'} and $clusters->[0]->{'installed_ok'} eq "NO" )
+ if ( $tinfo->{'ndb_test'} and !$clusters->[0]->{'installed_ok'} )
{
mtr_report_test_name($tinfo);
mtr_report_test_failed($tinfo);
@@ -2513,7 +2563,7 @@ sub run_testcase_check_skip_test($)
# If test needs slave cluster, check that it installed ok
if ( $tinfo->{'ndb_test'} and $tinfo->{'slave_num'} and
- $clusters->[1]->{'installed_ok'} eq "NO" )
+ !$clusters->[1]->{'installed_ok'} )
{
mtr_report_test_name($tinfo);
mtr_report_test_failed($tinfo);
@@ -2592,7 +2642,6 @@ sub run_testcase ($) {
{
run_testcase_stop_servers($tinfo, $master_restart, $slave_restart);
}
-
my $died= mtr_record_dead_children();
if ($died or $master_restart or $slave_restart)
{
@@ -2881,7 +2930,7 @@ sub mysqld_arguments ($$$$$) {
mtr_add_arg($args, "%s--console", $prefix);
mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir);
mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir);
- mtr_add_arg($args, "%s--core", $prefix);
+
mtr_add_arg($args, "%s--log-bin-trust-function-creators", $prefix);
mtr_add_arg($args, "%s--default-character-set=latin1", $prefix);
mtr_add_arg($args, "%s--language=%s", $prefix, $path_language);
@@ -2942,8 +2991,6 @@ sub mysqld_arguments ($$$$$) {
mtr_add_arg($args, "%s--datadir=%s", $prefix,
$slave->[$idx]->{'path_myddir'});
- # FIXME slave get this option twice?!
- mtr_add_arg($args, "%s--exit-info=256", $prefix);
mtr_add_arg($args, "%s--init-rpl-role=slave", $prefix);
if (! $opt_skip_slave_binlog)
{
@@ -3061,9 +3108,22 @@ sub mysqld_arguments ($$$$$) {
mtr_add_arg($args, "%s--user=root", $prefix);
}
+ my $found_skip_core= 0;
foreach my $arg ( @opt_extra_mysqld_opt, @$extra_opt )
{
- mtr_add_arg($args, "%s%s", $prefix, $arg);
+ # Allow --skip-core-file to be set in master.opt file
+ if ($arg eq "--skip-core-file")
+ {
+ $found_skip_core= 1;
+ }
+ else
+ {
+ mtr_add_arg($args, "%s%s", $prefix, $arg);
+ }
+ }
+ if ( !$found_skip_core )
+ {
+ mtr_add_arg($args, "%s%s", $prefix, "--core-file");
}
if ( $opt_bench )
@@ -3073,7 +3133,6 @@ sub mysqld_arguments ($$$$$) {
}
elsif ( $type eq 'master' )
{
- mtr_add_arg($args, "%s--exit-info=256", $prefix);
mtr_add_arg($args, "%s--open-files-limit=1024", $prefix);
mtr_add_arg($args, "%s--log=%s", $prefix, $master->[0]->{'path_mylog'});
}
@@ -3105,13 +3164,13 @@ sub mysqld_start ($$$) {
{
$exe= $exe_master_mysqld;
}
- if ( $type eq 'slave' )
+ elsif ( $type eq 'slave' )
{
$exe= $exe_slave_mysqld;
}
else
{
- $exe= $exe_mysqld;
+ mtr_error("Unknown 'type' \"$type\" passed to mysqld_start");
}
mtr_init_args(\$args);
@@ -3415,7 +3474,6 @@ sub run_testcase_stop_servers($$$) {
my %admin_pids; # hash of admin processes that requests shutdown
my @kill_pids; # list of processes to shutdown/kill
-
# Remember if we restarted for this test case
$tinfo->{'restarted'}= $do_restart;
@@ -3622,6 +3680,8 @@ sub run_testcase_start_servers($) {
{
mtr_tofile($slave->[0]->{'path_myerr'},"CURRENT_TEST: $tname\n");
+ restore_slave_databases($tinfo->{'slave_num'});
+
do_before_start_slave($tname,$tinfo->{'slave_sh'});
if ( ! $opt_skip_ndbcluster_slave and
@@ -3731,7 +3791,6 @@ sub run_check_testcase ($$) {
sub run_mysqltest ($) {
my ($tinfo)= @_;
-
my $exe= $exe_mysqltest;
my $args;
diff --git a/mysql-test/r/analyse.result b/mysql-test/r/analyse.result
index ba56a98b4a9..b1ed1ea2bed 100644
--- a/mysql-test/r/analyse.result
+++ b/mysql-test/r/analyse.result
@@ -141,3 +141,16 @@ test.t1.product Computer TV 2 8 0 0 4.2500 NULL ENUM('Computer','Phone','TV') NO
sum(profit) 10 6900 11 11 0 0 1946.2500 2867.6719 ENUM('10','275','600','6900') NOT NULL
avg(profit) 10.0000 1380.0000 16 16 0 0 394.68750000 570.20033144 ENUM('10.0000','68.7500','120.0000','1380.0000') NOT NULL
drop table t1,t2;
+create table t1 (f1 double(10,5), f2 char(10), f3 double(10,5));
+insert into t1 values (5.999, "5.9999", 5.99999), (9.555, "9.5555", 9.55555);
+select f1 from t1 procedure analyse(1, 1);
+Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
+test.t1.f1 5.99900 9.55500 7 7 0 0 7.77700 1.77800 FLOAT(4,3) NOT NULL
+select f2 from t1 procedure analyse(1, 1);
+Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
+test.t1.f2 5.9999 9.5555 6 6 0 0 6.0000 NULL FLOAT(5,4) UNSIGNED NOT NULL
+select f3 from t1 procedure analyse(1, 1);
+Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
+test.t1.f3 5.99999 9.55555 7 7 0 0 7.77777 1.77778 FLOAT(6,5) NOT NULL
+drop table t1;
+End of 4.1 tests
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 2b9602215fb..6f6c6379ace 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -1340,6 +1340,18 @@ select a from t1 group by a;
a
e
drop table t1;
+create table t1(a char(10)) default charset utf8;
+insert into t1 values ('123'), ('456');
+explain
+select substr(Z.a,-1), Z.a from t1 as Y join t1 as Z on Y.a=Z.a order by 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE Y ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
+1 SIMPLE Z ALL NULL NULL NULL NULL 2 Using where
+select substr(Z.a,-1), Z.a from t1 as Y join t1 as Z on Y.a=Z.a order by 1;
+substr(Z.a,-1) a
+3 123
+6 456
+drop table t1;
CREATE TABLE t1(id varchar(20) NOT NULL) DEFAULT CHARSET=utf8;
INSERT INTO t1 VALUES ('xxx'), ('aa'), ('yyy'), ('aa');
SELECT id FROM t1;
diff --git a/mysql-test/r/execution_constants.result b/mysql-test/r/execution_constants.result
new file mode 100644
index 00000000000..293c88dc506
--- /dev/null
+++ b/mysql-test/r/execution_constants.result
@@ -0,0 +1,12 @@
+CREATE TABLE `t_bug21476` (
+`ID_BOARD` smallint(5) unsigned NOT NULL default '0',
+`ID_MEMBER` mediumint(8) unsigned NOT NULL default '0',
+`logTime` int(10) unsigned NOT NULL default '0',
+`ID_MSG` mediumint(8) unsigned NOT NULL default '0',
+PRIMARY KEY (`ID_MEMBER`,`ID_BOARD`),
+KEY `logTime` (`logTime`)
+) ENGINE=MyISAM DEFAULT CHARSET=cp1251 COLLATE=cp1251_bulgarian_ci;
+INSERT INTO `t_bug21476` VALUES (2,2,1154870939,0),(1,2,1154870957,0),(2,183,1154941362,0),(2,84,1154904301,0),(1,84,1154905867,0),(2,13,1154947484,10271),(3,84,1154880549,0),(1,6,1154892183,0),(2,25,1154947581,10271),(3,25,1154904760,0),(1,25,1154947373,10271),(1,179,1154899992,0),(2,179,1154899410,0),(5,25,1154901666,0),(2,329,1154902026,0),(3,329,1154902040,0),(1,329,1154902058,0),(1,13,1154930841,0),(3,85,1154904987,0),(1,183,1154929665,0),(3,13,1154931268,0),(1,85,1154936888,0),(1,169,1154937959,0),(2,169,1154941717,0),(3,183,1154939810,0),(3,169,1154941734,0);
+Assertion: mysql_errno 1436 == 1436
+DROP TABLE `t_bug21476`;
+End of 5.0 tests.
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
index 34507e0491c..82c361edd39 100644
--- a/mysql-test/r/func_time.result
+++ b/mysql-test/r/func_time.result
@@ -890,6 +890,18 @@ t1 CREATE TABLE `t1` (
`from_unixtime(1) + 0` double(23,6) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
+SET NAMES latin1;
+SET character_set_results = NULL;
+SHOW VARIABLES LIKE 'character_set_results';
+Variable_name Value
+character_set_results
+CREATE TABLE testBug8868 (field1 DATE, field2 VARCHAR(32) CHARACTER SET BINARY);
+INSERT INTO testBug8868 VALUES ('2006-09-04', 'abcd');
+SELECT DATE_FORMAT(field1,'%b-%e %l:%i%p') as fmtddate, field2 FROM testBug8868;
+fmtddate field2
+Sep-4 12:00AM abcd
+DROP TABLE testBug8868;
+SET NAMES DEFAULT;
(select time_format(timediff(now(), DATE_SUB(now(),INTERVAL 5 DAY)),'%H') As H)
union
(select time_format(timediff(now(), DATE_SUB(now(),INTERVAL 5 DAY)),'%H') As H);
diff --git a/mysql-test/r/have_ndb_status_ok.require b/mysql-test/r/have_ndb_status_ok.require
deleted file mode 100644
index 8a82871234b..00000000000
--- a/mysql-test/r/have_ndb_status_ok.require
+++ /dev/null
@@ -1,2 +0,0 @@
-ndb_status_ok
-YES
diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result
index 10c89effa8b..ce9fb6941f3 100644
--- a/mysql-test/r/mysqltest.result
+++ b/mysql-test/r/mysqltest.result
@@ -217,8 +217,11 @@ hej
a long variable content
a long variable content
-a long $where variable content
+a long a long variable content variable content
+a long \$where variable content
+banana = banana
+Not a banana: ba\$cat\$cat
mysqltest: At line 1: Missing arguments to let
mysqltest: At line 1: Missing variable name in let
mysqltest: At line 1: Missing assignment operator in let
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result
index 6c37f0834e9..65f3b7ebc64 100644
--- a/mysql-test/r/partition.result
+++ b/mysql-test/r/partition.result
@@ -7,7 +7,7 @@ drop table t1;
create table t1 (a int)
partition by key(a)
partitions 0.2+e1;
-ERROR 42000: Only normal integers allowed as number here near '0.2+e1' at line 3
+ERROR 42000: Only integers allowed as number here near '0.2+e1' at line 3
create table t1 (a int)
partition by key(a)
partitions -1;
@@ -15,11 +15,11 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
create table t1 (a int)
partition by key(a)
partitions 1.5;
-ERROR 42000: Only normal integers allowed as number here near '1.5' at line 3
+ERROR 42000: Only integers allowed as number here near '1.5' at line 3
create table t1 (a int)
partition by key(a)
partitions 1e+300;
-ERROR 42000: Only normal integers allowed as number here near '1e+300' at line 3
+ERROR 42000: Only integers allowed as number here near '1e+300' at line 3
create table t1 (a int)
engine = innodb
partition by key (a);
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index 37f8663af81..b7dae03bf47 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -499,6 +499,54 @@ create temporary table if not exists t1 (a1 int);
execute stmt;
drop temporary table t1;
deallocate prepare stmt;
+CREATE TABLE t1(
+ID int(10) unsigned NOT NULL auto_increment,
+Member_ID varchar(15) NOT NULL default '',
+Action varchar(12) NOT NULL,
+Action_Date datetime NOT NULL,
+Track varchar(15) default NULL,
+User varchar(12) default NULL,
+Date_Updated timestamp NOT NULL default CURRENT_TIMESTAMP on update
+CURRENT_TIMESTAMP,
+PRIMARY KEY (ID),
+KEY Action (Action),
+KEY Action_Date (Action_Date)
+);
+INSERT INTO t1(Member_ID, Action, Action_Date, Track) VALUES
+('111111', 'Disenrolled', '2006-03-01', 'CAD' ),
+('111111', 'Enrolled', '2006-03-01', 'CAD' ),
+('111111', 'Disenrolled', '2006-07-03', 'CAD' ),
+('222222', 'Enrolled', '2006-03-07', 'CAD' ),
+('222222', 'Enrolled', '2006-03-07', 'CHF' ),
+('222222', 'Disenrolled', '2006-08-02', 'CHF' ),
+('333333', 'Enrolled', '2006-03-01', 'CAD' ),
+('333333', 'Disenrolled', '2006-03-01', 'CAD' ),
+('444444', 'Enrolled', '2006-03-01', 'CAD' ),
+('555555', 'Disenrolled', '2006-03-01', 'CAD' ),
+('555555', 'Enrolled', '2006-07-21', 'CAD' ),
+('555555', 'Disenrolled', '2006-03-01', 'CHF' ),
+('666666', 'Enrolled', '2006-02-09', 'CAD' ),
+('666666', 'Enrolled', '2006-05-12', 'CHF' ),
+('666666', 'Disenrolled', '2006-06-01', 'CAD' );
+PREPARE STMT FROM
+"SELECT GROUP_CONCAT(Track SEPARATOR ', ') FROM t1
+ WHERE Member_ID=? AND Action='Enrolled' AND
+ (Track,Action_Date) IN (SELECT Track, MAX(Action_Date) FROM t1
+ WHERE Member_ID=?
+ GROUP BY Track
+ HAVING Track>='CAD' AND
+ MAX(Action_Date)>'2006-03-01')";
+SET @id='111111';
+EXECUTE STMT USING @id,@id;
+GROUP_CONCAT(Track SEPARATOR ', ')
+NULL
+SET @id='222222';
+EXECUTE STMT USING @id,@id;
+GROUP_CONCAT(Track SEPARATOR ', ')
+CAD
+DEALLOCATE PREPARE STMT;
+DROP TABLE t1;
+End of 4.1 tests
create table t1 (a varchar(20));
insert into t1 values ('foo');
prepare stmt FROM 'SELECT char_length (a) FROM t1';
diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result
index 25475b8cd45..13ad8ec16d5 100644
--- a/mysql-test/r/strict.result
+++ b/mysql-test/r/strict.result
@@ -925,10 +925,10 @@ Warning 1264 Out of range value for column 'col2' at row 1
Warning 1264 Out of range value for column 'col2' at row 1
SELECT * FROM t1;
col1 col2
-0 0
+-2.2e-307 0
1e-303 0
1.7e+308 1.7e+308
-0 0
+-2.2e-307 0
-2e-307 0
1.7e+308 1.7e+308
0 NULL
diff --git a/mysql-test/r/type_bit.result b/mysql-test/r/type_bit.result
index 08a1b229491..5c9b70fadc3 100644
--- a/mysql-test/r/type_bit.result
+++ b/mysql-test/r/type_bit.result
@@ -602,4 +602,12 @@ NULL NULL
0 0
11111111 11111111
drop table bug15583;
+create table t1(a bit(1), b smallint unsigned);
+insert into t1 (b, a) values ('2', '1');
+Warnings:
+Warning 1264 Out of range value for column 'a' at row 1
+select hex(a), b from t1;
+hex(a) b
+1 2
+drop table t1;
End of 5.0 tests
diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result
index cfae61d5e91..d28131cc456 100644
--- a/mysql-test/r/type_float.result
+++ b/mysql-test/r/type_float.result
@@ -262,6 +262,13 @@ desc t3;
Field Type Null Key Default Extra
a decimal(21,2) NO 0.00
drop table t1,t2,t3;
+select 1e-308, 1.00000001e-300, 100000000e-300;
+1e-308 1.00000001e-300 100000000e-300
+0 1.00000001e-300 1e-292
+select 10e307;
+10e307
+1e+308
+End of 4.1 tests
create table t1 (s1 float(0,2));
ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 's1').
create table t1 (s1 float(1,2));
diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result
index 26b3c1625aa..3e2e47ef740 100644
--- a/mysql-test/r/warnings.result
+++ b/mysql-test/r/warnings.result
@@ -229,3 +229,59 @@ a
select * from t1 limit 0, 0;
a
drop table t1;
+End of 4.1 tests
+CREATE TABLE t1( f1 CHAR(20) );
+CREATE TABLE t2( f1 CHAR(20), f2 CHAR(25) );
+CREATE TABLE t3( f1 CHAR(20), f2 CHAR(25), f3 DATE );
+INSERT INTO t1 VALUES ( 'a`' );
+INSERT INTO t2 VALUES ( 'a`', 'a`' );
+INSERT INTO t3 VALUES ( 'a`', 'a`', '1000-01-1' );
+DROP PROCEDURE IF EXISTS sp1;
+Warnings:
+Note 1305 PROCEDURE sp1 does not exist
+DROP PROCEDURE IF EXISTS sp2;
+Warnings:
+Note 1305 PROCEDURE sp2 does not exist
+DROP PROCEDURE IF EXISTS sp3;
+Warnings:
+Note 1305 PROCEDURE sp3 does not exist
+CREATE PROCEDURE sp1()
+BEGIN
+DECLARE x NUMERIC ZEROFILL;
+SELECT f1 INTO x FROM t1 LIMIT 1;
+END//
+CREATE PROCEDURE sp2()
+BEGIN
+DECLARE x NUMERIC ZEROFILL;
+SELECT f1 INTO x FROM t2 LIMIT 1;
+END//
+CREATE PROCEDURE sp3()
+BEGIN
+DECLARE x NUMERIC ZEROFILL;
+SELECT f1 INTO x FROM t3 LIMIT 1;
+END//
+CALL sp1();
+Warnings:
+Warning 1366 Incorrect decimal value: 'a`' for column 'x' at row 1
+CALL sp2();
+Warnings:
+Warning 1366 Incorrect decimal value: 'a`' for column 'x' at row 1
+CALL sp3();
+Warnings:
+Warning 1366 Incorrect decimal value: 'a`' for column 'x' at row 1
+DROP PROCEDURE IF EXISTS sp1;
+CREATE PROCEDURE sp1()
+BEGIN
+declare x numeric unsigned zerofill;
+SELECT f1 into x from t2 limit 1;
+END//
+CALL sp1();
+Warnings:
+Warning 1366 Incorrect decimal value: 'a`' for column 'x' at row 1
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP PROCEDURE sp1;
+DROP PROCEDURE sp2;
+DROP PROCEDURE sp3;
+End of 5.0 tests
diff --git a/mysql-test/r/windows.result b/mysql-test/r/windows.result
index e3241daf719..039c5b1476e 100644
--- a/mysql-test/r/windows.result
+++ b/mysql-test/r/windows.result
@@ -6,31 +6,3 @@ use prn;
ERROR 42000: Unknown database 'prn'
create table nu (a int);
drop table nu;
-CREATE TABLE `t1` (
-`TIM` datetime NOT NULL,
-`VAL` double default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-CREATE TABLE `t2` (
-`TIM` datetime NOT NULL,
-`VAL` double default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-CREATE TABLE `mt` (
-`TIM` datetime NOT NULL,
-`VAL` double default NULL
-) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=LAST
-UNION=(`t1`,`t2`);
-INSERT INTO mt VALUES ('2006-01-01',0);
-ALTER TABLE `t2` RENAME TO `t`;
-INSERT INTO mt VALUES ('2006-01-01',0);
-ERROR HY000: Can't lock file (errno: 155)
-select * from mt;
-ERROR HY000: Can't lock file (errno: 155)
-FLUSH TABLES;
-select * from mt;
-ERROR HY000: Can't find file: 'mt' (errno: 2)
-ALTER TABLE `t` RENAME TO `t2`;
-INSERT INTO mt VALUES ('2006-01-01',0);
-select * from mt;
-TIM VAL
-2006-01-01 00:00:00 0
-2006-01-01 00:00:00 0
diff --git a/mysql-test/t/analyse.test b/mysql-test/t/analyse.test
index a248c671c18..efcf5f6421c 100644
--- a/mysql-test/t/analyse.test
+++ b/mysql-test/t/analyse.test
@@ -90,5 +90,16 @@ create table t2 (country_id int primary key, country char(20) not null);
insert into t2 values (1, 'USA'),(2,'India'), (3,'Finland');
select product, sum(profit),avg(profit) from t1 group by product with rollup procedure analyse();
drop table t1,t2;
-# End of 4.1 tests
+#
+# Bug #20305 PROCEDURE ANALYSE() returns wrong M for FLOAT(M, D) and DOUBLE(M, D)
+#
+
+create table t1 (f1 double(10,5), f2 char(10), f3 double(10,5));
+insert into t1 values (5.999, "5.9999", 5.99999), (9.555, "9.5555", 9.55555);
+select f1 from t1 procedure analyse(1, 1);
+select f2 from t1 procedure analyse(1, 1);
+select f3 from t1 procedure analyse(1, 1);
+drop table t1;
+
+--echo End of 4.1 tests
diff --git a/mysql-test/t/crash_commit_before-master.opt b/mysql-test/t/crash_commit_before-master.opt
new file mode 100644
index 00000000000..a745693594e
--- /dev/null
+++ b/mysql-test/t/crash_commit_before-master.opt
@@ -0,0 +1,2 @@
+--skip-stack-trace --skip-core-file
+
diff --git a/mysql-test/t/crash_commit_before.test b/mysql-test/t/crash_commit_before.test
index c46340d44dc..a10cf254a83 100644
--- a/mysql-test/t/crash_commit_before.test
+++ b/mysql-test/t/crash_commit_before.test
@@ -1,4 +1,9 @@
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+
+# Binary must be compiled with debug for crash to occur
--source include/have_debug.inc
+
--source include/have_innodb.inc
CREATE TABLE t1(a int) engine=innodb;
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index 5e3a3f640b1..3b111b02ec8 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -1069,6 +1069,17 @@ explain select a from t1 group by a;
select a from t1 group by a;
drop table t1;
+#
+# Bug #20204: "order by" changes the results returned
+#
+
+create table t1(a char(10)) default charset utf8;
+insert into t1 values ('123'), ('456');
+explain
+ select substr(Z.a,-1), Z.a from t1 as Y join t1 as Z on Y.a=Z.a order by 1;
+select substr(Z.a,-1), Z.a from t1 as Y join t1 as Z on Y.a=Z.a order by 1;
+drop table t1;
+
# End of 4.1 tests
#
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index aa301eb5566..8c4a76c78a9 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -42,8 +42,5 @@ rpl_multi_engine : BUG#22583 2006-09-23 lars
#rpl_ndb_idempotent : BUG#21298 2006-07-27 msvensson
#rpl_row_basic_7ndb : BUG#21298 2006-07-27 msvensson
#rpl_truncate_7ndb : BUG#21298 2006-07-27 msvensson
-crash_commit_before : 2006-08-02 msvensson
-func_group : BUG#21924 2006-08-30 reggie
-func_in : BUG#21925 2006-08-30 reggie
ndb_binlog_discover : bug#21806 2006-08-24
ndb_autodiscover3 : bug#21806
diff --git a/mysql-test/t/execution_constants.test b/mysql-test/t/execution_constants.test
new file mode 100644
index 00000000000..00967b2eeba
--- /dev/null
+++ b/mysql-test/t/execution_constants.test
@@ -0,0 +1,74 @@
+#
+# Bug#21476: Lost Database Connection During Query
+#
+# When the amount of stack space we think we need to report an error is
+# actually too small, then we can get SEGVs. But, we don't want to reserve
+# space that we could use to get real work done. So, we want the reserved
+# space small, and this test verifies that the reservation is not too small.
+
+CREATE TABLE `t_bug21476` (
+ `ID_BOARD` smallint(5) unsigned NOT NULL default '0',
+ `ID_MEMBER` mediumint(8) unsigned NOT NULL default '0',
+ `logTime` int(10) unsigned NOT NULL default '0',
+ `ID_MSG` mediumint(8) unsigned NOT NULL default '0',
+ PRIMARY KEY (`ID_MEMBER`,`ID_BOARD`),
+ KEY `logTime` (`logTime`)
+) ENGINE=MyISAM DEFAULT CHARSET=cp1251 COLLATE=cp1251_bulgarian_ci;
+
+INSERT INTO `t_bug21476` VALUES (2,2,1154870939,0),(1,2,1154870957,0),(2,183,1154941362,0),(2,84,1154904301,0),(1,84,1154905867,0),(2,13,1154947484,10271),(3,84,1154880549,0),(1,6,1154892183,0),(2,25,1154947581,10271),(3,25,1154904760,0),(1,25,1154947373,10271),(1,179,1154899992,0),(2,179,1154899410,0),(5,25,1154901666,0),(2,329,1154902026,0),(3,329,1154902040,0),(1,329,1154902058,0),(1,13,1154930841,0),(3,85,1154904987,0),(1,183,1154929665,0),(3,13,1154931268,0),(1,85,1154936888,0),(1,169,1154937959,0),(2,169,1154941717,0),(3,183,1154939810,0),(3,169,1154941734,0);
+
+delimiter //;
+let $query_head=UPDATE t_bug21476 SET ID_MSG = IF(logTime BETWEEN 1 AND 1101770053, 2, //
+let $query_tail =) WHERE logTime BETWEEN 1 AND 1104091539 AND ID_MSG = 0//
+
+# Scan over the possible stack heights, trying to recurse to exactly that
+# depth. Eventually, we will reach our imposed limit on height and try to
+# raise an error. If the remaining stack space is enough to raise that error,
+# we will get an error-number of 1436 and quit the loop. If it's not enough
+# space, we should get a SEGV
+
+# Well more than enough recursions to find the end of our stack.
+let $i = 100000//
+disable_query_log//
+disable_result_log//
+while ($i)
+{
+ # If we SEGV because the min stack size is exceeded, this would return error
+ # 2013 .
+ error 0,1436 //
+ eval $query_head 0 $query_tail//
+
+ if ($mysql_errno != 1436)
+ {
+ # We reached the place where we reported an error about the stack limit,
+ # and we successfully returned the error. That means that at the stack
+ # limit, we still have enough space reserved to report an error.
+ let $i = 1//
+ }
+
+ # Multiplying by three stack frames should be fine enough resolution.
+ # Trading exactness for speed.
+
+ # go one more level deep
+ let $query_head = $query_head IF(logTime <= 1104091$i, $i, //
+ let $query_tail =) $query_tail//
+
+ # go one more level deep
+ let $query_head = $query_head IF(logTime <= 1105091$i, $i, //
+ let $query_tail =) $query_tail//
+
+ # go one more level deep
+ let $query_head = $query_head IF(logTime <= 1106091$i, $i, //
+ let $query_tail =) $query_tail//
+
+ dec $i//
+}
+enable_result_log//
+enable_query_log//
+
+echo Assertion: mysql_errno 1436 == $mysql_errno//
+
+delimiter ;//
+DROP TABLE `t_bug21476`;
+
+--echo End of 5.0 tests.
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index 08d3ff14ca1..d49a4fed9d2 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -447,6 +447,25 @@ show create table t1;
drop table t1;
#
+# 21913: DATE_FORMAT() Crashes mysql server if I use it through
+# mysql-connector-j driver.
+#
+
+SET NAMES latin1;
+SET character_set_results = NULL;
+SHOW VARIABLES LIKE 'character_set_results';
+
+CREATE TABLE testBug8868 (field1 DATE, field2 VARCHAR(32) CHARACTER SET BINARY);
+INSERT INTO testBug8868 VALUES ('2006-09-04', 'abcd');
+
+SELECT DATE_FORMAT(field1,'%b-%e %l:%i%p') as fmtddate, field2 FROM testBug8868;
+
+DROP TABLE testBug8868;
+
+SET NAMES DEFAULT;
+
+
+#
# Bug #19844 time_format in Union truncates values
#
diff --git a/mysql-test/t/lowercase_fs_off.test b/mysql-test/t/lowercase_fs_off.test
index 7f7b573e7ee..883315994fe 100644
--- a/mysql-test/t/lowercase_fs_off.test
+++ b/mysql-test/t/lowercase_fs_off.test
@@ -3,6 +3,7 @@
# i.e. lower_case_filesystem=OFF
#
-- source include/have_case_sensitive_file_system.inc
+-- source include/not_embedded.inc
connect (master,localhost,root,,);
connection master;
diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test
index 04e0532851a..25f8d63d0b2 100644
--- a/mysql-test/t/mysqltest.test
+++ b/mysql-test/t/mysqltest.test
@@ -507,9 +507,21 @@ echo $where2;
let $where3=a long $where variable content;
echo $where3;
+let $where3=a long \\\$where variable content;
+echo $where3;
+
let $novar1= $novar2;
echo $novar1;
+let $cat=na;
+let $cat=ba$cat$cat;
+echo banana = $cat;
+
+# ba\$cat\$cat should have been sufficient.
+# ba\\\$cat\\\$cat -> ba\$cat\$cat -> ba$cat$cat -> banana
+# Magnus' upcoming patch will fix the missing second interpretation.
+let $cat=ba\\\$cat\\\$cat;
+echo Not a banana: $cat;
# Test illegal uses of let
diff --git a/mysql-test/t/type_bit.test b/mysql-test/t/type_bit.test
index 998f8f18fbe..d46ba667665 100644
--- a/mysql-test/t/type_bit.test
+++ b/mysql-test/t/type_bit.test
@@ -252,5 +252,13 @@ select hex(b + 0), bin(b + 0), oct(b + 0), hex(n), bin(n), oct(n) from bug15583;
select conv(b, 10, 2), conv(b + 0, 10, 2) from bug15583;
drop table bug15583;
+#
+# Bug #22271: data casting may affect data stored in the next column(s?)
+#
+
+create table t1(a bit(1), b smallint unsigned);
+insert into t1 (b, a) values ('2', '1');
+select hex(a), b from t1;
+drop table t1;
--echo End of 5.0 tests
diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test
index 5bfd744e4a8..965826629bd 100644
--- a/mysql-test/t/type_float.test
+++ b/mysql-test/t/type_float.test
@@ -178,7 +178,16 @@ show warnings;
desc t3;
drop table t1,t2,t3;
-# End of 4.1 tests
+#
+# Bug #22129: A small double precision number becomes zero
+#
+# check if underflows are detected correctly
+select 1e-308, 1.00000001e-300, 100000000e-300;
+
+# check if overflows are detected correctly
+select 10e307;
+
+--echo End of 4.1 tests
#
# bug #12694 (float(m,d) specifications)
diff --git a/mysql-test/t/warnings.test b/mysql-test/t/warnings.test
index c20763f203f..a8b8e5f5103 100644
--- a/mysql-test/t/warnings.test
+++ b/mysql-test/t/warnings.test
@@ -147,4 +147,60 @@ select * from t1 limit 1, 0;
select * from t1 limit 0, 0;
drop table t1;
-# End of 4.1 tests
+--echo End of 4.1 tests
+
+#
+# Bug#20778: strange characters in warning message 1366 when called in SP
+#
+
+let $engine_type= innodb;
+
+CREATE TABLE t1( f1 CHAR(20) );
+CREATE TABLE t2( f1 CHAR(20), f2 CHAR(25) );
+CREATE TABLE t3( f1 CHAR(20), f2 CHAR(25), f3 DATE );
+
+INSERT INTO t1 VALUES ( 'a`' );
+INSERT INTO t2 VALUES ( 'a`', 'a`' );
+INSERT INTO t3 VALUES ( 'a`', 'a`', '1000-01-1' );
+
+DROP PROCEDURE IF EXISTS sp1;
+DROP PROCEDURE IF EXISTS sp2;
+DROP PROCEDURE IF EXISTS sp3;
+delimiter //;
+CREATE PROCEDURE sp1()
+BEGIN
+ DECLARE x NUMERIC ZEROFILL;
+ SELECT f1 INTO x FROM t1 LIMIT 1;
+END//
+CREATE PROCEDURE sp2()
+BEGIN
+ DECLARE x NUMERIC ZEROFILL;
+ SELECT f1 INTO x FROM t2 LIMIT 1;
+END//
+CREATE PROCEDURE sp3()
+BEGIN
+ DECLARE x NUMERIC ZEROFILL;
+ SELECT f1 INTO x FROM t3 LIMIT 1;
+END//
+delimiter ;//
+CALL sp1();
+CALL sp2();
+CALL sp3();
+
+DROP PROCEDURE IF EXISTS sp1;
+delimiter //;
+CREATE PROCEDURE sp1()
+BEGIN
+declare x numeric unsigned zerofill;
+SELECT f1 into x from t2 limit 1;
+END//
+delimiter ;//
+CALL sp1();
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP PROCEDURE sp1;
+DROP PROCEDURE sp2;
+DROP PROCEDURE sp3;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/windows.test b/mysql-test/t/windows.test
index 79517df6517..d6bcfeb8cb3 100644
--- a/mysql-test/t/windows.test
+++ b/mysql-test/t/windows.test
@@ -18,42 +18,3 @@ create table nu (a int);
drop table nu;
# End of 4.1 tests
-
-#
-# Bug #20789: Merge Subtable Rename Causes Crash
-#
-CREATE TABLE `t1` (
- `TIM` datetime NOT NULL,
- `VAL` double default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-CREATE TABLE `t2` (
- `TIM` datetime NOT NULL,
- `VAL` double default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-CREATE TABLE `mt` (
- `TIM` datetime NOT NULL,
- `VAL` double default NULL
-) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=LAST
-UNION=(`t1`,`t2`);
-
-# insert into the merge table and thus open it.
-INSERT INTO mt VALUES ('2006-01-01',0);
-
-# Alter one of the tables that are part of the merge table
-ALTER TABLE `t2` RENAME TO `t`;
-
-# Insert into the merge table that has just been altered
---error 1015
-INSERT INTO mt VALUES ('2006-01-01',0);
---error 1015
-select * from mt;
-
-FLUSH TABLES;
---error 1017
-select * from mt;
-
-# Alter one of the tables that are part of the merge table
-ALTER TABLE `t` RENAME TO `t2`;
-INSERT INTO mt VALUES ('2006-01-01',0);
-select * from mt;
-
diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp
index 6dd11df5de6..e88df49a707 100644
--- a/mysql-test/valgrind.supp
+++ b/mysql-test/valgrind.supp
@@ -15,11 +15,12 @@
}
{
- pthread allocate_tls memory loss 2
+ pthread allocate_tls memory loss
Memcheck:Leak
fun:calloc
fun:_dl_allocate_tls
- fun:pthread_create@@GLIBC_2.1
+ fun:pthread_create*
+
}
{
@@ -183,6 +184,24 @@
}
{
+ libz longest_match 3
+ Memcheck:Cond
+ fun:longest_match
+ fun:deflate_slow
+ fun:deflate
+ fun:gzclose
+}
+
+{
+ libz longest_match 4
+ Memcheck:Cond
+ fun:longest_match
+ fun:deflate_slow
+ fun:deflate
+ fun:gzflush
+}
+
+{
libz longest_match3
Memcheck:Cond
fun:longest_match