Commit f0d2fe34 authored by Alexey Kopytov's avatar Alexey Kopytov

Manual merge of mysql-5.1-bugteam to mysql-trunk-merge.

Conflicts:

Text conflict in client/mysqltest.cc
Text conflict in configure.in
Text conflict in mysql-test/include/mtr_warnings.sql
parents 0afa2090 6f78ef71
This diff is collapsed.
...@@ -109,8 +109,8 @@ extern int _rl_is_mbchar_matched PARAMS((char *, int, int, char *, int)); ...@@ -109,8 +109,8 @@ extern int _rl_is_mbchar_matched PARAMS((char *, int, int, char *, int));
extern wchar_t _rl_char_value PARAMS((char *, int)); extern wchar_t _rl_char_value PARAMS((char *, int));
extern int _rl_walphabetic PARAMS((wchar_t)); extern int _rl_walphabetic PARAMS((wchar_t));
#define _rl_to_wupper(wc) (iswlower (wc) ? towupper (wc) : (wc)) #define _rl_to_wupper(wc) (iswlower (wc) ? (wchar_t)towupper (wc) : (wc))
#define _rl_to_wlower(wc) (iswupper (wc) ? towlower (wc) : (wc)) #define _rl_to_wlower(wc) (iswupper (wc) ? (wchar_t)towlower (wc) : (wc))
#define MB_NEXTCHAR(b,s,c,f) \ #define MB_NEXTCHAR(b,s,c,f) \
((MB_CUR_MAX > 1 && rl_byte_oriented == 0) \ ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) \
......
...@@ -614,7 +614,7 @@ rl_arrow_keys (count, c) ...@@ -614,7 +614,7 @@ rl_arrow_keys (count, c)
#ifdef HANDLE_MULTIBYTE #ifdef HANDLE_MULTIBYTE
static char pending_bytes[MB_LEN_MAX]; static char pending_bytes[MB_LEN_MAX];
static int pending_bytes_length = 0; static int pending_bytes_length = 0;
static mbstate_t ps = {0}; static mbstate_t ps;
#endif #endif
/* Insert the character C at the current location, moving point forward. /* Insert the character C at the current location, moving point forward.
......
...@@ -4,9 +4,14 @@ dnl Process this file with autoconf to produce a configure script. ...@@ -4,9 +4,14 @@ dnl Process this file with autoconf to produce a configure script.
# Minimum Autoconf version required. # Minimum Autoconf version required.
AC_PREREQ(2.59) AC_PREREQ(2.59)
# Remember to also update version.c in ndb. dnl Various people throughout the community may parse configure.in to
# When changing major version number please also check switch statement dnl get the MySQL version from the source branch. If the formatting
# in client/mysqlbinlog.cc:check_master_version(). dnl of this line is going to be changed, please announce the change to
dnl internals@lists.mysql.com in advance of pushing the change.
dnl
dnl Remember to also update version.c in ndb.
dnl When changing major version number please also check switch statement
dnl in client/mysqlbinlog.cc:check_master_version().
AC_INIT([MySQL Server], [5.5.2-m2], [], [mysql]) AC_INIT([MySQL Server], [5.5.2-m2], [], [mysql])
AC_CONFIG_SRCDIR([sql/mysqld.cc]) AC_CONFIG_SRCDIR([sql/mysqld.cc])
AC_CANONICAL_SYSTEM AC_CANONICAL_SYSTEM
......
...@@ -64,7 +64,7 @@ enum YasslError { ...@@ -64,7 +64,7 @@ enum YasslError {
enum Library { yaSSL_Lib = 0, CryptoLib, SocketLib }; enum Library { yaSSL_Lib = 0, CryptoLib, SocketLib };
enum { MAX_ERROR_SZ = 80 }; enum { MAX_ERROR_SZ = 80 };
void SetErrorString(YasslError, char*); void SetErrorString(unsigned long, char*);
/* remove for now, if go back to exceptions use this wrapper /* remove for now, if go back to exceptions use this wrapper
// Base class for all yaSSL exceptions // Base class for all yaSSL exceptions
......
...@@ -991,7 +991,7 @@ char* ERR_error_string(unsigned long errNumber, char* buffer) ...@@ -991,7 +991,7 @@ char* ERR_error_string(unsigned long errNumber, char* buffer)
static char* msg = (char*)"Please supply a buffer for error string"; static char* msg = (char*)"Please supply a buffer for error string";
if (buffer) { if (buffer) {
SetErrorString(YasslError(errNumber), buffer); SetErrorString(errNumber, buffer);
return buffer; return buffer;
} }
......
...@@ -55,7 +55,7 @@ Library Error::get_lib() const ...@@ -55,7 +55,7 @@ Library Error::get_lib() const
*/ */
void SetErrorString(YasslError error, char* buffer) void SetErrorString(unsigned long error, char* buffer)
{ {
using namespace TaoCrypt; using namespace TaoCrypt;
const int max = MAX_ERROR_SZ; // shorthand const int max = MAX_ERROR_SZ; // shorthand
......
...@@ -185,6 +185,20 @@ INSERT INTO global_suppressions VALUES ...@@ -185,6 +185,20 @@ INSERT INTO global_suppressions VALUES
("Master server does not support or not configured semi-sync replication, fallback to asynchronous"), ("Master server does not support or not configured semi-sync replication, fallback to asynchronous"),
(": The MySQL server is running with the --secure-backup-file-priv option so it cannot execute this statement"), (": The MySQL server is running with the --secure-backup-file-priv option so it cannot execute this statement"),
("Slave: Unknown table 't1' Error_code: 1051"), ("Slave: Unknown table 't1' Error_code: 1051"),
/* Messages from valgrind */
("==[0-9]*== Memcheck,"),
("==[0-9]*== Copyright"),
("==[0-9]*== Using"),
("==[0-9]*== For more details"),
/* This comes with innodb plugin tests */
("==[0-9]*== Warning: set address range perms: large range"),
/* valgrind warnings: invalid file descriptor -1 in syscall
write()/read(). Bug #50414 */
("==[0-9]*== Warning: invalid file descriptor -1 in syscall write()"),
("==[0-9]*== Warning: invalid file descriptor -1 in syscall read()"),
/* /*
Transient network failures that cause warnings on reconnect. Transient network failures that cause warnings on reconnect.
BUG#47743 and BUG#47983. BUG#47743 and BUG#47983.
......
...@@ -81,10 +81,13 @@ sub is_child { ...@@ -81,10 +81,13 @@ sub is_child {
} }
# Find the safe process binary or script
my @safe_process_cmd; my @safe_process_cmd;
my $safe_kill; my $safe_kill;
if (IS_WIN32PERL or IS_CYGWIN){
# Find the safe process binary or script
sub find_bin {
if (IS_WIN32PERL or IS_CYGWIN)
{
# Use my_safe_process.exe # Use my_safe_process.exe
my $exe= my_find_bin(".", ["lib/My/SafeProcess", "My/SafeProcess"], my $exe= my_find_bin(".", ["lib/My/SafeProcess", "My/SafeProcess"],
"my_safe_process"); "my_safe_process");
...@@ -92,13 +95,14 @@ if (IS_WIN32PERL or IS_CYGWIN){ ...@@ -92,13 +95,14 @@ if (IS_WIN32PERL or IS_CYGWIN){
# Use my_safe_kill.exe # Use my_safe_kill.exe
$safe_kill= my_find_bin(".", "lib/My/SafeProcess", "my_safe_kill"); $safe_kill= my_find_bin(".", "lib/My/SafeProcess", "my_safe_kill");
} }
else else
{ {
# Use my_safe_process # Use my_safe_process
my $exe= my_find_bin(".", ["lib/My/SafeProcess", "My/SafeProcess"], my $exe= my_find_bin(".", ["lib/My/SafeProcess", "My/SafeProcess"],
"my_safe_process"); "my_safe_process");
push(@safe_process_cmd, $exe); push(@safe_process_cmd, $exe);
}
} }
...@@ -183,63 +187,6 @@ sub run { ...@@ -183,63 +187,6 @@ sub run {
return $proc->exit_status(); return $proc->exit_status();
} }
#
# Start a process that returns after "duration" seconds
# or when it's parent process does not exist anymore
#
sub timer {
my $class= shift;
my $duration= shift or croak "duration required";
my $parent_pid= $$;
my $pid= My::SafeProcess::Base::_safe_fork();
if ($pid){
# Parent
my $proc= bless
({
SAFE_PID => $pid,
SAFE_NAME => "timer",
PARENT => $$,
}, $class);
# Put the new process in list of running
$running{$pid}= $proc;
return $proc;
}
# Child, install signal handlers and sleep for "duration"
$SIG{INT}= 'IGNORE';
$SIG{TERM}= sub {
#print STDERR "timer $$: woken up, exiting!\n";
exit(0);
};
$0= "safe_timer($duration)";
if (IS_WIN32PERL){
# Just a thread in same process
sleep($duration);
print STDERR "timer $$: expired after $duration seconds\n";
exit(0);
}
my $count_down= $duration;
while($count_down--){
# Check that parent is still alive
if (kill(0, $parent_pid) == 0){
#print STDERR "timer $$: parent gone, exiting!\n";
exit(0);
}
sleep(1);
}
print STDERR "timer $$: expired after $duration seconds\n";
exit(0);
}
# #
# Shutdown process nicely, and wait for shutdown_timeout seconds # Shutdown process nicely, and wait for shutdown_timeout seconds
# If processes hasn't shutdown, kill them hard and wait for return # If processes hasn't shutdown, kill them hard and wait for return
...@@ -338,12 +285,12 @@ sub start_kill { ...@@ -338,12 +285,12 @@ sub start_kill {
$ret= system($safe_kill, $winpid) >> 8; $ret= system($safe_kill, $winpid) >> 8;
if ($ret == 3){ if ($ret == 3){
print "Couldn't open the winpid: $winpid ", print "Couldn't open the winpid: $winpid ".
"for pid: $pid, try one more time\n"; "for pid: $pid, try one more time\n";
sleep(1); sleep(1);
$winpid= _winpid($pid); $winpid= _winpid($pid);
$ret= system($safe_kill, $winpid) >> 8; $ret= system($safe_kill, $winpid) >> 8;
print "Couldn't open the winpid: $winpid ", print "Couldn't open the winpid: $winpid ".
"for pid: $pid, continue and see what happens...\n"; "for pid: $pid, continue and see what happens...\n";
} }
} }
...@@ -537,6 +484,40 @@ sub wait_any { ...@@ -537,6 +484,40 @@ sub wait_any {
} }
#
# Wait for any process to exit, or a timeout
#
# Returns a reference to the SafeProcess that
# exited or a pseudo-process with $proc->{timeout} == 1
#
sub wait_any_timeout {
my $class= shift;
my $timeout= shift;
my $proc;
my $millis=10;
do {
::mtr_milli_sleep($millis);
# Slowly increse interval up to max. 1 second
$millis++ if $millis < 1000;
# Return a "fake" process for timeout
if (::has_expired($timeout)) {
$proc= bless
({
SAFE_PID => 0,
SAFE_NAME => "timer",
timeout => 1,
}, $class);
} else {
$proc= check_any();
}
} while (! $proc);
return $proc;
}
# #
# Wait for all processes to exit # Wait for all processes to exit
# #
...@@ -594,7 +575,7 @@ sub self2str { ...@@ -594,7 +575,7 @@ sub self2str {
sub _verbose { sub _verbose {
return unless $_verbose; return unless $_verbose;
print STDERR " ## ", @_, "\n"; print STDERR " ## ". @_. "\n";
} }
......
...@@ -186,13 +186,19 @@ int main(int argc, const char** argv ) ...@@ -186,13 +186,19 @@ int main(int argc, const char** argv )
die("No real args -> nothing to do"); die("No real args -> nothing to do");
/* Copy the remaining args to child_arg */ /* Copy the remaining args to child_arg */
for (int j= i+1; j < argc; j++) { for (int j= i+1; j < argc; j++) {
if (strchr (argv[j], ' ')) { arg= argv[j];
/* Protect with "" if this arg contains a space */ if (strchr (arg, ' ') &&
arg[0] != '\"' &&
arg[strlen(arg)] != '\"')
{
/* Quote arg that contains spaces and are not quoted already */
to+= _snprintf(to, child_args + sizeof(child_args) - to, to+= _snprintf(to, child_args + sizeof(child_args) - to,
"\"%s\" ", argv[j]); "\"%s\" ", arg);
} else { }
else
{
to+= _snprintf(to, child_args + sizeof(child_args) - to, to+= _snprintf(to, child_args + sizeof(child_args) - to,
"%s ", argv[j]); "%s ", arg);
} }
} }
break; break;
......
...@@ -40,7 +40,6 @@ our $default_storage_engine; ...@@ -40,7 +40,6 @@ our $default_storage_engine;
our $opt_with_ndbcluster_only; our $opt_with_ndbcluster_only;
our $defaults_file; our $defaults_file;
our $defaults_extra_file; our $defaults_extra_file;
our $reorder= 1;
our $quick_collect; our $quick_collect;
sub collect_option { sub collect_option {
...@@ -99,7 +98,8 @@ sub init_pattern { ...@@ -99,7 +98,8 @@ sub init_pattern {
# #
############################################################################## ##############################################################################
sub collect_test_cases ($$) { sub collect_test_cases ($$$) {
my $opt_reorder= shift; # True if we're reordering tests
my $suites= shift; # Semicolon separated list of test suites my $suites= shift; # Semicolon separated list of test suites
my $opt_cases= shift; my $opt_cases= shift;
my $cases= []; # Array of hash(one hash for each testcase) my $cases= []; # Array of hash(one hash for each testcase)
...@@ -118,11 +118,17 @@ sub collect_test_cases ($$) { ...@@ -118,11 +118,17 @@ sub collect_test_cases ($$) {
!(IS_WINDOWS && $::opt_embedded_server) && !(IS_WINDOWS && $::opt_embedded_server) &&
$lib_innodb_plugin); $lib_innodb_plugin);
# If not reordering, we also shouldn't group by suites, unless
# no test cases were named.
# This also effects some logic in the loop following this.
if ($opt_reorder or !@$opt_cases)
{
foreach my $suite (split(",", $suites)) foreach my $suite (split(",", $suites))
{ {
push(@$cases, collect_one_suite($suite, $opt_cases)); push(@$cases, collect_one_suite($suite, $opt_cases));
last if $some_test_found; last if $some_test_found;
} }
}
if ( @$opt_cases ) if ( @$opt_cases )
{ {
...@@ -135,6 +141,7 @@ sub collect_test_cases ($$) { ...@@ -135,6 +141,7 @@ sub collect_test_cases ($$) {
my ($sname, $tname, $extension)= split_testname($test_name_spec); my ($sname, $tname, $extension)= split_testname($test_name_spec);
foreach my $test ( @$cases ) foreach my $test ( @$cases )
{ {
last unless $opt_reorder;
# test->{name} is always in suite.name format # test->{name} is always in suite.name format
if ( $test->{name} =~ /.*\.$tname/ ) if ( $test->{name} =~ /.*\.$tname/ )
{ {
...@@ -144,12 +151,13 @@ sub collect_test_cases ($$) { ...@@ -144,12 +151,13 @@ sub collect_test_cases ($$) {
} }
if ( not $found ) if ( not $found )
{ {
$sname= "main" if !$opt_reorder and !$sname;
mtr_error("Could not find '$tname' in '$suites' suite(s)") unless $sname; mtr_error("Could not find '$tname' in '$suites' suite(s)") unless $sname;
# If suite was part of name, find it there # If suite was part of name, find it there, may come with combinations
my ($this_case) = collect_one_suite($sname, [ $tname ]); my @this_case = collect_one_suite($sname, [ $tname ]);
if ($this_case) if (@this_case)
{ {
push (@$cases, $this_case); push (@$cases, @this_case);
} }
else else
{ {
...@@ -159,7 +167,7 @@ sub collect_test_cases ($$) { ...@@ -159,7 +167,7 @@ sub collect_test_cases ($$) {
} }
} }
if ( $reorder && !$quick_collect) if ( $opt_reorder && !$quick_collect)
{ {
# Reorder the test cases in an order that will make them faster to run # Reorder the test cases in an order that will make them faster to run
my %sort_criteria; my %sort_criteria;
......
...@@ -20,43 +20,20 @@ ...@@ -20,43 +20,20 @@
use strict; use strict;
# These are not to be prefixed with "mtr_" sub gprof_collect ($@) {
my ($exe_mysqld, @gprof_dirs)= @_;
sub gprof_prepare (); print ("Collecting gprof reports.....\n");
sub gprof_collect ();
############################################################################## foreach my $datadir (@gprof_dirs)
#
#
#
##############################################################################
sub gprof_prepare () {
rmtree($::opt_gprof_dir);
mkdir($::opt_gprof_dir);
}
# FIXME what about master1 and slave1?!
sub gprof_collect () {
if ( -f "$::master->[0]->{'path_myddir'}/gmon.out" )
{ {
# FIXME check result code?! my $gprof_msg= "$datadir/gprof.msg";
mtr_run("gprof", my $gprof_err= "$datadir/gprof.err";
[$::exe_master_mysqld, if ( -f "$datadir/gmon.out" )
"$::master->[0]->{'path_myddir'}/gmon.out"],
$::opt_gprof_master, "", "", "");
print "Master execution profile has been saved in $::opt_gprof_master\n";
}
if ( -f "$::slave->[0]->{'path_myddir'}/gmon.out" )
{ {
# FIXME check result code?! system("gprof $exe_mysqld $datadir/gmon.out 2>$gprof_err >$gprof_msg");
mtr_run("gprof", print ("GPROF output in $gprof_msg, errors in $gprof_err\n");
[$::exe_slave_mysqld, }
"$::slave->[0]->{'path_myddir'}/gmon.out"],
$::opt_gprof_slave, "", "", "");
print "Slave execution profile has been saved in $::opt_gprof_slave\n";
} }
} }
......
...@@ -30,7 +30,9 @@ sub mtr_script_exists(@); ...@@ -30,7 +30,9 @@ sub mtr_script_exists(@);
sub mtr_file_exists(@); sub mtr_file_exists(@);
sub mtr_exe_exists(@); sub mtr_exe_exists(@);
sub mtr_exe_maybe_exists(@); sub mtr_exe_maybe_exists(@);
sub mtr_milli_sleep($);
sub start_timer($);
sub has_expired($);
############################################################################## ##############################################################################
# #
...@@ -167,11 +169,18 @@ sub mtr_exe_exists (@) { ...@@ -167,11 +169,18 @@ sub mtr_exe_exists (@) {
} }
sub mtr_milli_sleep { sub mtr_milli_sleep ($) {
die "usage: mtr_milli_sleep(milliseconds)" unless @_ == 1; die "usage: mtr_milli_sleep(milliseconds)" unless @_ == 1;
my ($millis)= @_; my ($millis)= @_;
select(undef, undef, undef, ($millis/1000)); select(undef, undef, undef, ($millis/1000));
} }
# Simple functions to start and check timers (have to be actively polled)
# Timer can be "killed" by setting it to 0
sub start_timer ($) { return time + $_[0]; }
sub has_expired ($) { return $_[0] && time gt $_[0]; }
1; 1;
...@@ -69,7 +69,7 @@ sub _mtr_report_test_name ($) { ...@@ -69,7 +69,7 @@ sub _mtr_report_test_name ($) {
$tname.= " '$tinfo->{combination}'" $tname.= " '$tinfo->{combination}'"
if defined $tinfo->{combination}; if defined $tinfo->{combination};
print _name(), _timestamp(); print _name(). _timestamp();
printf "%-40s ", $tname; printf "%-40s ", $tname;
my $worker = $tinfo->{worker}; my $worker = $tinfo->{worker};
printf "w$worker " if $worker; printf "w$worker " if $worker;
...@@ -222,8 +222,8 @@ sub mtr_report_test ($) { ...@@ -222,8 +222,8 @@ sub mtr_report_test ($) {
} }
sub mtr_report_stats ($;$) { sub mtr_report_stats ($$;$) {
my ($tests, $dont_error)= @_; my ($prefix, $tests, $dont_error)= @_;
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Find out how we where doing # Find out how we where doing
...@@ -328,6 +328,9 @@ sub mtr_report_stats ($;$) { ...@@ -328,6 +328,9 @@ sub mtr_report_stats ($;$) {
} }
} }
# Print summary line prefix
print "$prefix: ";
# Print a list of testcases that failed # Print a list of testcases that failed
if ( $tot_failed != 0 ) if ( $tot_failed != 0 )
{ {
...@@ -387,13 +390,13 @@ sub mtr_report_stats ($;$) { ...@@ -387,13 +390,13 @@ sub mtr_report_stats ($;$) {
############################################################################## ##############################################################################
sub mtr_print_line () { sub mtr_print_line () {
print '-' x 60, "\n"; print '-' x 60 . "\n";
} }
sub mtr_print_thick_line { sub mtr_print_thick_line {
my $char= shift || '='; my $char= shift || '=';
print $char x 78, "\n"; print $char x 78 . "\n";
} }
...@@ -451,7 +454,7 @@ sub _timestamp { ...@@ -451,7 +454,7 @@ sub _timestamp {
# Always print message to screen # Always print message to screen
sub mtr_print (@) { sub mtr_print (@) {
print _name(), join(" ", @_), "\n"; print _name(). join(" ", @_). "\n";
} }
...@@ -459,22 +462,22 @@ sub mtr_print (@) { ...@@ -459,22 +462,22 @@ sub mtr_print (@) {
sub mtr_report (@) { sub mtr_report (@) {
if (defined $verbose) if (defined $verbose)
{ {
print _name(), join(" ", @_), "\n"; print _name(). join(" ", @_). "\n";
} }
} }
# Print warning to screen # Print warning to screen
sub mtr_warning (@) { sub mtr_warning (@) {
print STDERR _name(), _timestamp(), print STDERR _name(). _timestamp().
"mysql-test-run: WARNING: ", join(" ", @_), "\n"; "mysql-test-run: WARNING: ". join(" ", @_). "\n";
} }
# Print error to screen and then exit # Print error to screen and then exit
sub mtr_error (@) { sub mtr_error (@) {
print STDERR _name(), _timestamp(), print STDERR _name(). _timestamp().
"mysql-test-run: *** ERROR: ", join(" ", @_), "\n"; "mysql-test-run: *** ERROR: ". join(" ", @_). "\n";
if (IS_WINDOWS) if (IS_WINDOWS)
{ {
POSIX::_exit(1); POSIX::_exit(1);
...@@ -489,8 +492,8 @@ sub mtr_error (@) { ...@@ -489,8 +492,8 @@ sub mtr_error (@) {
sub mtr_debug (@) { sub mtr_debug (@) {
if ( $verbose > 2 ) if ( $verbose > 2 )
{ {
print STDERR _name(), print STDERR _name().
_timestamp(), "####: ", join(" ", @_), "\n"; _timestamp(). "####: ". join(" ", @_). "\n";
} }
} }
...@@ -498,8 +501,8 @@ sub mtr_debug (@) { ...@@ -498,8 +501,8 @@ sub mtr_debug (@) {
sub mtr_verbose (@) { sub mtr_verbose (@) {
if ( $verbose ) if ( $verbose )
{ {
print STDERR _name(), _timestamp(), print STDERR _name(). _timestamp().
"> ",join(" ", @_),"\n"; "> ".join(" ", @_)."\n";
} }
} }
...@@ -509,8 +512,8 @@ sub mtr_verbose_restart (@) { ...@@ -509,8 +512,8 @@ sub mtr_verbose_restart (@) {
my $proc= $server->{proc}; my $proc= $server->{proc};
if ( $verbose_restart ) if ( $verbose_restart )
{ {
print STDERR _name(),_timestamp(), print STDERR _name()._timestamp().
"> Restart $proc - ",join(" ", @args),"\n"; "> Restart $proc - ".join(" ", @args)."\n";
} }
} }
......
...@@ -150,7 +150,7 @@ sub run_stress_test () ...@@ -150,7 +150,7 @@ sub run_stress_test ()
mtr_add_arg($args, "--verbose"); mtr_add_arg($args, "--verbose");
mtr_add_arg($args, "--cleanup"); mtr_add_arg($args, "--cleanup");
mtr_add_arg($args, "--log-error-details"); mtr_add_arg($args, "--log-error-details");
mtr_add_arg($args, "--abort-on-error"); mtr_add_arg($args, "--abort-on-error=1");
if ( $::opt_stress_init_file ) if ( $::opt_stress_init_file )
{ {
......
...@@ -150,7 +150,7 @@ sub run_stress_test () ...@@ -150,7 +150,7 @@ sub run_stress_test ()
mtr_add_arg($args, "--verbose"); mtr_add_arg($args, "--verbose");
mtr_add_arg($args, "--cleanup"); mtr_add_arg($args, "--cleanup");
mtr_add_arg($args, "--log-error-details"); mtr_add_arg($args, "--log-error-details");
mtr_add_arg($args, "--abort-on-error"); mtr_add_arg($args, "--abort-on-error=1");
if ( $::opt_stress_init_file ) if ( $::opt_stress_init_file )
{ {
......
...@@ -905,6 +905,11 @@ sub command_line_setup () { ...@@ -905,6 +905,11 @@ sub command_line_setup () {
mtr_report("Using default engine '$used_default_engine'") mtr_report("Using default engine '$used_default_engine'")
if defined $used_default_engine; if defined $used_default_engine;
if ($glob_win32 and defined $opt_mem) {
mtr_report("--mem not supported on Windows, ignored");
$opt_mem= undef;
}
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Check if we should speed up tests by trying to run on tmpfs # Check if we should speed up tests by trying to run on tmpfs
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
......
This diff is collapsed.
...@@ -986,6 +986,23 @@ GROUP BY t1.a ...@@ -986,6 +986,23 @@ GROUP BY t1.a
1 1
1 1
DROP TABLE t1, t2; DROP TABLE t1, t2;
CREATE TABLE t1 (f1 INT);
INSERT INTO t1 VALUES (),();
EXPLAIN EXTENDED SELECT 1 FROM
(SELECT DISTINCT GROUP_CONCAT(td.f1) FROM t1,t1 AS td GROUP BY td.f1) AS d,t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <derived2> system NULL NULL NULL NULL 1 100.00
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort; Distinct
2 DERIVED td ALL NULL NULL NULL NULL 2 100.00 Distinct; Using join buffer
Warnings:
Note 1003 select 1 AS `1` from (select distinct group_concat(`test`.`td`.`f1` separator ',') AS `GROUP_CONCAT(td.f1)` from `test`.`t1` join `test`.`t1` `td` group by `test`.`td`.`f1`) `d` join `test`.`t1`
SELECT 1 FROM
(SELECT DISTINCT GROUP_CONCAT(td.f1) FROM t1,t1 AS td GROUP BY td.f1) AS d,t1;
1
1
1
DROP TABLE t1;
End of 5.0 tests End of 5.0 tests
DROP TABLE IF EXISTS t1, t2; DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (a VARCHAR(6), b INT); CREATE TABLE t1 (a VARCHAR(6), b INT);
......
...@@ -147,9 +147,10 @@ hello ...@@ -147,9 +147,10 @@ hello
hello hello
;;;;;;;; ;;;;;;;;
# MySQL: -- The # MySQL: -- The
mysqltest: At line 1: End of line junk detected: "6" mysqltest: At line 1: Extra argument '6' passed to 'sleep'
mysqltest: At line 1: End of line junk detected: "6" mysqltest: At line 1: Extra argument '6' passed to 'sleep'
mysqltest: At line 1: Missing delimiter mysqltest: At line 1: Extra argument 'A comment
show status' passed to 'sleep'
mysqltest: At line 1: End of line junk detected: "sleep 7 mysqltest: At line 1: End of line junk detected: "sleep 7
# Another comment # Another comment
" "
...@@ -216,6 +217,12 @@ source database ...@@ -216,6 +217,12 @@ source database
echo message echo message echo message echo message
mysqltest: At line 1: Missing argument in exec mysqltest: At line 1: Missing argument in exec
1
1
2
2
X
3
MySQL MySQL
"MySQL" "MySQL"
MySQL: The MySQL: The
...@@ -348,8 +355,10 @@ here is the sourced script ...@@ -348,8 +355,10 @@ here is the sourced script
here is the sourced script here is the sourced script
"hello" "hello"
"hello" "hello"
mysqltest: At line 1: Missing argument to sleep mysqltest: At line 2: Invalid argument to sleep "xyz"
mysqltest: At line 1: Missing argument to real_sleep mysqltest: At line 2: Invalid argument to real_sleep "xyz"
mysqltest: At line 1: Missing required argument 'sleep_delay' to command 'sleep'
mysqltest: At line 1: Missing required argument 'sleep_delay' to command 'real_sleep'
mysqltest: At line 1: Invalid argument to sleep "abc" mysqltest: At line 1: Invalid argument to sleep "abc"
mysqltest: At line 1: Invalid argument to real_sleep "abc" mysqltest: At line 1: Invalid argument to real_sleep "abc"
1 1
...@@ -377,6 +386,10 @@ test ...@@ -377,6 +386,10 @@ test
test2 test2
test3 test3
test4 test4
outer
true-inner
true-inner again
true-outer
Counter is greater than 0, (counter=10) Counter is greater than 0, (counter=10)
Counter is not 0, (counter=0) Counter is not 0, (counter=0)
1 1
...@@ -417,6 +430,9 @@ mysqltest: At line 1: Wrong number of arguments to replace_column in 'replace_co ...@@ -417,6 +430,9 @@ mysqltest: At line 1: Wrong number of arguments to replace_column in 'replace_co
mysqltest: At line 1: Wrong column number to replace_column in 'replace_column a b' mysqltest: At line 1: Wrong column number to replace_column in 'replace_column a b'
mysqltest: At line 1: Wrong column number to replace_column in 'replace_column a 1' mysqltest: At line 1: Wrong column number to replace_column in 'replace_column a 1'
mysqltest: At line 1: Wrong column number to replace_column in 'replace_column 1 b c ' mysqltest: At line 1: Wrong column number to replace_column in 'replace_column 1 b c '
select "LONG_STRING" as x;
x
LONG_STRING
mysqltest: At line 1: Invalid integer argument "10!" mysqltest: At line 1: Invalid integer argument "10!"
mysqltest: At line 1: Invalid integer argument "a" mysqltest: At line 1: Invalid integer argument "a"
mysqltest: At line 1: Missing required argument 'connection name' to command 'connect' mysqltest: At line 1: Missing required argument 'connection name' to command 'connect'
...@@ -523,7 +539,28 @@ a D ...@@ -523,7 +539,28 @@ a D
1 1 1 1
1 4 1 4
drop table t1; drop table t1;
create table t1 ( f1 char(10));
insert into t1 values ("Abcd");
select * from t1;
f1
Abcd
select * from t2;;
ERROR 42S02: Table 'test.t2' doesn't exist
select * from t1;
f1
Abcd
select * from t1;;
Result coming up
f1
Abcd
select * from t1;;
f1
Abcd
mysqltest: At line 2: Cannot run query on connection between send and reap
select * from t1;;
drop table t1;
mysqltest: At line 1: Missing required argument 'filename' to command 'remove_file' mysqltest: At line 1: Missing required argument 'filename' to command 'remove_file'
mysqltest: At line 1: Missing required argument 'directory' to command 'remove_files_wildcard'
mysqltest: At line 1: Missing required argument 'filename' to command 'write_file' mysqltest: At line 1: Missing required argument 'filename' to command 'write_file'
mysqltest: At line 1: End of file encountered before 'EOF' delimiter was found mysqltest: At line 1: End of file encountered before 'EOF' delimiter was found
Content for test_file1 Content for test_file1
...@@ -553,6 +590,8 @@ hello ...@@ -553,6 +590,8 @@ hello
mysqltest: At line 1: Max delimiter length(16) exceeded mysqltest: At line 1: Max delimiter length(16) exceeded
hello hello
hello hello
val is 5
val is 5
mysqltest: At line 1: test of die mysqltest: At line 1: test of die
Some output Some output
create table t1( a int, b char(255), c timestamp); create table t1( a int, b char(255), c timestamp);
...@@ -680,6 +719,29 @@ INSERT INTO t1 SELECT f1 - 256 FROM t1; ...@@ -680,6 +719,29 @@ INSERT INTO t1 SELECT f1 - 256 FROM t1;
INSERT INTO t1 SELECT f1 - 512 FROM t1; INSERT INTO t1 SELECT f1 - 512 FROM t1;
SELECT * FROM t1; SELECT * FROM t1;
DROP TABLE t1; DROP TABLE t1;
select "500g blåbærsyltetøy" as "will be lower cased";
will be lower cased
500g blåbærsyltetøy
SELECT "UPPER" AS "WILL NOT BE lower cased";
WILL NOT BE lower cased
UPPER
UP
SELECT 0 as "UP AGAIN";
UP AGAIN
0
select "abcdef" as "uvwxyz";
uvwxyz
abcdef
select "xyz" as name union select "abc" as name order by name desc;
name
abc
xyz
select 1 as "some new text";
some new text
1
select 0 as "will not lower case ÄËÐ";
will not lower case ÄËÐ
0
CREATE TABLE t1( CREATE TABLE t1(
a int, b varchar(255), c datetime a int, b varchar(255), c datetime
); );
...@@ -726,6 +788,8 @@ mysqltest: At line 1: change user failed: Access denied for user 'root'@'localho ...@@ -726,6 +788,8 @@ mysqltest: At line 1: change user failed: Access denied for user 'root'@'localho
file1.txt file1.txt
file1.txt file1.txt
file2.txt file2.txt
file11.txt
dir-list.txt
SELECT 'c:\\a.txt' AS col; SELECT 'c:\\a.txt' AS col;
col col
z z
......
...@@ -18,4 +18,4 @@ VARIABLE_VALUE ...@@ -18,4 +18,4 @@ VARIABLE_VALUE
OFF OFF
SET @@global.log= @start_log; SET @@global.log= @start_log;
Warnings: Warnings:
Warning 1287 The syntax '@@log' is deprecated and will be removed in MySQL 7.0. Please use '@@general_log' instead Warning 1287 '@@log' is deprecated and will be removed in a future release. Please use '@@general_log' instead
...@@ -5,17 +5,17 @@ SELECT @start_global_value; ...@@ -5,17 +5,17 @@ SELECT @start_global_value;
'#--------------------FN_DYNVARS_064_01-------------------------#' '#--------------------FN_DYNVARS_064_01-------------------------#'
SET @@global.log_bin_trust_routine_creators = TRUE; SET @@global.log_bin_trust_routine_creators = TRUE;
Warnings: Warnings:
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
SET @@global.log_bin_trust_routine_creators = DEFAULT; SET @@global.log_bin_trust_routine_creators = DEFAULT;
Warnings: Warnings:
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
SELECT @@global.log_bin_trust_routine_creators; SELECT @@global.log_bin_trust_routine_creators;
@@global.log_bin_trust_routine_creators @@global.log_bin_trust_routine_creators
0 0
'#--------------------FN_DYNVARS_064_02-------------------------#' '#--------------------FN_DYNVARS_064_02-------------------------#'
SET @@global.log_bin_trust_routine_creators = DEFAULT; SET @@global.log_bin_trust_routine_creators = DEFAULT;
Warnings: Warnings:
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
SELECT @@global.log_bin_trust_routine_creators = 'FALSE'; SELECT @@global.log_bin_trust_routine_creators = 'FALSE';
@@global.log_bin_trust_routine_creators = 'FALSE' @@global.log_bin_trust_routine_creators = 'FALSE'
1 1
...@@ -24,37 +24,37 @@ Warning 1292 Truncated incorrect DOUBLE value: 'FALSE' ...@@ -24,37 +24,37 @@ Warning 1292 Truncated incorrect DOUBLE value: 'FALSE'
'#--------------------FN_DYNVARS_064_03-------------------------#' '#--------------------FN_DYNVARS_064_03-------------------------#'
SET @@global.log_bin_trust_routine_creators = ON; SET @@global.log_bin_trust_routine_creators = ON;
Warnings: Warnings:
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
SELECT @@global.log_bin_trust_routine_creators; SELECT @@global.log_bin_trust_routine_creators;
@@global.log_bin_trust_routine_creators @@global.log_bin_trust_routine_creators
1 1
SET @@global.log_bin_trust_routine_creators = OFF; SET @@global.log_bin_trust_routine_creators = OFF;
Warnings: Warnings:
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
SELECT @@global.log_bin_trust_routine_creators; SELECT @@global.log_bin_trust_routine_creators;
@@global.log_bin_trust_routine_creators @@global.log_bin_trust_routine_creators
0 0
SET @@global.log_bin_trust_routine_creators = 0; SET @@global.log_bin_trust_routine_creators = 0;
Warnings: Warnings:
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
SELECT @@global.log_bin_trust_routine_creators; SELECT @@global.log_bin_trust_routine_creators;
@@global.log_bin_trust_routine_creators @@global.log_bin_trust_routine_creators
0 0
SET @@global.log_bin_trust_routine_creators = 1; SET @@global.log_bin_trust_routine_creators = 1;
Warnings: Warnings:
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
SELECT @@global.log_bin_trust_routine_creators; SELECT @@global.log_bin_trust_routine_creators;
@@global.log_bin_trust_routine_creators @@global.log_bin_trust_routine_creators
1 1
SET @@global.log_bin_trust_routine_creators = TRUE; SET @@global.log_bin_trust_routine_creators = TRUE;
Warnings: Warnings:
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
SELECT @@global.log_bin_trust_routine_creators; SELECT @@global.log_bin_trust_routine_creators;
@@global.log_bin_trust_routine_creators @@global.log_bin_trust_routine_creators
1 1
SET @@global.log_bin_trust_routine_creators = FALSE; SET @@global.log_bin_trust_routine_creators = FALSE;
Warnings: Warnings:
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
SELECT @@global.log_bin_trust_routine_creators; SELECT @@global.log_bin_trust_routine_creators;
@@global.log_bin_trust_routine_creators @@global.log_bin_trust_routine_creators
0 0
...@@ -70,7 +70,7 @@ SET @@global.log_bin_trust_routine_creators = "OFFF"; ...@@ -70,7 +70,7 @@ SET @@global.log_bin_trust_routine_creators = "OFFF";
ERROR 42000: Variable 'log_bin_trust_routine_creators' can't be set to the value of 'OFFF' ERROR 42000: Variable 'log_bin_trust_routine_creators' can't be set to the value of 'OFFF'
SET @@global.log_bin_trust_routine_creators = OF; SET @@global.log_bin_trust_routine_creators = OF;
Warnings: Warnings:
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
SELECT @@global.log_bin_trust_routine_creators; SELECT @@global.log_bin_trust_routine_creators;
@@global.log_bin_trust_routine_creators @@global.log_bin_trust_routine_creators
0 0
...@@ -96,14 +96,14 @@ ERROR HY000: Variable 'log_bin_trust_routine_creators' is a GLOBAL variable ...@@ -96,14 +96,14 @@ ERROR HY000: Variable 'log_bin_trust_routine_creators' is a GLOBAL variable
'#---------------------FN_DYNVARS_064_07----------------------#' '#---------------------FN_DYNVARS_064_07----------------------#'
SET @@global.log_bin_trust_routine_creators = TRUE; SET @@global.log_bin_trust_routine_creators = TRUE;
Warnings: Warnings:
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
SELECT @@log_bin_trust_routine_creators = @@global.log_bin_trust_routine_creators; SELECT @@log_bin_trust_routine_creators = @@global.log_bin_trust_routine_creators;
@@log_bin_trust_routine_creators = @@global.log_bin_trust_routine_creators @@log_bin_trust_routine_creators = @@global.log_bin_trust_routine_creators
1 1
'#---------------------FN_DYNVARS_064_08----------------------#' '#---------------------FN_DYNVARS_064_08----------------------#'
SET @@global.log_bin_trust_routine_creators = TRUE; SET @@global.log_bin_trust_routine_creators = TRUE;
Warnings: Warnings:
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
SELECT @@log_bin_trust_routine_creators; SELECT @@log_bin_trust_routine_creators;
@@log_bin_trust_routine_creators @@log_bin_trust_routine_creators
1 1
...@@ -115,7 +115,7 @@ SELECT log_bin_trust_routine_creators = @@session.log_bin_trust_routine_creators ...@@ -115,7 +115,7 @@ SELECT log_bin_trust_routine_creators = @@session.log_bin_trust_routine_creators
ERROR 42S22: Unknown column 'log_bin_trust_routine_creators' in 'field list' ERROR 42S22: Unknown column 'log_bin_trust_routine_creators' in 'field list'
SET @@global.log_bin_trust_routine_creators = @start_global_value; SET @@global.log_bin_trust_routine_creators = @start_global_value;
Warnings: Warnings:
Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead Warning 1287 '@@log_bin_trust_routine_creators' is deprecated and will be removed in a future release. Please use '@@log_bin_trust_function_creators' instead
SELECT @@global.log_bin_trust_routine_creators; SELECT @@global.log_bin_trust_routine_creators;
@@global.log_bin_trust_routine_creators @@global.log_bin_trust_routine_creators
1 1
...@@ -78,6 +78,7 @@ COMMIT; ...@@ -78,6 +78,7 @@ COMMIT;
--echo 'CONNECTION con2' --echo 'CONNECTION con2'
CONNECTION con2; CONNECTION con2;
reap;
UNLOCK tables; UNLOCK tables;
DROP TABLE t1; DROP TABLE t1;
......
...@@ -127,6 +127,7 @@ connection con0; ...@@ -127,6 +127,7 @@ connection con0;
SET SESSION low_priority_updates = OFF; SET SESSION low_priority_updates = OFF;
--echo ** Connection con1 ** --echo ** Connection con1 **
connection con1; connection con1;
reap;
SET SESSION low_priority_updates = OFF; SET SESSION low_priority_updates = OFF;
--echo ** Connection default** --echo ** Connection default**
connection default; connection default;
......
...@@ -693,6 +693,21 @@ SELECT 1 FROM t1 WHERE t1.a NOT IN ...@@ -693,6 +693,21 @@ SELECT 1 FROM t1 WHERE t1.a NOT IN
DROP TABLE t1, t2; DROP TABLE t1, t2;
#
# Bug #49487: crash with explain extended and group_concat in a derived table
#
CREATE TABLE t1 (f1 INT);
INSERT INTO t1 VALUES (),();
EXPLAIN EXTENDED SELECT 1 FROM
(SELECT DISTINCT GROUP_CONCAT(td.f1) FROM t1,t1 AS td GROUP BY td.f1) AS d,t1;
SELECT 1 FROM
(SELECT DISTINCT GROUP_CONCAT(td.f1) FROM t1,t1 AS td GROUP BY td.f1) AS d,t1;
DROP TABLE t1;
--echo End of 5.0 tests --echo End of 5.0 tests
# #
......
...@@ -605,6 +605,15 @@ echo ; ...@@ -605,6 +605,15 @@ echo ;
--error 1 --error 1
--exec echo "--exec " | $MYSQL_TEST 2>&1 --exec echo "--exec " | $MYSQL_TEST 2>&1
# Multi-line exec
exec $MYSQL
test -e "select 1";
exec $MYSQL test -e "select
2";
let $query = select 3
as X;
exec $MYSQL test -e "$query";
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Test let command # Test let command
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
...@@ -911,6 +920,28 @@ sleep 0.5; ...@@ -911,6 +920,28 @@ sleep 0.5;
sleep 1; sleep 1;
real_sleep 1; real_sleep 1;
# Parameter from variable, legal and illegal
let $sleep_var= 0.1;
sleep $sleep_var;
let $sleep_var= 1;
--real_sleep $sleep_var
--write_file $MYSQL_TMP_DIR/sleep.inc
let $sleep_var= xyz;
--sleep $sleep_var
EOF
--error 1
--exec $MYSQL_TEST < $MYSQL_TMP_DIR/sleep.inc 2>&1
--remove_file $MYSQL_TMP_DIR/sleep.inc
--write_file $MYSQL_TMP_DIR/sleep.inc
let $sleep_var= xyz;
real_sleep $sleep_var;
EOF
--error 1
--exec $MYSQL_TEST < $MYSQL_TMP_DIR/sleep.inc 2>&1
--remove_file $MYSQL_TMP_DIR/sleep.inc
# Missing parameter # Missing parameter
--error 1 --error 1
--exec echo "sleep ;" | $MYSQL_TEST 2>&1 --exec echo "sleep ;" | $MYSQL_TEST 2>&1
...@@ -1006,6 +1037,37 @@ echo test3stop ...@@ -1006,6 +1037,37 @@ echo test3stop
--delimiter ; --delimiter ;
echo test4; echo test4;
# ----------------------------------------------------------------------------
# Test that delimiter within if() works in in various combinations
# ----------------------------------------------------------------------------
if (0)
{
delimiter ||;
echo false-inner||
if (0)
{
delimiter *||
echo false-innerer*
delimiter ||*
}
echo false-inner again||
}
echo outer;
if (1)
{
delimiter /;
echo true-inner/
if (0)
{
delimiter %/
echo true-innerer%
}
echo true-inner again/
}
echo true-outer/
delimiter ;/
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Test if # Test if
...@@ -1285,6 +1347,17 @@ select "a" as col1, "c" as col2; ...@@ -1285,6 +1347,17 @@ select "a" as col1, "c" as col2;
--error 1 --error 1
--exec echo "--replace_column 1 b c " | $MYSQL_TEST 2>&1 --exec echo "--replace_column 1 b c " | $MYSQL_TEST 2>&1
let $long_rep= 1234567890123456789012345678901234567890;
let $long_rep= $long_rep,$long_rep;
let $long_rep= $long_rep,$long_rep;
let $long_rep= $long_rep,$long_rep;
let $long_rep= $long_rep,$long_rep;
let $long_rep= $long_rep,$long_rep;
# This tests from strings > 1024 (here 1311)
--replace_result $long_rep LONG_STRING
eval select "$long_rep" as x;
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Test sync_with_master # Test sync_with_master
...@@ -1605,6 +1678,57 @@ insert into t1 values (2,4); ...@@ -1605,6 +1678,57 @@ insert into t1 values (2,4);
select * from t1; select * from t1;
drop table t1; drop table t1;
# ----------------------------------------------------------------------------
# Tests of send
# ----------------------------------------------------------------------------
create table t1 ( f1 char(10));
insert into t1 values ("Abcd");
# 1. Basic test
send select * from t1;
reap;
# 2. Test with error
--send select * from t2;
--error ER_NO_SUCH_TABLE
--reap
# 3. test send of next stmt
--send
select * from t1;
--reap
# 4. Non-query stmt betwen send and reap allowed
--send select * from t1;
--sleep 0.05
--echo Result coming up
--reap
# 5. Test of send_eval
--let $my_stmt= select * from t1;
--send_eval $my_stmt
--reap
# 6. Test that mysqltest does not allow query stmt between send and reap
# Untestable directly as it causes mysqltest to fail
--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.in
--send select * from t1;
select 1;
--reap
EOF
--error 1
--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.in 2>&1
remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.in;
drop table t1;
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# test for remove_file # test for remove_file
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
...@@ -1615,6 +1739,19 @@ drop table t1; ...@@ -1615,6 +1739,19 @@ drop table t1;
--error 1 --error 1
remove_file non_existing_file; remove_file non_existing_file;
# ----------------------------------------------------------------------------
# test for remove_files_wildcard
# ----------------------------------------------------------------------------
--error 1
--exec echo "remove_files_wildcard ;" | $MYSQL_TEST 2>&1
--error 1
remove_files_wildcard non_existing_dir;
--error 1
remove_files_wildcard non_existing_dir non_existing_file;
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# test for write_file # test for write_file
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
...@@ -1905,6 +2042,20 @@ perl; ...@@ -1905,6 +2042,20 @@ perl;
print "hello\n"; print "hello\n";
EOF EOF
# Test perl within while, also with if being false first iteration
let $outer= 3;
let $ifval= 0;
while ($outer) {
if ($ifval) {
perl UNTIL;
my $val= 5;
print "val is $val\n";
UNTIL
}
inc $ifval;
dec $outer;
}
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# test for die # test for die
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
...@@ -2045,6 +2196,44 @@ INSERT INTO t1 SELECT f1 - 512 FROM t1; ...@@ -2045,6 +2196,44 @@ INSERT INTO t1 SELECT f1 - 512 FROM t1;
SELECT * FROM t1; SELECT * FROM t1;
--enable_result_log --enable_result_log
DROP TABLE t1; DROP TABLE t1;
# ----------------------------------------------------------------------------
# test for lowercase_result
# ----------------------------------------------------------------------------
# 1. Basic test
--lowercase_result
SELECT "500g BLBRSYLTETY" AS "WILL BE lower cased";
# 2. test that it does not apply to next statement
SELECT "UPPER" AS "WILL NOT BE lower cased";
# 3. test that it does not affect non-SQL or the following statement
--lowercase_result
--echo UP
SELECT 0 as "UP AGAIN";
# 4. test that it works with eval and variables
let $lower_stmt=SELECT "ABCdef" AS "uvwXYZ";
--lowercase_result
eval $lower_stmt;
# 5. test that it works in combination with sort
sorted_result;
lowercase_result;
SELECT "Xyz" AS Name UNION SELECT "Abc" as Name ORDER BY Name DESC;
# 6. Test combination with replace, and that lower casing is done first
--lowercase_result
--replace_result old new
SELECT 1 as "SOME OLD TEXT";
# 7. Test missing lower casing of "unknown" characters
--character_set utf8
--lowercase_result
SELECT 0 as "WILL NOT lower case ";
--character_set latin1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Some coverage tests # Some coverage tests
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
...@@ -2230,9 +2419,14 @@ rmdir $MYSQLTEST_VARDIR/tmp/testdir; ...@@ -2230,9 +2419,14 @@ rmdir $MYSQLTEST_VARDIR/tmp/testdir;
cat_file $MYSQLTEST_VARDIR/tmp/testdir/file3.txt; cat_file $MYSQLTEST_VARDIR/tmp/testdir/file3.txt;
remove_file $MYSQLTEST_VARDIR/tmp/testdir/file1.txt; list_files_write_file $MYSQLTEST_VARDIR/tmp/testdir/file11.txt $MYSQLTEST_VARDIR/tmp/testdir file?.txt;
remove_file $MYSQLTEST_VARDIR/tmp/testdir/file2.txt; remove_files_wildcard $MYSQLTEST_VARDIR/tmp/testdir file?.txt;
remove_file $MYSQLTEST_VARDIR/tmp/testdir/file3.txt; list_files_write_file $MYSQLTEST_VARDIR/tmp/testdir/dir-list.txt $MYSQLTEST_VARDIR/tmp/testdir file*.txt;
cat_file $MYSQLTEST_VARDIR/tmp/testdir/dir-list.txt;
remove_files_wildcard $MYSQLTEST_VARDIR/tmp/testdir file*.txt;
list_files $MYSQLTEST_VARDIR/tmp/testdir;
remove_files_wildcard $MYSQLTEST_VARDIR/tmp/testdir;
list_files $MYSQLTEST_VARDIR/tmp/testdir;
rmdir $MYSQLTEST_VARDIR/tmp/testdir; rmdir $MYSQLTEST_VARDIR/tmp/testdir;
# #
......
...@@ -187,6 +187,7 @@ SELECT * FROM t1; ...@@ -187,6 +187,7 @@ SELECT * FROM t1;
--echo # Switch to connection con2 --echo # Switch to connection con2
connection con2; connection con2;
reap;
SELECT * FROM t1; SELECT * FROM t1;
connection default; connection default;
......
...@@ -410,8 +410,7 @@ else ...@@ -410,8 +410,7 @@ else
echo "Try 'mysqld --help' if you have problems with paths. Using --log" echo "Try 'mysqld --help' if you have problems with paths. Using --log"
echo "gives you a log in $ldata that may be helpful." echo "gives you a log in $ldata that may be helpful."
echo echo
echo "The latest information about MySQL is available on the web at" echo "Please consult the MySQL manual section"
echo "http://www.mysql.com/. Please consult the MySQL manual section"
echo "'Problems running mysql_install_db', and the manual section that" echo "'Problems running mysql_install_db', and the manual section that"
echo "describes problems on your OS. Another information source are the" echo "describes problems on your OS. Another information source are the"
echo "MySQL email archives available at http://lists.mysql.com/." echo "MySQL email archives available at http://lists.mysql.com/."
...@@ -470,9 +469,6 @@ then ...@@ -470,9 +469,6 @@ then
echo echo
echo "Please report any problems with the $scriptdir/mysqlbug script!" echo "Please report any problems with the $scriptdir/mysqlbug script!"
echo echo
echo "The latest information about MySQL is available at http://www.mysql.com/"
echo "Support MySQL by buying support/licenses from http://shop.mysql.com/"
echo
fi fi
exit 0 exit 0
...@@ -3375,6 +3375,8 @@ String* Item_func_group_concat::val_str(String* str) ...@@ -3375,6 +3375,8 @@ String* Item_func_group_concat::val_str(String* str)
void Item_func_group_concat::print(String *str, enum_query_type query_type) void Item_func_group_concat::print(String *str, enum_query_type query_type)
{ {
/* orig_args is not filled with valid values until fix_fields() */
Item **pargs= fixed ? orig_args : args;
str->append(STRING_WITH_LEN("group_concat(")); str->append(STRING_WITH_LEN("group_concat("));
if (distinct) if (distinct)
str->append(STRING_WITH_LEN("distinct ")); str->append(STRING_WITH_LEN("distinct "));
...@@ -3382,7 +3384,7 @@ void Item_func_group_concat::print(String *str, enum_query_type query_type) ...@@ -3382,7 +3384,7 @@ void Item_func_group_concat::print(String *str, enum_query_type query_type)
{ {
if (i) if (i)
str->append(','); str->append(',');
args[i]->print(str, query_type); pargs[i]->print(str, query_type);
} }
if (arg_count_order) if (arg_count_order)
{ {
......
...@@ -8762,7 +8762,7 @@ static bool record_compare(TABLE *table) ...@@ -8762,7 +8762,7 @@ static bool record_compare(TABLE *table)
DBUG_DUMP("record[1]", table->record[1], table->s->reclength); DBUG_DUMP("record[1]", table->record[1], table->s->reclength);
bool result= FALSE; bool result= FALSE;
uchar saved_x[2], saved_filler[2]; uchar saved_x[2]= {0, 0}, saved_filler[2]= {0, 0};
if (table->s->null_bytes > 0) if (table->s->null_bytes > 0)
{ {
......
...@@ -309,7 +309,7 @@ static bool record_compare(TABLE *table) ...@@ -309,7 +309,7 @@ static bool record_compare(TABLE *table)
*/ */
bool result= FALSE; bool result= FALSE;
uchar saved_x[2], saved_filler[2]; uchar saved_x[2]= {0, 0}, saved_filler[2]= {0, 0};
if (table->s->null_bytes > 0) if (table->s->null_bytes > 0)
{ {
......
...@@ -1292,7 +1292,8 @@ bool mysql_multi_update(THD *thd, ...@@ -1292,7 +1292,8 @@ bool mysql_multi_update(THD *thd,
if (using_handler) if (using_handler)
{ {
Internal_error_handler *top_handler= thd->pop_internal_handler(); Internal_error_handler *top_handler;
top_handler= thd->pop_internal_handler();
DBUG_ASSERT(&handler == top_handler); DBUG_ASSERT(&handler == top_handler);
} }
......
...@@ -4916,7 +4916,7 @@ create_table_option: ...@@ -4916,7 +4916,7 @@ create_table_option:
| TYPE_SYM opt_equal storage_engines | TYPE_SYM opt_equal storage_engines
{ {
Lex->create_info.db_type= $3; Lex->create_info.db_type= $3;
WARN_DEPRECATED(yythd, "5.4.4", "TYPE=storage_engine", WARN_DEPRECATED(yythd, "6.0", "TYPE=storage_engine",
"'ENGINE=storage_engine'"); "'ENGINE=storage_engine'");
Lex->create_info.used_fields|= HA_CREATE_USED_ENGINE; Lex->create_info.used_fields|= HA_CREATE_USED_ENGINE;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment