summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <tsmith@maint2.mysql.com>2006-09-04 23:05:17 +0200
committerunknown <tsmith@maint2.mysql.com>2006-09-04 23:05:17 +0200
commitfbf2bc183aad7dd3a25bf0877ebdf89f946674b4 (patch)
tree30c11695e7ec04766ed31830ca235369d659d638 /mysql-test
parentd57163fcf84d6fc0e8cad5fdbbe5c14274eb694c (diff)
parent3c4e333d006758162e1912a2f5898640b7772967 (diff)
downloadmariadb-git-fbf2bc183aad7dd3a25bf0877ebdf89f946674b4.tar.gz
Merge maint2.mysql.com:/data/localhome/tsmith/bk/g51
into maint2.mysql.com:/data/localhome/tsmith/bk/51 client/mysqltest.c: Auto merged configure.in: Auto merged include/config-netware.h: Auto merged include/mysql_com.h: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/lib/mtr_process.pl: Auto merged mysql-test/r/func_time.result: Auto merged mysql-test/r/grant.result: Auto merged mysql-test/r/innodb_mysql.result: Auto merged mysql-test/r/partition.result: Auto merged mysql-test/r/partition_mgm.result: Auto merged mysql-test/t/disabled.def: Auto merged mysql-test/t/func_time.test: Auto merged mysql-test/t/grant.test: Auto merged mysql-test/t/innodb_mysql.test: Auto merged sql/ha_innodb.cc: Auto merged sql/item_func.h: Auto merged sql/item_strfunc.cc: Auto merged sql/item_strfunc.h: Auto merged sql/item_timefunc.cc: Auto merged sql/mysqld.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_show.cc: Auto merged storage/innobase/btr/btr0btr.c: Auto merged storage/innobase/buf/buf0buf.c: Auto merged storage/innobase/dict/dict0dict.c: Auto merged storage/innobase/fil/fil0fil.c: Auto merged storage/innobase/fsp/fsp0fsp.c: Auto merged storage/innobase/include/btr0cur.ic: Auto merged storage/innobase/include/buf0buf.ic: Auto merged storage/innobase/log/log0log.c: Auto merged storage/innobase/log/log0recv.c: Auto merged storage/innobase/os/os0file.c: Auto merged storage/innobase/row/row0sel.c: Auto merged storage/innobase/srv/srv0start.c: Auto merged storage/innobase/ut/ut0dbg.c: Auto merged tests/mysql_client_test.c: Auto merged BUILD/check-cpu: Manual merge storage/innobase/row/row0mysql.c: Manual merge
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/Makefile.am6
-rw-r--r--mysql-test/lib/mtr_cases.pl66
-rw-r--r--mysql-test/lib/mtr_misc.pl2
-rw-r--r--mysql-test/lib/mtr_process.pl7
-rwxr-xr-xmysql-test/mysql-test-run.pl717
-rw-r--r--mysql-test/r/auto_increment.result46
-rw-r--r--mysql-test/r/ctype_ucs.result44
-rw-r--r--mysql-test/r/func_misc.result5
-rw-r--r--mysql-test/r/innodb.result16
-rw-r--r--mysql-test/r/innodb_mysql.result46
-rw-r--r--mysql-test/r/mysql.result14
-rw-r--r--mysql-test/r/mysqldump.result322
-rw-r--r--mysql-test/r/ndb_dd_advance.result14
-rw-r--r--mysql-test/r/ndb_dd_advance2.result8
-rw-r--r--mysql-test/r/ndb_dd_backuprestore.result12
-rw-r--r--mysql-test/r/ndb_dd_basic.result2
-rw-r--r--mysql-test/r/ndb_dd_disk2memory.result4
-rw-r--r--mysql-test/r/partition.result8
-rw-r--r--mysql-test/r/variables.result6
-rw-r--r--mysql-test/t/auto_increment.test36
-rw-r--r--mysql-test/t/ctype_ucs.test43
-rw-r--r--mysql-test/t/disabled.def1
-rw-r--r--mysql-test/t/func_misc.test12
-rw-r--r--mysql-test/t/innodb.test8
-rw-r--r--mysql-test/t/innodb_mysql.test37
-rw-r--r--mysql-test/t/mysql.test4
-rw-r--r--mysql-test/t/mysqldump.test215
-rw-r--r--mysql-test/t/variables.test11
28 files changed, 1023 insertions, 689 deletions
diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am
index 7fa6fa1e23e..61bac05b224 100644
--- a/mysql-test/Makefile.am
+++ b/mysql-test/Makefile.am
@@ -24,7 +24,7 @@ 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
+GENSCRIPTS = mysql-test-run install_test_db mtr
PRESCRIPTS = mysql-test-run.pl
test_SCRIPTS = $(GENSCRIPTS) $(PRESCRIPTS)
test_DATA = std_data/client-key.pem std_data/client-cert.pem \
@@ -113,6 +113,10 @@ install-data-local:
uninstall-local:
@RM@ -f -r $(DESTDIR)$(testdir)
+# mtr - a shortcut for executing mysql-test-run.pl
+mtr:
+ $(RM) -f mtr
+ $(LN_S) mysql-test-run.pl mtr
SUFFIXES = .sh
diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl
index b0ba27e6736..cfd07abb9e0 100644
--- a/mysql-test/lib/mtr_cases.pl
+++ b/mysql-test/lib/mtr_cases.pl
@@ -102,7 +102,7 @@ sub collect_test_cases ($) {
if ( $mysqld_test_exists and $im_test_exists )
{
- mtr_error("Ambiguos test case name ($tname)");
+ mtr_error("Ambiguous test case name ($tname)");
}
elsif ( ! $mysqld_test_exists and ! $im_test_exists )
{
@@ -157,34 +157,38 @@ sub collect_test_cases ($) {
if ( $::opt_reorder )
{
- @$cases = sort {
- if ( ! $a->{'master_restart'} and ! $b->{'master_restart'} )
- {
- return $a->{'name'} cmp $b->{'name'};
- }
- if ( $a->{'master_restart'} and $b->{'master_restart'} )
- {
- my $cmp= mtr_cmp_opts($a->{'master_opt'}, $b->{'master_opt'});
- if ( $cmp == 0 )
- {
- return $a->{'name'} cmp $b->{'name'};
- }
- else
- {
- return $cmp;
- }
- }
+ my %sort_criteria;
+ my $tinfo;
- if ( $a->{'master_restart'} )
- {
- return 1; # Is greater
- }
- else
- {
- return -1; # Is less
- }
- } @$cases;
+ # Make a mapping of test name to a string that represents how that test
+ # should be sorted among the other tests. Put the most important criterion
+ # first, then a sub-criterion, then sub-sub-criterion, et c.
+ foreach $tinfo (@$cases)
+ {
+ my @this_criteria = ();
+
+ # Append the criteria for sorting, in order of importance.
+ push(@this_criteria, join("!", sort @{$tinfo->{'master_opt'}}) . "~"); # Ending with "~" makes empty sort later than filled
+ push(@this_criteria, "ndb=" . ($tinfo->{'ndb_test'} ? "1" : "0"));
+ push(@this_criteria, "restart=" . ($tinfo->{'master_restart'} ? "1" : "0"));
+ push(@this_criteria, "big_test=" . ($tinfo->{'big_test'} ? "1" : "0"));
+ push(@this_criteria, join("|", sort keys %{$tinfo})); # Group similar things together. The values may differ substantially. FIXME?
+ push(@this_criteria, $tinfo->{'name'}); # Finally, order by the name
+
+ $sort_criteria{$tinfo->{"name"}} = join(" ", @this_criteria);
+ }
+
+ @$cases = sort { $sort_criteria{$a->{"name"}} cmp $sort_criteria{$b->{"name"}}; } @$cases;
+
+### For debugging the sort-order
+# foreach $tinfo (@$cases)
+# {
+# print $sort_criteria{$tinfo->{"name"}};
+# print " -> \t";
+# print $tinfo->{"name"};
+# print "\n";
+# }
}
return $cases;
@@ -469,14 +473,6 @@ sub collect_one_test_case($$$$$$$) {
{
mtr_options_from_test_file($tinfo,"$testdir/${tname}.test");
- if ( ! $tinfo->{'innodb_test'} )
- {
- # mtr_verbose("Adding '--skip-innodb' to $tinfo->{'name'}");
- # FIXME activate the --skip-innodb only when running with
- # selected test cases
- # push(@{$tinfo->{'master_opt'}}, "--skip-innodb");
- }
-
if ( $tinfo->{'big_test'} and ! $::opt_big_test )
{
$tinfo->{'skip'}= 1;
diff --git a/mysql-test/lib/mtr_misc.pl b/mysql-test/lib/mtr_misc.pl
index 0ab09a40b37..dd9d24ebc8e 100644
--- a/mysql-test/lib/mtr_misc.pl
+++ b/mysql-test/lib/mtr_misc.pl
@@ -139,6 +139,8 @@ sub mtr_copy_dir($$) {
my $from_dir= shift;
my $to_dir= shift;
+# mtr_verbose("Copying from $from_dir to $to_dir");
+
mkpath("$to_dir");
opendir(DIR, "$from_dir")
or mtr_error("Can't find $from_dir$!");
diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl
index 42dd8f8d331..ab2af8c4ccf 100644
--- a/mysql-test/lib/mtr_process.pl
+++ b/mysql-test/lib/mtr_process.pl
@@ -115,6 +115,8 @@ sub spawn_impl ($$$$$$$$) {
my $pid_file= shift; # FIXME
my $spawn_opts= shift;
+ mtr_error("Can't spawn with empty \"path\"") unless defined $path;
+
if ( $::opt_script_debug )
{
print STDERR "\n";
@@ -702,7 +704,7 @@ sub mtr_check_stop_servers ($) {
}
else
{
- mtr_verbose("All ports where free, continuing");
+ mtr_verbose("All ports were free, continuing");
}
}
}
@@ -975,6 +977,7 @@ sub check_expected_crash_and_restart($)
sub mtr_record_dead_children () {
+ my $process_died= 0;
my $ret_pid;
# Wait without blockinng to see if any processes had died
@@ -983,7 +986,9 @@ sub mtr_record_dead_children () {
{
mtr_warning("mtr_record_dead_children: $ret_pid");
mark_process_dead($ret_pid);
+ $process_died= 1;
}
+ return $process_died;
}
sub start_reap_all {
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 13da2af0c45..58cd86893d7 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -216,7 +216,7 @@ our $opt_embedded_server;
our $opt_extern;
our $opt_fast;
our $opt_force;
-our $opt_reorder;
+our $opt_reorder= 0;
our $opt_enable_disabled;
our $opt_gcov;
@@ -258,6 +258,7 @@ our $opt_result_ext;
our $opt_skip;
our $opt_skip_rpl;
our $use_slaves;
+our $use_innodb;
our $opt_skip_test;
our $opt_skip_im;
@@ -357,9 +358,11 @@ sub run_benchmarks ($);
sub initialize_servers ();
sub mysql_install_db ();
sub install_db ($$);
+sub copy_install_db ($$);
sub run_testcase ($);
-sub run_testcase_stop_servers ($);
+sub run_testcase_stop_servers ($$$);
sub run_testcase_start_servers ($);
+sub run_testcase_check_skip_test($);
sub report_failure_and_restart ($);
sub do_before_start_master ($$);
sub do_before_start_slave ($$);
@@ -424,6 +427,7 @@ sub main () {
$need_ndbcluster||= $test->{ndb_test};
$need_im||= $test->{component_id} eq 'im';
$use_slaves||= $test->{slave_num};
+ $use_innodb||= $test->{'innodb_test'};
}
$opt_skip_ndbcluster= $opt_skip_ndbcluster_slave= 1
unless $need_ndbcluster;
@@ -1308,9 +1312,19 @@ sub executable_setup () {
}
+sub generate_cmdline_mysqldump ($) {
+ my($mysqld) = @_;
+ return
+ "$exe_mysqldump --no-defaults -uroot " .
+ "--port=$mysqld->{'port'} " .
+ "--socket=$mysqld->{'path_sock'} --password=";
+}
+
+
##############################################################################
#
-# Set environment to be used by childs of this process
+# Set environment to be used by childs of this process for
+# things that are constant duting the whole lifetime of mysql-test-run.pl
#
##############################################################################
@@ -1318,9 +1332,10 @@ sub executable_setup () {
sub environment_setup () {
- my $extra_ld_library_paths;
umask(022);
+ my $extra_ld_library_paths;
+
# --------------------------------------------------------------------------
# Setup LD_LIBRARY_PATH so the libraries from this distro/clone
# are used in favor of the system installed ones
@@ -1351,6 +1366,7 @@ sub environment_setup () {
# Also command lines in .opt files may contain env vars
# --------------------------------------------------------------------------
+ $ENV{'CHARSETSDIR'}= $path_charsetsdir;
$ENV{'UMASK'}= "0660"; # The octal *string*
$ENV{'UMASK_DIR'}= "0770"; # The octal *string*
$ENV{'LC_COLLATE'}= "C";
@@ -1368,10 +1384,28 @@ sub environment_setup () {
# $ENV{'MYSQL_TCP_PORT'}= '@MYSQL_TCP_PORT@'; # FIXME
$ENV{'MYSQL_TCP_PORT'}= 3306;
- $ENV{'NDBCLUSTER_PORT'}= $opt_ndbcluster_port;
- $ENV{'NDBCLUSTER_PORT_SLAVE'}=$opt_ndbcluster_port_slave;
- $ENV{'NDB_STATUS_OK'}= "YES";
+ $ENV{MTR_BUILD_THREAD}= 0 unless $ENV{MTR_BUILD_THREAD}; # Set if not set
+
+ # ----------------------------------------------------
+ # Setup env for NDB
+ # ----------------------------------------------------
+ $ENV{'NDB_MGM'}= $exe_ndb_mgm;
+
+ $ENV{'NDBCLUSTER_PORT'}= $opt_ndbcluster_port;
+ $ENV{'NDBCLUSTER_PORT_SLAVE'}= $opt_ndbcluster_port_slave;
+
+ $ENV{'NDB_EXTRA_TEST'}= $opt_ndb_extra_test;
+
+ $ENV{'NDB_BACKUP_DIR'}= $clusters->[0]->{'data_dir'};
+ $ENV{'NDB_DATA_DIR'}= $clusters->[0]->{'data_dir'};
+ $ENV{'NDB_TOOLS_DIR'}= $path_ndb_tools_dir;
+ $ENV{'NDB_TOOLS_OUTPUT'}= $file_ndb_testrun_log;
+ $ENV{'NDB_CONNECTSTRING'}= $opt_ndbconnectstring;
+
+ # ----------------------------------------------------
+ # Setup env for IM
+ # ----------------------------------------------------
$ENV{'IM_EXE'}= $exe_im;
$ENV{'IM_PATH_PID'}= $instance_manager->{path_pid};
$ENV{'IM_PATH_ANGEL_PID'}= $instance_manager->{path_angel_pid};
@@ -1386,9 +1420,174 @@ sub environment_setup () {
$ENV{'IM_MYSQLD2_PORT'}= $instance_manager->{instances}->[1]->{port};
$ENV{'IM_MYSQLD2_PATH_PID'}=$instance_manager->{instances}->[1]->{path_pid};
- $ENV{MTR_BUILD_THREAD}= 0 unless $ENV{MTR_BUILD_THREAD}; # Set if not set
+ # ----------------------------------------------------
+ # Setup env so childs can execute mysqlcheck
+ # ----------------------------------------------------
+ my $cmdline_mysqlcheck=
+ "$exe_mysqlcheck --no-defaults -uroot " .
+ "--port=$master->[0]->{'port'} " .
+ "--socket=$master->[0]->{'path_sock'} --password=";
+
+ if ( $opt_debug )
+ {
+ $cmdline_mysqlcheck .=
+ " --debug=d:t:A,$opt_vardir_trace/log/mysqlcheck.trace";
+ }
+ $ENV{'MYSQL_CHECK'}= $cmdline_mysqlcheck;
+
+ # ----------------------------------------------------
+ # Setup env to childs can execute myqldump
+ # ----------------------------------------------------
+ my $cmdline_mysqldump= generate_cmdline_mysqldump($master->[0]);
+ my $cmdline_mysqldumpslave= generate_cmdline_mysqldump($slave->[0]);
+
+ if ( $opt_debug )
+ {
+ $cmdline_mysqldump .=
+ " --debug=d:t:A,$opt_vardir_trace/log/mysqldump-master.trace";
+ $cmdline_mysqldumpslave .=
+ " --debug=d:t:A,$opt_vardir_trace/log/mysqldump-slave.trace";
+ }
+ $ENV{'MYSQL_DUMP'}= $cmdline_mysqldump;
+ $ENV{'MYSQL_DUMP_SLAVE'}= $cmdline_mysqldumpslave;
+
+
+ # ----------------------------------------------------
+ # Setup env so childs can execute mysqlslap
+ # ----------------------------------------------------
+ unless ( $glob_win32 )
+ {
+ my $cmdline_mysqlslap=
+ "$exe_mysqlslap -uroot " .
+ "--port=$master->[0]->{'port'} " .
+ "--socket=$master->[0]->{'path_sock'} --password= " .
+ "--lock-directory=$opt_tmpdir";
+
+ if ( $opt_debug )
+ {
+ $cmdline_mysqlslap .=
+ " --debug=d:t:A,$opt_vardir_trace/log/mysqlslap.trace";
+ }
+ $ENV{'MYSQL_SLAP'}= $cmdline_mysqlslap;
+ }
+
+ # ----------------------------------------------------
+ # Setup env so childs can execute mysqlimport
+ # ----------------------------------------------------
+ my $cmdline_mysqlimport=
+ "$exe_mysqlimport -uroot " .
+ "--port=$master->[0]->{'port'} " .
+ "--socket=$master->[0]->{'path_sock'} --password=";
+
+ if ( $opt_debug )
+ {
+ $cmdline_mysqlimport .=
+ " --debug=d:t:A,$opt_vardir_trace/log/mysqlimport.trace";
+ }
+ $ENV{'MYSQL_IMPORT'}= $cmdline_mysqlimport;
+
+
+ # ----------------------------------------------------
+ # Setup env so childs can execute mysqlshow
+ # ----------------------------------------------------
+ my $cmdline_mysqlshow=
+ "$exe_mysqlshow -uroot " .
+ "--port=$master->[0]->{'port'} " .
+ "--socket=$master->[0]->{'path_sock'} --password=";
+
+ if ( $opt_debug )
+ {
+ $cmdline_mysqlshow .=
+ " --debug=d:t:A,$opt_vardir_trace/log/mysqlshow.trace";
+ }
+ $ENV{'MYSQL_SHOW'}= $cmdline_mysqlshow;
+
+ # ----------------------------------------------------
+ # Setup env so childs can execute mysqlbinlog
+ # ----------------------------------------------------
+ my $cmdline_mysqlbinlog=
+ "$exe_mysqlbinlog" .
+ " --no-defaults --local-load=$opt_tmpdir" .
+ " --character-sets-dir=$path_charsetsdir";
+
+ if ( $opt_debug )
+ {
+ $cmdline_mysqlbinlog .=
+ " --debug=d:t:A,$opt_vardir_trace/log/mysqlbinlog.trace";
+ }
+ $ENV{'MYSQL_BINLOG'}= $cmdline_mysqlbinlog;
+
+ # ----------------------------------------------------
+ # Setup env so childs can execute mysql
+ # ----------------------------------------------------
+ my $cmdline_mysql=
+ "$exe_mysql --no-defaults --host=localhost --user=root --password= " .
+ "--port=$master->[0]->{'port'} " .
+ "--socket=$master->[0]->{'path_sock'}";
+
+ $ENV{'MYSQL'}= $cmdline_mysql;
+
+ # ----------------------------------------------------
+ # Setup env so childs can execute mysql_client_test
+ # ----------------------------------------------------
+ my $cmdline_mysql_client_test=
+ "$exe_mysql_client_test --no-defaults --testcase --user=root --silent " .
+ "--port=$master->[0]->{'port'} " .
+ "--vardir=$opt_vardir " .
+ "--socket=$master->[0]->{'path_sock'}";
+
+ if ( $opt_debug )
+ {
+ $cmdline_mysql_client_test .=
+ " --debug=d:t:A,$opt_vardir_trace/log/mysql_client_test.trace";
+ }
+
+ if ( $glob_use_embedded_server )
+ {
+ $cmdline_mysql_client_test.=
+ " -A --language=$path_language" .
+ " -A --datadir=$slave->[0]->{'path_myddir'}" .
+ " -A --character-sets-dir=$path_charsetsdir";
+ }
+ $ENV{'MYSQL_CLIENT_TEST'}= $cmdline_mysql_client_test;
+
+
+ # ----------------------------------------------------
+ # Setup env so childs can execute mysql_fix_system_tables
+ # ----------------------------------------------------
+ my $cmdline_mysql_fix_system_tables=
+ "$exe_mysql_fix_system_tables --no-defaults --host=localhost --user=root --password= " .
+ "--basedir=$glob_basedir --bindir=$path_client_bindir --verbose " .
+ "--port=$master->[0]->{'port'} " .
+ "--socket=$master->[0]->{'path_sock'}";
+
+ $ENV{'MYSQL_FIX_SYSTEM_TABLES'}= $cmdline_mysql_fix_system_tables;
+
+ # ----------------------------------------------------
+ # Setup env so childs can execute my_print_defaults
+ # ----------------------------------------------------
+ $ENV{'MYSQL_MY_PRINT_DEFAULTS'}= $exe_my_print_defaults;
+
+
+ # ----------------------------------------------------
+ # Setup env so childs can execute perror
+ # ----------------------------------------------------
+ $ENV{'MY_PERROR'}= $exe_perror;
+
+ # ----------------------------------------------------
+ # Add the path where mysqld will find udf_example.so
+ # ----------------------------------------------------
+ $ENV{'UDF_EXAMPLE_LIB'}=
+ ($lib_udf_example ? basename($lib_udf_example) : "");
+
+ $ENV{'LD_LIBRARY_PATH'}=
+ ($lib_udf_example ? dirname($lib_udf_example) : "") .
+ ($ENV{'LD_LIBRARY_PATH'} ? ":$ENV{'LD_LIBRARY_PATH'}" : "");
+
+ # ----------------------------------------------------
# We are nice and report a bit about our settings
+ # ----------------------------------------------------
if (!$opt_extern)
{
print "Using MTR_BUILD_THREAD = $ENV{MTR_BUILD_THREAD}\n";
@@ -1756,6 +1955,23 @@ sub mysqld_wait_started($){
}
+sub ndb_mgmd_wait_started($) {
+ my ($cluster)= @_;
+
+ my $retries= 100;
+ while (ndbcluster_wait_started($cluster, "--no-contact") and
+ $retries)
+ {
+ # Millisceond sleep emulated with select
+ select(undef, undef, undef, (0.1));
+
+ $retries--;
+ }
+
+ return $retries == 0;
+
+}
+
sub ndb_mgmd_start ($) {
my $cluster= shift;
@@ -1776,13 +1992,12 @@ sub ndb_mgmd_start ($) {
"",
{ append_log_file => 1 });
-
# FIXME Should not be needed
# Unfortunately the cluster nodes will fail to start
# if ndb_mgmd has not started properly
- while (ndbcluster_wait_started($cluster, "--no-contact"))
+ if (ndb_mgmd_wait_started($cluster))
{
- select(undef, undef, undef, 0.1);
+ mtr_error("Failed to wait for start of ndb_mgmd");
}
# Remember pid of ndb_mgmd
@@ -1847,7 +2062,7 @@ sub ndbcluster_start ($$) {
mtr_error("Cluster '$cluster->{'name'}' already started");
}
- my $pid= ndb_mgmd_start($cluster);
+ ndb_mgmd_start($cluster);
for ( my $idx= 0; $idx < $cluster->{'nodes'}; $idx++ )
{
@@ -1958,6 +2173,11 @@ sub run_suite () {
foreach my $tinfo ( @$tests )
{
+ if (run_testcase_check_skip_test($tinfo))
+ {
+ next;
+ }
+
mtr_timer_start($glob_timers,"testcase", 60 * $opt_testcase_timeout);
run_testcase($tinfo);
mtr_timer_stop($glob_timers,"testcase");
@@ -2013,9 +2233,10 @@ sub initialize_servers () {
sub mysql_install_db () {
- # FIXME not exactly true I think, needs improvements
install_db('master', $master->[0]->{'path_myddir'});
- install_db('master', $master->[1]->{'path_myddir'});
+
+ # FIXME check if testcase really is using second master
+ copy_install_db('master', $master->[1]->{'path_myddir'});
if ( $use_slaves )
{
@@ -2029,10 +2250,8 @@ sub mysql_install_db () {
im_prepare_env($instance_manager);
}
-
my $cluster_started_ok= 1; # Assume it can be started
-
if (ndbcluster_start_install($clusters->[0]) ||
$use_slaves && ndbcluster_start_install($clusters->[1]))
{
@@ -2040,7 +2259,6 @@ sub mysql_install_db () {
$cluster_started_ok= 0;
}
-
foreach my $cluster (@{$clusters})
{
@@ -2058,6 +2276,9 @@ sub mysql_install_db () {
}
}
+ $ENV{'NDB_STATUS_OK'}= $clusters->[0]->{'installed_ok'};
+ $ENV{'NDB_SLAVE_STATUS_OK'}= $clusters->[1]->{'installed_ok'};;
+
if ( ! $cluster_started_ok )
{
if ( $opt_force)
@@ -2077,6 +2298,18 @@ sub mysql_install_db () {
}
+sub copy_install_db ($$) {
+ my $type= shift;
+ my $data_dir= shift;
+
+ mtr_report("Installing \u$type Database");
+
+ # Just copy the installed db from first master
+ mtr_copy_dir($master->[0]->{'path_myddir'}, $data_dir);
+
+}
+
+
sub install_db ($$) {
my $type= shift;
my $data_dir= shift;
@@ -2231,38 +2464,15 @@ sub im_prepare_data_dir($) {
foreach my $instance (@{$instance_manager->{'instances'}})
{
- install_db(
+ copy_install_db(
'im_mysqld_' . $instance->{'server_id'},
$instance->{'path_datadir'});
}
}
-
-##############################################################################
-#
-# Run a single test case
-#
-##############################################################################
-
-# When we get here, we have already filtered out test cases that doesn't
-# apply to the current setup, for example if we use a running server, test
-# cases that restart the server are dropped. So this function should mostly
-# be about doing things, not a lot of logic.
-
-# We don't start and kill the servers for each testcase. But some
-# testcases needs a restart, because they specify options to start
-# mysqld with. After that testcase, we need to restart again, to set
-# back the normal options.
-
-sub run_testcase ($) {
- my $tinfo= shift;
-
- my $tname= $tinfo->{'name'};
-
- mtr_tonewfile($path_current_test_log,"$tname\n"); # Always tell where we are
-
- # output current test to ndbcluster log file to enable diagnostics
- mtr_tofile($file_ndb_testrun_log,"CURRENT TEST $tname\n");
+sub run_testcase_check_skip_test($)
+{
+ my ($tinfo)= @_;
# ----------------------------------------------------------------------
# If marked to skip, just print out and return.
@@ -2275,7 +2485,7 @@ sub run_testcase ($) {
{
mtr_report_test_name($tinfo);
mtr_report_test_skipped($tinfo);
- return;
+ return 1;
}
# If test needs cluster, check that master installed ok
@@ -2283,7 +2493,7 @@ sub run_testcase ($) {
{
mtr_report_test_name($tinfo);
mtr_report_test_failed($tinfo);
- return;
+ return 1;
}
# If test needs slave cluster, check that it installed ok
@@ -2292,65 +2502,103 @@ sub run_testcase ($) {
{
mtr_report_test_name($tinfo);
mtr_report_test_failed($tinfo);
- return;
+ return 1;
}
- run_testcase_stop_servers($tinfo);
+ return 0;
+}
- # ----------------------------------------------------------------------
- # Prepare to start masters. Even if we use embedded, we want to run
- # the preparation.
- # ----------------------------------------------------------------------
- $ENV{'TZ'}= $tinfo->{'timezone'};
+sub do_before_run_mysqltest($)
+{
+ my $tinfo= shift;
+ my $tname= $tinfo->{'name'};
+
+ # Remove old reject file
+ if ( $opt_suite eq "main" )
+ {
+ unlink("r/$tname.reject");
+ }
+ else
+ {
+ unlink("suite/$opt_suite/r/$tname.reject");
+ }
+
+
+# MASV cleanup...
+ mtr_tonewfile($path_current_test_log,"$tname\n"); # Always tell where we are
+
+ # output current test to ndbcluster log file to enable diagnostics
+ mtr_tofile($file_ndb_testrun_log,"CURRENT TEST $tname\n");
mtr_tofile($master->[0]->{'path_myerr'},"CURRENT_TEST: $tname\n");
if ( $master->[1]->{'pid'} )
{
mtr_tofile($master->[1]->{'path_myerr'},"CURRENT_TEST: $tname\n");
}
+}
- # ----------------------------------------------------------------------
- # If any mysqld servers running died, we have to know
- # ----------------------------------------------------------------------
+sub do_after_run_mysqltest($)
+{
+ my $tinfo= shift;
+ my $tname= $tinfo->{'name'};
- mtr_record_dead_children();
+ #MASV cleanup
+ # Save info from this testcase run to mysqltest.log
+ my $testcase_log= mtr_fromfile($path_timefile) if -f $path_timefile;
+ mtr_tofile($path_mysqltest_log,"CURRENT TEST $tname\n");
+ mtr_tofile($path_mysqltest_log, $testcase_log);
+ }
- # ----------------------------------------------------------------------
- # Start masters needed by the testcase
- # ----------------------------------------------------------------------
- run_testcase_start_servers($tinfo);
+
+##############################################################################
+#
+# Run a single test case
+#
+##############################################################################
+
+# When we get here, we have already filtered out test cases that doesn't
+# apply to the current setup, for example if we use a running server, test
+# cases that restart the server are dropped. So this function should mostly
+# be about doing things, not a lot of logic.
+
+# We don't start and kill the servers for each testcase. But some
+# testcases needs a restart, because they specify options to start
+# mysqld with. After that testcase, we need to restart again, to set
+# back the normal options.
+
+sub run_testcase ($) {
+ my $tinfo= shift;
+
+ my $master_restart= run_testcase_need_master_restart($tinfo);
+ my $slave_restart= run_testcase_need_slave_restart($tinfo);
+
+ if ($master_restart or $slave_restart)
+ {
+ run_testcase_stop_servers($tinfo, $master_restart, $slave_restart);
+ }
+
+ my $died= mtr_record_dead_children();
+ if ($died or $master_restart or $slave_restart)
+ {
+ run_testcase_start_servers($tinfo);
+ }
# ----------------------------------------------------------------------
# If --start-and-exit or --start-dirty given, stop here to let user manually
# run tests
# ----------------------------------------------------------------------
-
if ( $opt_start_and_exit or $opt_start_dirty )
{
mtr_report("\nServers started, exiting");
exit(0);
}
- # ----------------------------------------------------------------------
- # Run the test case
- # ----------------------------------------------------------------------
-
- mtr_report_test_name($tinfo);
-
{
- # remove the old reject file
- if ( $opt_suite eq "main" )
- {
- unlink("r/$tname.reject");
- }
- else
- {
- unlink("suite/$opt_suite/r/$tname.reject");
- }
- unlink($path_timefile);
+ do_before_run_mysqltest($tinfo);
my $res= run_mysqltest($tinfo);
+ mtr_report_test_name($tinfo);
if ( $res == 0 )
{
mtr_report_test_passed($tinfo);
@@ -2362,7 +2610,8 @@ sub run_testcase ($) {
# Try to get reason from mysqltest.log
my $last_line= mtr_lastlinefromfile($path_timefile) if -f $path_timefile;
my $reason= mtr_match_prefix($last_line, "reason: ");
- $tinfo->{'comment'}= defined $reason ? $reason : "Detected by testcase(reason unknown) ";
+ $tinfo->{'comment'}=
+ defined $reason ? $reason : "Detected by testcase(reason unknown) ";
mtr_report_test_skipped($tinfo);
}
elsif ( $res == 63 )
@@ -2382,10 +2631,8 @@ sub run_testcase ($) {
report_failure_and_restart($tinfo);
}
- # Save info from this testcase run to mysqltest.log
- my $testcase_log= mtr_fromfile($path_timefile) if -f $path_timefile;
- mtr_tofile($path_mysqltest_log,"CURRENT TEST $tname\n");
- mtr_tofile($path_mysqltest_log, $testcase_log);
+
+ do_after_run_mysqltest($tinfo);
}
# ----------------------------------------------------------------------
@@ -2650,7 +2897,7 @@ sub mysqld_arguments ($$$$$) {
mtr_add_arg($args, "%s--datadir=%s", $prefix,
$master->[$idx]->{'path_myddir'});
- if ( $idx > 0 )
+ if ( $idx > 0 or !$use_innodb)
{
mtr_add_arg($args, "%s--skip-innodb", $prefix);
}
@@ -2999,24 +3246,9 @@ sub stop_all_servers () {
}
-# ----------------------------------------------------------------------
-# If not using a running servers we may need to stop and restart.
-# We restart in the case we have initiation scripts, server options
-# etc to run. But we also restart again after the test first restart
-# and test is run, to get back to normal server settings.
-#
-# To make the code a bit more clean, we actually only stop servers
-# here, and mark this to be done. Then a generic "start" part will
-# start up the needed servers again.
-# ----------------------------------------------------------------------
-
-sub run_testcase_stop_servers($) {
- my $tinfo= shift;
-
- if ( $glob_use_running_server || $glob_use_embedded_server )
- {
- return;
- }
+sub run_testcase_need_master_restart($)
+{
+ my ($tinfo)= @_;
# We try to find out if we are to restart the master(s)
my $do_restart= 0; # Assumes we don't have to
@@ -3073,6 +3305,91 @@ sub run_testcase_stop_servers($) {
join(" ", @{$master->[0]->{'start_opts'}}) . "'" );
}
+ return $do_restart;
+}
+
+sub run_testcase_need_slave_restart($)
+{
+ my ($tinfo)= @_;
+
+ # We try to find out if we are to restart the slaves
+ my $do_slave_restart= 0; # Assumes we don't have to
+
+ # FIXME only restart slave when necessary
+ $do_slave_restart= 1;
+
+# if ( ! $slave->[0]->{'pid'} )
+# {
+# # mtr_verbose("Slave not started, no need to check slave restart");
+# }
+# elsif ( $do_restart )
+# {
+# $do_slave_restart= 1; # Always restart if master restart
+# mtr_verbose("Restart slave because: Master restart");
+# }
+# elsif ( $tinfo->{'slave_sh'} )
+# {
+# $do_slave_restart= 1; # Always restart if script to run
+# mtr_verbose("Restart slave because: Always restart if script to run");
+# }
+# elsif ( ! $opt_skip_ndbcluster_slave and
+# $tinfo->{'ndb_test'} == 0 and
+# $clusters->[1]->{'pid'} != 0 )
+# {
+# $do_slave_restart= 1; # Restart without slave cluster
+# mtr_verbose("Restart slave because: Test does not need slave cluster");
+# }
+# elsif ( ! $opt_with_ndbcluster_slave and
+# $tinfo->{'ndb_test'} == 1 and
+# $clusters->[1]->{'pid'} == 0 )
+# {
+# $do_slave_restart= 1; # Restart with slave cluster
+# mtr_verbose("Restart slave because: Test need slave cluster");
+# }
+# elsif ( $tinfo->{'slave_restart'} )
+# {
+# $do_slave_restart= 1;
+# mtr_verbose("Restart slave because: slave_restart");
+# }
+# elsif ( $slave->[0]->{'running_slave_is_special'} )
+# {
+# $do_slave_restart= 1;
+# mtr_verbose("Restart slave because: running_slave_is_special");
+# }
+# # Check that running slave was started with same options
+# # as the current test requires
+# elsif (! mtr_same_opts($slave->[0]->{'start_opts'},
+# $tinfo->{'slave_opt'}) )
+# {
+# $do_slave_restart= 1;
+# mtr_verbose("Restart slave because: running with different options '" .
+# join(" ", @{$tinfo->{'slave_opt'}}) . "' != '" .
+# join(" ", @{$slave->[0]->{'start_opts'}}) . "'" );
+# }
+
+ return $do_slave_restart;
+
+}
+
+# ----------------------------------------------------------------------
+# If not using a running servers we may need to stop and restart.
+# We restart in the case we have initiation scripts, server options
+# etc to run. But we also restart again after the test first restart
+# and test is run, to get back to normal server settings.
+#
+# To make the code a bit more clean, we actually only stop servers
+# here, and mark this to be done. Then a generic "start" part will
+# start up the needed servers again.
+# ----------------------------------------------------------------------
+
+sub run_testcase_stop_servers($$$) {
+ my ($tinfo, $do_restart, $do_slave_restart)= @_;
+
+ if ( $glob_use_running_server || $glob_use_embedded_server )
+ {
+ return;
+ }
+
my $pid;
my %admin_pids; # hash of admin processes that requests shutdown
my @kill_pids; # list of processes to shutdown/kill
@@ -3130,62 +3447,7 @@ sub run_testcase_stop_servers($) {
}
}
- # We try to find out if we are to restart the slaves
- my $do_slave_restart= 0; # Assumes we don't have to
-
- # FIXME only restaret when necessary
- $do_slave_restart= 1;
-
-# if ( ! $slave->[0]->{'pid'} )
-# {
-# # mtr_verbose("Slave not started, no need to check slave restart");
-# }
-# elsif ( $do_restart )
-# {
-# $do_slave_restart= 1; # Always restart if master restart
-# mtr_verbose("Restart slave because: Master restart");
-# }
-# elsif ( $tinfo->{'slave_sh'} )
-# {
-# $do_slave_restart= 1; # Always restart if script to run
-# mtr_verbose("Restart slave because: Always restart if script to run");
-# }
-# elsif ( ! $opt_skip_ndbcluster_slave and
-# $tinfo->{'ndb_test'} == 0 and
-# $clusters->[1]->{'pid'} != 0 )
-# {
-# $do_slave_restart= 1; # Restart without slave cluster
-# mtr_verbose("Restart slave because: Test does not need slave cluster");
-# }
-# elsif ( ! $opt_with_ndbcluster_slave and
-# $tinfo->{'ndb_test'} == 1 and
-# $clusters->[1]->{'pid'} == 0 )
-# {
-# $do_slave_restart= 1; # Restart with slave cluster
-# mtr_verbose("Restart slave because: Test need slave cluster");
-# }
-# elsif ( $tinfo->{'slave_restart'} )
-# {
-# $do_slave_restart= 1;
-# mtr_verbose("Restart slave because: slave_restart");
-# }
-# elsif ( $slave->[0]->{'running_slave_is_special'} )
-# {
-# $do_slave_restart= 1;
-# mtr_verbose("Restart slave because: running_slave_is_special");
-# }
-# # Check that running slave was started with same options
-# # as the current test requires
-# elsif (! mtr_same_opts($slave->[0]->{'start_opts'},
-# $tinfo->{'slave_opt'}) )
-# {
-# $do_slave_restart= 1;
-# mtr_verbose("Restart slave because: running with different options '" .
-# join(" ", @{$tinfo->{'slave_opt'}}) . "' != '" .
-# join(" ", @{$slave->[0]->{'start_opts'}}) . "'" );
-# }
-
- if ( $do_slave_restart )
+ if ( $do_restart || $do_slave_restart )
{
delete $slave->[0]->{'running_slave_is_special'}; # Forget history
@@ -3439,136 +3701,9 @@ sub run_check_testcase ($$) {
}
-sub generate_cmdline_mysqldump ($) {
- my($info) = @_;
- return
- "$exe_mysqldump --no-defaults -uroot " .
- "--port=$info->[0]->{'port'} " .
- "--socket=$info->[0]->{'path_sock'} --password=";
-}
sub run_mysqltest ($) {
- my $tinfo= shift;
- my $cmdline_mysqlcheck= "$exe_mysqlcheck --no-defaults -uroot " .
- "--port=$master->[0]->{'port'} " .
- "--socket=$master->[0]->{'path_sock'} --password=";
- if ( $opt_debug )
- {
- $cmdline_mysqlcheck .=
- " --debug=d:t:A,$opt_vardir_trace/log/mysqlcheck.trace";
- }
-
- my $cmdline_mysqldump= generate_cmdline_mysqldump $master;
- my $cmdline_mysqldumpslave= generate_cmdline_mysqldump $slave;
-
- if ( $opt_debug )
- {
- $cmdline_mysqldump .=
- " --debug=d:t:A,$opt_vardir_trace/log/mysqldump-master.trace";
- $cmdline_mysqldumpslave .=
- " --debug=d:t:A,$opt_vardir_trace/log/mysqldump-slave.trace";
- }
-
- my $cmdline_mysqlslap;
-
- unless ( $glob_win32 )
- {
- $cmdline_mysqlslap= "$exe_mysqlslap -uroot " .
- "--port=$master->[0]->{'port'} " .
- "--socket=$master->[0]->{'path_sock'} --password= " .
- "--lock-directory=$opt_tmpdir";
- if ( $opt_debug )
- {
- $cmdline_mysqlslap .=
- " --debug=d:t:A,$opt_vardir_trace/log/mysqlslap.trace";
- }
- }
-
- my $cmdline_mysqlimport= "$exe_mysqlimport -uroot " .
- "--port=$master->[0]->{'port'} " .
- "--socket=$master->[0]->{'path_sock'} --password=";
- if ( $opt_debug )
- {
- $cmdline_mysqlimport .=
- " --debug=d:t:A,$opt_vardir_trace/log/mysqlimport.trace";
- }
-
- my $cmdline_mysqlshow= "$exe_mysqlshow -uroot " .
- "--port=$master->[0]->{'port'} " .
- "--socket=$master->[0]->{'path_sock'} --password=";
- if ( $opt_debug )
- {
- $cmdline_mysqlshow .=
- " --debug=d:t:A,$opt_vardir_trace/log/mysqlshow.trace";
- }
-
- my $cmdline_mysqlbinlog=
- "$exe_mysqlbinlog" .
- " --no-defaults --local-load=$opt_tmpdir" .
- " --character-sets-dir=$path_charsetsdir";
-
- if ( $opt_debug )
- {
- $cmdline_mysqlbinlog .=
- " --debug=d:t:A,$opt_vardir_trace/log/mysqlbinlog.trace";
- }
-
- my $cmdline_mysql=
- "$exe_mysql --no-defaults --host=localhost --user=root --password= " .
- "--port=$master->[0]->{'port'} " .
- "--socket=$master->[0]->{'path_sock'}";
-
- my $cmdline_mysql_client_test=
- "$exe_mysql_client_test --no-defaults --testcase --user=root --silent " .
- "--port=$master->[0]->{'port'} " .
- "--vardir=$opt_vardir " .
- "--socket=$master->[0]->{'path_sock'}";
-
- if ( $opt_debug )
- {
- $cmdline_mysql_client_test .=
- " --debug=d:t:A,$opt_vardir_trace/log/mysql_client_test.trace";
- }
-
- if ( $glob_use_embedded_server )
- {
- $cmdline_mysql_client_test.=
- " -A --language=$path_language" .
- " -A --datadir=$slave->[0]->{'path_myddir'}" .
- " -A --character-sets-dir=$path_charsetsdir";
- }
-
- my $cmdline_mysql_fix_system_tables=
- "$exe_mysql_fix_system_tables --no-defaults --host=localhost --user=root --password= " .
- "--basedir=$glob_basedir --bindir=$path_client_bindir --verbose " .
- "--port=$master->[0]->{'port'} " .
- "--socket=$master->[0]->{'path_sock'}";
-
- $ENV{'MYSQL'}= $cmdline_mysql;
- $ENV{'MYSQL_CHECK'}= $cmdline_mysqlcheck;
- $ENV{'MYSQL_DUMP'}= $cmdline_mysqldump;
- $ENV{'MYSQL_SLAP'}= $cmdline_mysqlslap unless $glob_win32;
- $ENV{'MYSQL_IMPORT'}= $cmdline_mysqlimport;
- $ENV{'MYSQL_DUMP_SLAVE'}= $cmdline_mysqldumpslave;
- $ENV{'MYSQL_SHOW'}= $cmdline_mysqlshow;
- $ENV{'MYSQL_BINLOG'}= $cmdline_mysqlbinlog;
- $ENV{'MYSQL_FIX_SYSTEM_TABLES'}= $cmdline_mysql_fix_system_tables;
- $ENV{'MYSQL_CLIENT_TEST'}= $cmdline_mysql_client_test;
- $ENV{'CHARSETSDIR'}= $path_charsetsdir;
- $ENV{'MYSQL_MY_PRINT_DEFAULTS'}= $exe_my_print_defaults;
- $ENV{'UDF_EXAMPLE_LIB'}=
- ($lib_udf_example ? basename($lib_udf_example) : "");
- $ENV{'MY_PERROR'}= $exe_perror;
-
- $ENV{'NDB_STATUS_OK'}= $clusters->[0]->{'installed_ok'};
- $ENV{'NDB_SLAVE_STATUS_OK'}= $clusters->[0]->{'installed_ok'};;
- $ENV{'NDB_EXTRA_TEST'}= $opt_ndb_extra_test;
- $ENV{'NDB_MGM'}= $exe_ndb_mgm;
- $ENV{'NDB_BACKUP_DIR'}= $clusters->[0]->{'data_dir'};
- $ENV{'NDB_DATA_DIR'}= $clusters->[0]->{'data_dir'};
- $ENV{'NDB_TOOLS_DIR'}= $path_ndb_tools_dir;
- $ENV{'NDB_TOOLS_OUTPUT'}= $file_ndb_testrun_log;
- $ENV{'NDB_CONNECTSTRING'}= $opt_ndbconnectstring;
+ my ($tinfo)= @_;
my $exe= $exe_mysqltest;
my $args;
@@ -3647,7 +3782,8 @@ sub run_mysqltest ($) {
if ( $opt_debug )
{
- mtr_add_arg($args, "--debug=d:t:A,%s/log/mysqltest.trace", $opt_vardir_trace);
+ mtr_add_arg($args, "--debug=d:t:A,%s/log/mysqltest.trace",
+ $opt_vardir_trace);
}
if ( $opt_ssl_supported )
@@ -3660,9 +3796,9 @@ sub run_mysqltest ($) {
$glob_mysql_test_dir);
}
- # Turn on SSL for all test cases
if ( $opt_ssl )
{
+ # Turn on SSL for _all_ test cases if option --ssl was used
mtr_add_arg($args, "--ssl",
$glob_mysql_test_dir);
}
@@ -3744,6 +3880,11 @@ sub run_mysqltest ($) {
}
}
+ # -------------------------------------------------------
+ # Init variables that change for each testcase
+ # -------------------------------------------------------
+ $ENV{'TZ'}= $tinfo->{'timezone'};
+
my $res = mtr_run_test($exe,$args,"","",$path_timefile,"");
if ( $opt_check_testcases )
diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result
index 1f13264ee55..54c2df34a7f 100644
--- a/mysql-test/r/auto_increment.result
+++ b/mysql-test/r/auto_increment.result
@@ -446,52 +446,6 @@ INSERT INTO t1 VALUES(1, 1);
ALTER TABLE t1 CHANGE t1 t1 INT(10) auto_increment;
ERROR 23000: ALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '1' for key 'PRIMARY'
DROP TABLE t1;
-CREATE TABLE `t2` (
-`k` int(11) NOT NULL auto_increment,
-`a` int(11) default NULL,
-`c` int(11) default NULL,
-PRIMARY KEY (`k`),
-UNIQUE KEY `idx_1` (`a`)
-) ENGINE=InnoDB;
-insert into t2 ( a ) values ( 6 ) on duplicate key update c =
-ifnull( c,
-0 ) + 1;
-insert into t2 ( a ) values ( 7 ) on duplicate key update c =
-ifnull( c,
-0 ) + 1;
-select last_insert_id();
-last_insert_id()
-2
-select * from t2;
-k a c
-1 6 NULL
-2 7 NULL
-insert into t2 ( a ) values ( 6 ) on duplicate key update c =
-ifnull( c,
-0 ) + 1;
-select last_insert_id();
-last_insert_id()
-1
-select * from t2;
-k a c
-1 6 1
-2 7 NULL
-insert ignore into t2 values (null,6,1),(10,8,1);
-select last_insert_id();
-last_insert_id()
-1
-insert ignore into t2 values (null,6,1),(null,8,1),(null,15,1),(null,20,1);
-select last_insert_id();
-last_insert_id()
-11
-select * from t2;
-k a c
-1 6 1
-2 7 NULL
-10 8 1
-11 15 1
-12 20 1
-drop table t2;
create table t1 (a int primary key auto_increment, b int, c int, d timestamp default current_timestamp, unique(b),unique(c));
insert into t1 values(null,1,1,now());
insert into t1 values(null,0,0,null);
diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result
index dc2bb4c6c73..4382d864bde 100644
--- a/mysql-test/r/ctype_ucs.result
+++ b/mysql-test/r/ctype_ucs.result
@@ -730,6 +730,49 @@ id MIN(s)
1 ZZZ
2 ZZZ
DROP TABLE t1;
+drop table if exists bug20536;
+set names latin1;
+create table bug20536 (id bigint not null auto_increment primary key, name
+varchar(255) character set ucs2 not null);
+insert into `bug20536` (`id`,`name`) values (1, _latin1 x'7465737431'), (2, "'test\\_2'");
+select md5(name) from bug20536;
+md5(name)
+f4b7ce8b45a20e3c4e84bef515d1525c
+48d95db0d8305c2fe11548a3635c9385
+select sha1(name) from bug20536;
+sha1(name)
+e0b52f38deddb9f9e8d5336b153592794cb49baf
+677d4d505355eb5b0549b865fcae4b7f0c28aef5
+select make_set(3, name, upper(name)) from bug20536;
+make_set(3, name, upper(name))
+test1,TEST1
+'test\_2','TEST\_2'
+select export_set(5, name, upper(name)) from bug20536;
+export_set(5, name, upper(name))
+test1,TEST1,test1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1
+'test\_2','TEST\_2','test\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2'
+select export_set(5, name, upper(name), ",", 5) from bug20536;
+export_set(5, name, upper(name), ",", 5)
+test1,TEST1,test1,TEST1,TEST1
+'test\_2','TEST\_2','test\_2','TEST\_2','TEST\_2'
+select password(name) from bug20536;
+password(name)
+????????????????????
+????????????????????
+select old_password(name) from bug20536;
+old_password(name)
+????????
+????????
+select encrypt(name, 'SALT') from bug20536;
+encrypt(name, 'SALT')
+SA5pDi1UPZdys
+SA5pDi1UPZdys
+select quote(name) from bug20536;
+quote(name)
+????????
+????????????????
+drop table bug20536;
+End of 4.1 tests
CREATE TABLE t1 (a varchar(64) character set ucs2, b decimal(10,3));
INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0);
update t1 set b=a;
@@ -765,3 +808,4 @@ blob 65535 65535
text 65535 65535
text 65535 32767
drop table t1;
+End of 5.0 tests
diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result
index 10d20c001f1..f383a717a85 100644
--- a/mysql-test/r/func_misc.result
+++ b/mysql-test/r/func_misc.result
@@ -87,6 +87,10 @@ SELECT IS_USED_LOCK('bug16501');
IS_USED_LOCK('bug16501')
NULL
DROP TABLE t1;
+select export_set(3, _latin1'foo', _utf8'bar', ',', 4);
+export_set(3, _latin1'foo', _utf8'bar', ',', 4)
+foo,foo,bar,bar
+End of 4.1 tests
create table t1 as select uuid(), length(uuid());
show create table t1;
Table Create Table
@@ -130,3 +134,4 @@ timediff(b, a) >= '00:00:03'
drop table t2;
drop table t1;
set global query_cache_size=default;
+End of 5.0 tests
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index 3034fc2035e..e26e6fb271a 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -1295,24 +1295,16 @@ insert into t2 (a) select b from t1;
insert into t1 (a) select b from t2;
insert into t2 (a) select b from t1;
insert into t1 (a) select b from t2;
-insert into t2 (a) select b from t1;
-insert into t1 (a) select b from t2;
-insert into t2 (a) select b from t1;
-insert into t1 (a) select b from t2;
-insert into t2 (a) select b from t1;
-insert into t1 (a) select b from t2;
-insert into t2 (a) select b from t1;
-insert into t1 (a) select b from t2;
select count(*) from t1;
count(*)
-29267
+623
explain select * from t1 where c between 1 and 2500;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range c c 5 NULL # Using where
update t1 set c=a;
explain select * from t1 where c between 1 and 2500;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 5 NULL # Using where
+1 SIMPLE t1 ALL c NULL NULL NULL # Using where
drop table t1,t2;
create table t1 (id int primary key auto_increment, fk int, index index_fk (fk)) engine=innodb;
insert into t1 (id) values (null),(null),(null),(null),(null);
@@ -1786,10 +1778,10 @@ Variable_name Value
Innodb_rows_deleted 2070
show status like "Innodb_rows_inserted";
Variable_name Value
-Innodb_rows_inserted 31727
+Innodb_rows_inserted 3083
show status like "Innodb_rows_updated";
Variable_name Value
-Innodb_rows_updated 29530
+Innodb_rows_updated 886
show status like "Innodb_row_lock_waits";
Variable_name Value
Innodb_row_lock_waits 0
diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result
index b1336b35f1e..a5b263b759d 100644
--- a/mysql-test/r/innodb_mysql.result
+++ b/mysql-test/r/innodb_mysql.result
@@ -407,3 +407,49 @@ Warnings:
Warning 1071 Specified key was too long; max key length is 765 bytes
insert into t1 values('aaa');
drop table t1;
+CREATE TABLE `t2` (
+`k` int(11) NOT NULL auto_increment,
+`a` int(11) default NULL,
+`c` int(11) default NULL,
+PRIMARY KEY (`k`),
+UNIQUE KEY `idx_1` (`a`)
+) ENGINE=InnoDB;
+insert into t2 ( a ) values ( 6 ) on duplicate key update c =
+ifnull( c,
+0 ) + 1;
+insert into t2 ( a ) values ( 7 ) on duplicate key update c =
+ifnull( c,
+0 ) + 1;
+select last_insert_id();
+last_insert_id()
+2
+select * from t2;
+k a c
+1 6 NULL
+2 7 NULL
+insert into t2 ( a ) values ( 6 ) on duplicate key update c =
+ifnull( c,
+0 ) + 1;
+select last_insert_id();
+last_insert_id()
+1
+select * from t2;
+k a c
+1 6 1
+2 7 NULL
+insert ignore into t2 values (null,6,1),(10,8,1);
+select last_insert_id();
+last_insert_id()
+1
+insert ignore into t2 values (null,6,1),(null,8,1),(null,15,1),(null,20,1);
+select last_insert_id();
+last_insert_id()
+11
+select * from t2;
+k a c
+1 6 1
+2 7 NULL
+10 8 1
+11 15 1
+12 20 1
+drop table t2;
diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result
index ba4e9daf7cb..99633f5e12a 100644
--- a/mysql-test/r/mysql.result
+++ b/mysql-test/r/mysql.result
@@ -59,16 +59,16 @@ database()
test
unlock tables;
drop table t1;
-ソ
-ソ
+ƒ\
+ƒ\
c_cp932
+ƒ\
+ƒ\
+ƒ\
ソ
ソ
-ソ
-ソ
-ソ
-ソ
-ソ
+ƒ\
+ƒ\
+----------------------+------------+--------+
| concat('>',col1,'<') | col2 | col3 |
+----------------------+------------+--------+
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index 3b4f223afbf..1e1456bd81a 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -1404,92 +1404,6 @@ UNLOCK TABLES;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
DROP TABLE t1;
-create database db1;
-use db1;
-CREATE TABLE t2 (
-a varchar(30) default NULL,
-KEY a (a(5))
-);
-INSERT INTO t2 VALUES ('alfred');
-INSERT INTO t2 VALUES ('angie');
-INSERT INTO t2 VALUES ('bingo');
-INSERT INTO t2 VALUES ('waffle');
-INSERT INTO t2 VALUES ('lemon');
-create view v2 as select * from t2 where a like 'a%' with check option;
-
-/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
-/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
-/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
-/*!40101 SET NAMES utf8 */;
-/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
-/*!40103 SET TIME_ZONE='+00:00' */;
-/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
-/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
-/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
-DROP TABLE IF EXISTS `t2`;
-CREATE TABLE `t2` (
- `a` varchar(30) DEFAULT NULL,
- KEY `a` (`a`(5))
-) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-
-LOCK TABLES `t2` WRITE;
-/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
-INSERT INTO `t2` VALUES ('alfred'),('angie'),('bingo'),('waffle'),('lemon');
-/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
-UNLOCK TABLES;
-DROP TABLE IF EXISTS `v2`;
-/*!50001 DROP VIEW IF EXISTS `v2`*/;
-/*!50001 CREATE TABLE `v2` (
- `a` varchar(30)
-) */;
-/*!50001 DROP TABLE IF EXISTS `v2`*/;
-/*!50001 DROP VIEW IF EXISTS `v2`*/;
-/*!50001 CREATE ALGORITHM=UNDEFINED */
-/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
-/*!50001 VIEW `v2` AS select `t2`.`a` AS `a` from `t2` where (`t2`.`a` like _latin1'a%') */
-/*!50002 WITH CASCADED CHECK OPTION */;
-/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
-
-/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
-/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
-/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
-/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
-/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
-/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-
-drop table t2;
-drop view v2;
-drop database db1;
-create database db2;
-use db2;
-create table t1 (a int);
-create table t2 (a int, b varchar(10), primary key(a));
-insert into t2 values (1, "on"), (2, "off"), (10, "pol"), (12, "meg");
-insert into t1 values (289), (298), (234), (456), (789);
-create view v1 as select * from t2;
-create view v2 as select * from t1;
-drop table t1, t2;
-drop view v1, v2;
-drop database db2;
-create database db1;
-use db1;
-show tables;
-Tables_in_db1
-t1
-t2
-v1
-v2
-select * from t2 order by a;
-a b
-1 on
-2 off
-10 pol
-12 meg
-drop table t1, t2;
-drop database db1;
---fields-optionally-enclosed-by="
CREATE DATABASE mysqldump_test_db;
USE mysqldump_test_db;
CREATE TABLE t1 ( a INT );
@@ -1682,6 +1596,7 @@ select * from t1;
a b
Osnabrück Köln
drop table t1;
+--fields-optionally-enclosed-by="
create table `t1` (
t1_name varchar(255) default null,
t1_id int(10) unsigned not null auto_increment,
@@ -1756,8 +1671,9 @@ CREATE TABLE `t2` (
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
drop table t1, t2, t3;
-create table t1 (a binary(1), b blob);
-insert into t1 values ('','');
+create table t1 (a int);
+mysqldump: Couldn't execute 'SELECT /*!40001 SQL_NO_CACHE */ * FROM `t1` WHERE xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx': You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' at line 1 (1064)
+mysqldump: Got error: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' at line 1 when retrieving data from server
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
@@ -1771,15 +1687,9 @@ insert into t1 values ('','');
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
- `a` binary(1) DEFAULT NULL,
- `b` blob
+ `a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-LOCK TABLES `t1` WRITE;
-/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT INTO `t1` VALUES (0x00,'');
-/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
-UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@@ -1790,6 +1700,20 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+drop table t1;
+End of 4.1 tests
+create database db1;
+use db1;
+CREATE TABLE t2 (
+a varchar(30) default NULL,
+KEY a (a(5))
+);
+INSERT INTO t2 VALUES ('alfred');
+INSERT INTO t2 VALUES ('angie');
+INSERT INTO t2 VALUES ('bingo');
+INSERT INTO t2 VALUES ('waffle');
+INSERT INTO t2 VALUES ('lemon');
+create view v2 as select * from t2 where a like 'a%' with check option;
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
@@ -1801,17 +1725,28 @@ UNLOCK TABLES;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
-DROP TABLE IF EXISTS `t1`;
-CREATE TABLE `t1` (
- `a` binary(1) DEFAULT NULL,
- `b` blob
+DROP TABLE IF EXISTS `t2`;
+CREATE TABLE `t2` (
+ `a` varchar(30) DEFAULT NULL,
+ KEY `a` (`a`(5))
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-LOCK TABLES `t1` WRITE;
-/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT INTO `t1` VALUES (0x00,'');
-/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+LOCK TABLES `t2` WRITE;
+/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
+INSERT INTO `t2` VALUES ('alfred'),('angie'),('bingo'),('waffle'),('lemon');
+/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
UNLOCK TABLES;
+DROP TABLE IF EXISTS `v2`;
+/*!50001 DROP VIEW IF EXISTS `v2`*/;
+/*!50001 CREATE TABLE `v2` (
+ `a` varchar(30)
+) */;
+/*!50001 DROP TABLE IF EXISTS `v2`*/;
+/*!50001 DROP VIEW IF EXISTS `v2`*/;
+/*!50001 CREATE ALGORITHM=UNDEFINED */
+/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
+/*!50001 VIEW `v2` AS select `t2`.`a` AS `a` from `t2` where (`t2`.`a` like _latin1'a%') */
+/*!50002 WITH CASCADED CHECK OPTION */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@@ -1822,7 +1757,39 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-drop table t1;
+drop table t2;
+drop view v2;
+drop database db1;
+use test;
+create database db2;
+use db2;
+create table t1 (a int);
+create table t2 (a int, b varchar(10), primary key(a));
+insert into t2 values (1, "on"), (2, "off"), (10, "pol"), (12, "meg");
+insert into t1 values (289), (298), (234), (456), (789);
+create view v1 as select * from t2;
+create view v2 as select * from t1;
+drop table t1, t2;
+drop view v1, v2;
+drop database db2;
+use test;
+create database db1;
+use db1;
+show tables;
+Tables_in_db1
+t1
+t2
+v1
+v2
+select * from t2 order by a;
+a b
+1 on
+2 off
+10 pol
+12 meg
+drop table t1, t2;
+drop database db1;
+use test;
create table t1(a int);
create view v1 as select * from t1;
@@ -2605,11 +2572,15 @@ drop view v2;
drop view v0;
drop view v1;
drop table t1;
-drop table if exists t1;
-CREATE TABLE t1(a int, b int);
-INSERT INTO t1 VALUES (1,1);
-INSERT INTO t1 VALUES (2,3);
-INSERT INTO t1 VALUES (3,4), (4,5);
+SET @old_sql_mode = @@SQL_MODE;
+SET SQL_MODE = IGNORE_SPACE;
+CREATE TABLE t1 (a INT);
+CREATE TRIGGER tr1 BEFORE INSERT ON t1
+FOR EACH ROW
+BEGIN
+SET new.a = 0;
+END|
+SET SQL_MODE = @old_sql_mode;
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
@@ -2621,17 +2592,29 @@ INSERT INTO t1 VALUES (3,4), (4,5);
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */;
+
+USE `test`;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
- `a` int(11) DEFAULT NULL,
- `b` int(11) DEFAULT NULL
+ `a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-REPLACE INTO `t1` VALUES (1,1),(2,3),(3,4),(4,5);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
+
+/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;
+DELIMITER ;;
+/*!50003 SET SESSION SQL_MODE="IGNORE_SPACE" */;;
+/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `tr1` BEFORE INSERT ON `t1` FOR EACH ROW BEGIN
+SET new.a = 0;
+END */;;
+
+DELIMITER ;
+/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@@ -2642,16 +2625,10 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+DROP TRIGGER tr1;
DROP TABLE t1;
-SET @old_sql_mode = @@SQL_MODE;
-SET SQL_MODE = IGNORE_SPACE;
-CREATE TABLE t1 (a INT);
-CREATE TRIGGER tr1 BEFORE INSERT ON t1
-FOR EACH ROW
-BEGIN
-SET new.a = 0;
-END|
-SET SQL_MODE = @old_sql_mode;
+create table t1 (a binary(1), b blob);
+insert into t1 values ('','');
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
@@ -2663,29 +2640,49 @@ SET SQL_MODE = @old_sql_mode;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
-
-CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */;
-
-USE `test`;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
- `a` int(11) DEFAULT NULL
+ `a` binary(1) DEFAULT NULL,
+ `b` blob
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
+INSERT INTO `t1` VALUES (0x00,'');
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
-/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;
-DELIMITER ;;
-/*!50003 SET SESSION SQL_MODE="IGNORE_SPACE" */;;
-/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `tr1` BEFORE INSERT ON `t1` FOR EACH ROW BEGIN
-SET new.a = 0;
-END */;;
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-DELIMITER ;
-/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */;
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+DROP TABLE IF EXISTS `t1`;
+CREATE TABLE `t1` (
+ `a` binary(1) DEFAULT NULL,
+ `b` blob
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+LOCK TABLES `t1` WRITE;
+/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
+INSERT INTO `t1` VALUES (0x00,'');
+/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@@ -2696,9 +2693,7 @@ DELIMITER ;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-DROP TRIGGER tr1;
-DROP TABLE t1;
-End of 4.1 tests
+drop table t1;
create table t1 (a int);
insert into t1 values (289), (298), (234), (456), (789);
create definer = CURRENT_USER view v1 as select * from t1;
@@ -2925,7 +2920,60 @@ mysqldump: Couldn't execute 'SHOW MASTER STATUS': Access denied; you need the SU
grant REPLICATION CLIENT on *.* to mysqltest_1@localhost;
drop table t1;
drop user mysqltest_1@localhost;
+create database mysqldump_myDB;
+use mysqldump_myDB;
+create user myDB_User;
+grant create view, select on mysqldump_myDB.* to myDB_User@localhost;
+create table t1 (c1 int);
+insert into t1 values (3);
+use mysqldump_myDB;
+create view v1 (c1) as select * from t1;
+use mysqldump_myDB;
+drop view v1;
+drop table t1;
+revoke all privileges on mysqldump_myDB.* from myDB_User@localhost;
+drop user myDB_User;
+drop database mysqldump_myDB;
+use test;
End of 5.0 tests
+drop table if exists t1;
+CREATE TABLE t1(a int, b int);
+INSERT INTO t1 VALUES (1,1);
+INSERT INTO t1 VALUES (2,3);
+INSERT INTO t1 VALUES (3,4), (4,5);
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+DROP TABLE IF EXISTS `t1`;
+CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+LOCK TABLES `t1` WRITE;
+/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
+REPLACE INTO `t1` VALUES (1,1),(2,3),(3,4),(4,5);
+/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+UNLOCK TABLES;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+DROP TABLE t1;
create table t1 (a text , b text);
create table t2 (a text , b text);
insert t1 values ("Duck, Duck", "goose");
diff --git a/mysql-test/r/ndb_dd_advance.result b/mysql-test/r/ndb_dd_advance.result
index 09fe75805d5..64c30aab9ab 100644
--- a/mysql-test/r/ndb_dd_advance.result
+++ b/mysql-test/r/ndb_dd_advance.result
@@ -226,7 +226,7 @@ t1 CREATE TABLE `t1` (
`b` int(11) NOT NULL,
`c` int(11) NOT NULL,
PRIMARY KEY (`pk1`)
-) TABLESPACE table_space1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1
+) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
ALTER TABLE test.t2 TABLESPACE table_space1 STORAGE DISK
ENGINE=NDB;
SHOW CREATE TABLE test.t2;
@@ -236,7 +236,7 @@ t2 CREATE TABLE `t2` (
`b2` int(11) NOT NULL,
`c2` int(11) NOT NULL,
PRIMARY KEY (`pk2`)
-) TABLESPACE table_space1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1
+) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
ALTER TABLE test.t1 ENGINE=NDBCLUSTER;
SHOW CREATE TABLE test.t1;
Table Create Table
@@ -331,7 +331,7 @@ t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
-) TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
@@ -931,7 +931,7 @@ t1 CREATE TABLE `t1` (
`a1` int(11) DEFAULT NULL,
`a2` blob,
`a3` text
-) TABLESPACE ts STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1
+) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
DROP TABLE test.t1;
CREATE TABLE test.t1 (a1 INT, a2 BLOB, a3 TEXT) ENGINE=MyISAM;
SHOW CREATE TABLE test.t1;
@@ -950,7 +950,7 @@ t1 CREATE TABLE `t1` (
`a1` int(11) DEFAULT NULL,
`a2` blob,
`a3` text
-) TABLESPACE ts STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1
+) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
DROP TABLE test.t1;
CREATE TABLE test.t1 (a1 INT PRIMARY KEY, a2 BLOB, a3 TEXT) TABLESPACE ts STORAGE DISK ENGINE=NDB;
SHOW CREATE TABLE test.t1;
@@ -960,7 +960,7 @@ t1 CREATE TABLE `t1` (
`a2` blob,
`a3` text,
PRIMARY KEY (`a1`)
-) TABLESPACE ts STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1
+) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
ALTER TABLE test.t1 ENGINE=InnoDB;
SHOW CREATE TABLE test.t1;
Table Create Table
@@ -980,7 +980,7 @@ t1 CREATE TABLE `t1` (
`a1` int(11) DEFAULT NULL,
`a2` blob,
`a3` text
-) TABLESPACE ts STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1
+) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
ALTER TABLE test.t1 ENGINE=MyISAM;
SHOW CREATE TABLE test.t1;
Table Create Table
diff --git a/mysql-test/r/ndb_dd_advance2.result b/mysql-test/r/ndb_dd_advance2.result
index c7fcda650e6..86dc8df3b15 100644
--- a/mysql-test/r/ndb_dd_advance2.result
+++ b/mysql-test/r/ndb_dd_advance2.result
@@ -30,7 +30,7 @@ t1 CREATE TABLE `t1` (
`a2` varchar(256) DEFAULT NULL,
`a3` blob,
PRIMARY KEY (`a1`)
-) TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
SHOW CREATE TABLE test.t2;
Table Create Table
t2 CREATE TABLE `t2` (
@@ -38,7 +38,7 @@ t2 CREATE TABLE `t2` (
`a2` varchar(256) DEFAULT NULL,
`a3` blob,
PRIMARY KEY (`a1`)
-) TABLESPACE ts2 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1
+) /*!50100 TABLESPACE ts2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
INSERT INTO test.t1 VALUES (1,'111111','aaaaaaaa');
INSERT INTO test.t1 VALUES (2,'222222','bbbbbbbb');
SELECT * FROM test.t1 ORDER BY a1;
@@ -93,7 +93,7 @@ t1 CREATE TABLE `t1` (
`a2` varchar(5000) DEFAULT NULL,
`a3` blob,
PRIMARY KEY (`a1`)
-) TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
SHOW CREATE TABLE test.t2;
Table Create Table
t2 CREATE TABLE `t2` (
@@ -101,7 +101,7 @@ t2 CREATE TABLE `t2` (
`a2` varchar(5000) DEFAULT NULL,
`a3` blob,
PRIMARY KEY (`a1`)
-) TABLESPACE ts2 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1
+) /*!50100 TABLESPACE ts2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
INSERT INTO test.t1 VALUES (1,@vc1,@d1);
INSERT INTO test.t1 VALUES (2,@vc2,@b1);
INSERT INTO test.t1 VALUES (3,@vc3,@d2);
diff --git a/mysql-test/r/ndb_dd_backuprestore.result b/mysql-test/r/ndb_dd_backuprestore.result
index 705881ee20a..3c0815cbec8 100644
--- a/mysql-test/r/ndb_dd_backuprestore.result
+++ b/mysql-test/r/ndb_dd_backuprestore.result
@@ -175,7 +175,7 @@ t1 CREATE TABLE `t1` (
`c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`)
-) TABLESPACE table_space1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 4 */
+) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 4 */
SHOW CREATE TABLE test.t2;
Table Create Table
t2 CREATE TABLE `t2` (
@@ -184,7 +184,7 @@ t2 CREATE TABLE `t2` (
`c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`)
-) TABLESPACE table_space2 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
+) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
SHOW CREATE TABLE test.t3;
Table Create Table
t3 CREATE TABLE `t3` (
@@ -193,7 +193,7 @@ t3 CREATE TABLE `t3` (
`c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`)
-) TABLESPACE table_space2 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */
+) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */
SHOW CREATE TABLE test.t4;
Table Create Table
t4 CREATE TABLE `t4` (
@@ -341,7 +341,7 @@ t1 CREATE TABLE `t1` (
`c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`)
-) TABLESPACE table_space1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 4 */
+) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 4 */
SHOW CREATE TABLE test.t2;
Table Create Table
t2 CREATE TABLE `t2` (
@@ -350,7 +350,7 @@ t2 CREATE TABLE `t2` (
`c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`)
-) TABLESPACE table_space2 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
+) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
SHOW CREATE TABLE test.t3;
Table Create Table
t3 CREATE TABLE `t3` (
@@ -359,7 +359,7 @@ t3 CREATE TABLE `t3` (
`c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`)
-) TABLESPACE table_space2 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */
+) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */
SHOW CREATE TABLE test.t4;
Table Create Table
t4 CREATE TABLE `t4` (
diff --git a/mysql-test/r/ndb_dd_basic.result b/mysql-test/r/ndb_dd_basic.result
index 6c10fbe63b3..5a7e70e796d 100644
--- a/mysql-test/r/ndb_dd_basic.result
+++ b/mysql-test/r/ndb_dd_basic.result
@@ -49,7 +49,7 @@ t1 CREATE TABLE `t1` (
`b` int(11) NOT NULL,
`c` int(11) NOT NULL,
PRIMARY KEY (`pk1`)
-) TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1
+) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (0, 0, 0);
SELECT * FROM t1;
pk1 b c
diff --git a/mysql-test/r/ndb_dd_disk2memory.result b/mysql-test/r/ndb_dd_disk2memory.result
index bd5bbda42f3..9084ddc3e16 100644
--- a/mysql-test/r/ndb_dd_disk2memory.result
+++ b/mysql-test/r/ndb_dd_disk2memory.result
@@ -226,7 +226,7 @@ t1 CREATE TABLE `t1` (
`b` int(11) NOT NULL,
`c` int(11) NOT NULL,
PRIMARY KEY (`pk1`)
-) TABLESPACE table_space1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1
+) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
ALTER TABLE test.t2 TABLESPACE table_space1 STORAGE DISK
ENGINE=NDB;
SHOW CREATE TABLE test.t2;
@@ -236,7 +236,7 @@ t2 CREATE TABLE `t2` (
`b2` int(11) NOT NULL,
`c2` int(11) NOT NULL,
PRIMARY KEY (`pk2`)
-) TABLESPACE table_space1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1
+) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
ALTER TABLE test.t1 ENGINE=NDBCLUSTER;
SHOW CREATE TABLE test.t1;
Table Create Table
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result
index 2e2af07bfdc..d8d433ef216 100644
--- a/mysql-test/r/partition.result
+++ b/mysql-test/r/partition.result
@@ -1134,12 +1134,12 @@ partition by range (a)
subpartition by hash (a)
(partition p0 VALUES LESS THAN (1) DATA DIRECTORY = 'hello/master-data/tmpdata' INDEX DIRECTORY = 'hello/master-data/tmpinx'
(SUBPARTITION subpart00, SUBPARTITION subpart01));
+hello/master-data/test/t1.frm
+hello/master-data/test/t1.par
hello/master-data/test/t1#P#p0#SP#subpart00.MYD
hello/master-data/test/t1#P#p0#SP#subpart00.MYI
hello/master-data/test/t1#P#p0#SP#subpart01.MYD
hello/master-data/test/t1#P#p0#SP#subpart01.MYI
-hello/master-data/test/t1.frm
-hello/master-data/test/t1.par
hello/master-data/tmpdata/t1#P#p0#SP#subpart00.MYD
hello/master-data/tmpdata/t1#P#p0#SP#subpart01.MYD
hello/master-data/tmpinx/t1#P#p0#SP#subpart00.MYI
@@ -1149,6 +1149,8 @@ ALTER TABLE t1 REORGANIZE PARTITION p0 INTO
(SUBPARTITION subpart10, SUBPARTITION subpart11),
partition p2 VALUES LESS THAN (2) DATA DIRECTORY = 'hello/master-data/tmpdata' INDEX DIRECTORY = 'hello/master-data/tmpinx'
(SUBPARTITION subpart20, SUBPARTITION subpart21));
+hello/master-data/test/t1.frm
+hello/master-data/test/t1.par
hello/master-data/test/t1#P#p1#SP#subpart10.MYD
hello/master-data/test/t1#P#p1#SP#subpart10.MYI
hello/master-data/test/t1#P#p1#SP#subpart11.MYD
@@ -1157,8 +1159,6 @@ hello/master-data/test/t1#P#p2#SP#subpart20.MYD
hello/master-data/test/t1#P#p2#SP#subpart20.MYI
hello/master-data/test/t1#P#p2#SP#subpart21.MYD
hello/master-data/test/t1#P#p2#SP#subpart21.MYI
-hello/master-data/test/t1.frm
-hello/master-data/test/t1.par
hello/master-data/tmpdata/t1#P#p1#SP#subpart10.MYD
hello/master-data/tmpdata/t1#P#p1#SP#subpart11.MYD
hello/master-data/tmpdata/t1#P#p2#SP#subpart20.MYD
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index 3b6bfc60a80..b55d8d9ef5a 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -689,6 +689,12 @@ select @@log_queries_not_using_indexes;
show variables like 'log_queries_not_using_indexes';
Variable_name Value
log_queries_not_using_indexes OFF
+select @@"";
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '""' at line 1
+select @@&;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '&' at line 1
+select @@@;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@' at line 1
End of 5.0 tests
set global binlog_cache_size =@my_binlog_cache_size;
set global connect_timeout =@my_connect_timeout;
diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test
index 7cef1bad784..f869dc06187 100644
--- a/mysql-test/t/auto_increment.test
+++ b/mysql-test/t/auto_increment.test
@@ -304,42 +304,6 @@ INSERT INTO t1 VALUES(1, 1);
ALTER TABLE t1 CHANGE t1 t1 INT(10) auto_increment;
DROP TABLE t1;
-# Fix for BUG#19243 "wrong LAST_INSERT_ID() after ON DUPLICATE KEY
-# UPDATE": now LAST_INSERT_ID() will return the id of the updated
-# row.
-CREATE TABLE `t2` (
- `k` int(11) NOT NULL auto_increment,
- `a` int(11) default NULL,
- `c` int(11) default NULL,
- PRIMARY KEY (`k`),
- UNIQUE KEY `idx_1` (`a`)
-) ENGINE=InnoDB;
- insert into t2 ( a ) values ( 6 ) on duplicate key update c =
-ifnull( c,
-0 ) + 1;
-insert into t2 ( a ) values ( 7 ) on duplicate key update c =
-ifnull( c,
-0 ) + 1;
-select last_insert_id();
-select * from t2;
-insert into t2 ( a ) values ( 6 ) on duplicate key update c =
-ifnull( c,
-0 ) + 1;
-select last_insert_id();
-select * from t2;
-
-# Test of LAST_INSERT_ID() when autogenerated will fail:
-# last_insert_id() should not change
-insert ignore into t2 values (null,6,1),(10,8,1);
-select last_insert_id();
-# First and second autogenerated will fail, last_insert_id() should
-# point to third
-insert ignore into t2 values (null,6,1),(null,8,1),(null,15,1),(null,20,1);
-select last_insert_id();
-select * from t2;
-
-drop table t2;
-
# Test of REPLACE when it does INSERT+DELETE and not UPDATE:
# see if it sets LAST_INSERT_ID() ok
create table t1 (a int primary key auto_increment, b int, c int, d timestamp default current_timestamp, unique(b),unique(c));
diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test
index eea0b06b224..3690ac958a2 100644
--- a/mysql-test/t/ctype_ucs.test
+++ b/mysql-test/t/ctype_ucs.test
@@ -465,7 +465,46 @@ INSERT INTO t1 VALUES (1, 'ZZZZZ'), (1, 'ZZZ'), (2, 'ZZZ'), (2, 'ZZZZZ');
SELECT id, MIN(s) FROM t1 GROUP BY id;
DROP TABLE t1;
-# End of 4.1 tests
+
+#
+# Bug #20536: md5() with GROUP BY and UCS2 return different results on myisam/innodb
+#
+
+--disable_warnings
+drop table if exists bug20536;
+--enable_warnings
+
+set names latin1;
+create table bug20536 (id bigint not null auto_increment primary key, name
+varchar(255) character set ucs2 not null);
+insert into `bug20536` (`id`,`name`) values (1, _latin1 x'7465737431'), (2, "'test\\_2'");
+select md5(name) from bug20536;
+select sha1(name) from bug20536;
+select make_set(3, name, upper(name)) from bug20536;
+select export_set(5, name, upper(name)) from bug20536;
+select export_set(5, name, upper(name), ",", 5) from bug20536;
+
+# Some broken functions: add these tests just to document current behavior.
+
+# PASSWORD and OLD_PASSWORD don't work with UCS2 strings, but to fix it would
+# not be backwards compatible in all cases, so it's best to leave it alone
+select password(name) from bug20536;
+select old_password(name) from bug20536;
+
+# ENCRYPT relies on OS function crypt() which takes a NUL-terminated string; it
+# doesn't return good results for strings with embedded 0 bytes. It won't be
+# fixed unless we choose to re-implement the crypt() function ourselves to take
+# an extra size_t string_length argument.
+select encrypt(name, 'SALT') from bug20536;
+
+# QUOTE doesn't work with UCS2 data. It would require a total rewrite
+# of Item_func_quote::val_str(), which isn't worthwhile until UCS2 is
+# supported fully as a client character set.
+select quote(name) from bug20536;
+
+drop table bug20536;
+
+--echo End of 4.1 tests
#
# Conversion from an UCS2 string to a decimal column
@@ -497,3 +536,5 @@ create table t1(a blob, b text charset utf8, c text charset ucs2);
select data_type, character_octet_length, character_maximum_length
from information_schema.columns where table_name='t1';
drop table t1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index f37ceb10e37..6d58f1a22f9 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -31,7 +31,6 @@ rpl_ndb_innodb2ndb : Bug #19710 Cluster replication to partition table fa
#rpl_ndb_log : BUG#18947 2006-03-21 tomas CRBR: order in binlog of create table and insert (on different table) not determ
rpl_ndb_myisam2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement
rpl_row_blob_innodb : BUG#18980 2006-04-10 kent Test fails randomly
-rpl_row_func003 : BUG#19074 2006-13-04 andrei test failed
rpl_sp : BUG#16456 2006-02-16 jmiller
rpl_sp_effects : BUG#19862 2006-06-15 mkindahl
diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test
index 0475dd4bdb6..52a5512d070 100644
--- a/mysql-test/t/func_misc.test
+++ b/mysql-test/t/func_misc.test
@@ -78,7 +78,13 @@ connection default;
DROP TABLE t1;
-# End of 4.1 tests
+#
+# Bug #21531: EXPORT_SET() doesn't accept args with coercible character sets
+#
+select export_set(3, _latin1'foo', _utf8'bar', ',', 4);
+
+--echo End of 4.1 tests
+
#
# Test for BUG#9535
@@ -87,7 +93,9 @@ create table t1 as select uuid(), length(uuid());
show create table t1;
drop table t1;
+#
# Bug #6760: Add SLEEP() function
+#
create table t1 (a timestamp default '2005-05-05 01:01:01',
b timestamp default '2005-05-05 01:01:01');
insert into t1 set a = now();
@@ -117,4 +125,4 @@ drop table t2;
drop table t1;
set global query_cache_size=default;
-# End of 5.0 tests
+--echo End of 5.0 tests
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index d00c5499ef9..1a2afad3b44 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -904,14 +904,6 @@ insert into t2 (a) select b from t1;
insert into t1 (a) select b from t2;
insert into t2 (a) select b from t1;
insert into t1 (a) select b from t2;
-insert into t2 (a) select b from t1;
-insert into t1 (a) select b from t2;
-insert into t2 (a) select b from t1;
-insert into t1 (a) select b from t2;
-insert into t2 (a) select b from t1;
-insert into t1 (a) select b from t2;
-insert into t2 (a) select b from t1;
-insert into t1 (a) select b from t2;
select count(*) from t1;
--replace_column 9 #
explain select * from t1 where c between 1 and 2500;
diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test
index 58557507d9b..d61509317ca 100644
--- a/mysql-test/t/innodb_mysql.test
+++ b/mysql-test/t/innodb_mysql.test
@@ -367,3 +367,40 @@ create table t1(f1 varchar(800) binary not null, key(f1)) engine = innodb
character set utf8 collate utf8_general_ci;
insert into t1 values('aaa');
drop table t1;
+
+# Fix for BUG#19243 "wrong LAST_INSERT_ID() after ON DUPLICATE KEY
+# UPDATE": now LAST_INSERT_ID() will return the id of the updated
+# row.
+CREATE TABLE `t2` (
+ `k` int(11) NOT NULL auto_increment,
+ `a` int(11) default NULL,
+ `c` int(11) default NULL,
+ PRIMARY KEY (`k`),
+ UNIQUE KEY `idx_1` (`a`)
+) ENGINE=InnoDB;
+ insert into t2 ( a ) values ( 6 ) on duplicate key update c =
+ifnull( c,
+0 ) + 1;
+insert into t2 ( a ) values ( 7 ) on duplicate key update c =
+ifnull( c,
+0 ) + 1;
+select last_insert_id();
+select * from t2;
+insert into t2 ( a ) values ( 6 ) on duplicate key update c =
+ifnull( c,
+0 ) + 1;
+select last_insert_id();
+select * from t2;
+
+# Test of LAST_INSERT_ID() when autogenerated will fail:
+# last_insert_id() should not change
+insert ignore into t2 values (null,6,1),(10,8,1);
+select last_insert_id();
+# First and second autogenerated will fail, last_insert_id() should
+# point to third
+insert ignore into t2 values (null,6,1),(null,8,1),(null,15,1),(null,20,1);
+select last_insert_id();
+select * from t2;
+
+drop table t2;
+
diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test
index 385c59d1503..cf4e6f4047c 100644
--- a/mysql-test/t/mysql.test
+++ b/mysql-test/t/mysql.test
@@ -52,8 +52,8 @@ drop table t1;
--exec $MYSQL --default-character-set=cp932 test -e "charset utf8;"
# its usage to switch internally in mysql to requested charset
---exec $MYSQL --default-character-set=utf8 test -e "charset cp932; set @@session.character_set_client= cp932; select 'ƒ\'; create table t1 (c_cp932 TEXT CHARACTER SET cp932); insert into t1 values('ƒ\'); select * from t1; drop table t1;"
---exec $MYSQL --default-character-set=utf8 test -e "charset cp932; set character_set_client= cp932; select 'ƒ\'"
+--exec $MYSQL --default-character-set=utf8 test -e "charset cp932; select 'ƒ\'; create table t1 (c_cp932 TEXT CHARACTER SET cp932); insert into t1 values('ƒ\'); select * from t1; drop table t1;"
+--exec $MYSQL --default-character-set=utf8 test -e "charset cp932; select 'ƒ\'"
--exec $MYSQL --default-character-set=utf8 test -e "/*charset cp932 */; set character_set_client= cp932; select 'ƒ\'"
--exec $MYSQL --default-character-set=utf8 test -e "/*!\C cp932 */; set character_set_client= cp932; select 'ƒ\'"
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index 1f31c84ba68..f66b07d66ba 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -548,71 +548,6 @@ INSERT INTO t1 VALUES (1),(2),(3);
--exec $MYSQL_DUMP --add-drop-database --skip-comments --databases test
DROP TABLE t1;
-
-#
-# Bug #10213 mysqldump crashes when dumping VIEWs(on MacOS X)
-#
-
-create database db1;
-use db1;
-
-CREATE TABLE t2 (
- a varchar(30) default NULL,
- KEY a (a(5))
-);
-
-INSERT INTO t2 VALUES ('alfred');
-INSERT INTO t2 VALUES ('angie');
-INSERT INTO t2 VALUES ('bingo');
-INSERT INTO t2 VALUES ('waffle');
-INSERT INTO t2 VALUES ('lemon');
-create view v2 as select * from t2 where a like 'a%' with check option;
---exec $MYSQL_DUMP --skip-comments db1
-drop table t2;
-drop view v2;
-drop database db1;
-
-#
-# Bug 10713 mysqldump includes database in create view and referenced tables
-#
-
-# create table and views in db2
-create database db2;
-use db2;
-create table t1 (a int);
-create table t2 (a int, b varchar(10), primary key(a));
-insert into t2 values (1, "on"), (2, "off"), (10, "pol"), (12, "meg");
-insert into t1 values (289), (298), (234), (456), (789);
-create view v1 as select * from t2;
-create view v2 as select * from t1;
-
-# dump tables and view from db2
---exec $MYSQL_DUMP db2 > $MYSQLTEST_VARDIR/tmp/bug10713.sql
-
-# drop the db, tables and views
-drop table t1, t2;
-drop view v1, v2;
-drop database db2;
-
-# create db1 and reload dump
-create database db1;
-use db1;
---exec $MYSQL db1 < $MYSQLTEST_VARDIR/tmp/bug10713.sql
-
-# check that all tables and views could be created
-show tables;
-select * from t2 order by a;
-
-drop table t1, t2;
-drop database db1;
-
-#
-# BUG#15328 Segmentation fault occured if my.cnf is invalid for escape sequence
-#
-
---exec $MYSQL_MY_PRINT_DEFAULTS --defaults-file=$MYSQL_TEST_DIR/std_data/bug15328.cnf mysqldump
-
-
#
# Bug #9558 mysqldump --no-data db t1 t2 format still dumps data
#
@@ -720,6 +655,12 @@ select * from t1;
drop table t1;
#
+# BUG#15328 Segmentation fault occured if my.cnf is invalid for escape sequence
+#
+
+--exec $MYSQL_MY_PRINT_DEFAULTS --config-file=$MYSQL_TEST_DIR/std_data/bug15328.cnf mysqldump
+
+#
# BUG #19025 mysqldump doesn't correctly dump "auto_increment = [int]"
#
create table `t1` (
@@ -760,14 +701,74 @@ create table t3(a int);
drop table t1, t2, t3;
#
-# Bug #13318: Bad result with empty field and --hex-blob
-#
-create table t1 (a binary(1), b blob);
-insert into t1 values ('','');
---exec $MYSQL_DUMP --skip-comments --skip-extended-insert --hex-blob test t1
---exec $MYSQL_DUMP --skip-comments --hex-blob test t1
+# Bug #21288: mysqldump segmentation fault when using --where
+#
+create table t1 (a int);
+--error 2
+--exec $MYSQL_DUMP --skip-comments --force test t1 --where='xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' 2>&1
drop table t1;
+--echo End of 4.1 tests
+
+#
+# Bug #10213 mysqldump crashes when dumping VIEWs(on MacOS X)
+#
+
+create database db1;
+use db1;
+
+CREATE TABLE t2 (
+ a varchar(30) default NULL,
+ KEY a (a(5))
+);
+
+INSERT INTO t2 VALUES ('alfred');
+INSERT INTO t2 VALUES ('angie');
+INSERT INTO t2 VALUES ('bingo');
+INSERT INTO t2 VALUES ('waffle');
+INSERT INTO t2 VALUES ('lemon');
+create view v2 as select * from t2 where a like 'a%' with check option;
+--exec $MYSQL_DUMP --skip-comments db1
+drop table t2;
+drop view v2;
+drop database db1;
+use test;
+
+#
+# Bug 10713 mysqldump includes database in create view and referenced tables
+#
+
+# create table and views in db2
+create database db2;
+use db2;
+create table t1 (a int);
+create table t2 (a int, b varchar(10), primary key(a));
+insert into t2 values (1, "on"), (2, "off"), (10, "pol"), (12, "meg");
+insert into t1 values (289), (298), (234), (456), (789);
+create view v1 as select * from t2;
+create view v2 as select * from t1;
+
+# dump tables and view from db2
+--exec $MYSQL_DUMP db2 > $MYSQLTEST_VARDIR/tmp/bug10713.sql
+
+# drop the db, tables and views
+drop table t1, t2;
+drop view v1, v2;
+drop database db2;
+use test;
+
+# create db1 and reload dump
+create database db1;
+use db1;
+--exec $MYSQL db1 < $MYSQLTEST_VARDIR/tmp/bug10713.sql
+
+# check that all tables and views could be created
+show tables;
+select * from t2 order by a;
+
+drop table t1, t2;
+drop database db1;
+use test;
#
# dump of view
@@ -832,6 +833,7 @@ select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1;
drop view v1, v2, v3;
drop table t1;
+
#
# Test for dumping triggers
#
@@ -1057,20 +1059,6 @@ drop view v0;
drop view v1;
drop table t1;
-# Check new --replace option
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-CREATE TABLE t1(a int, b int);
-INSERT INTO t1 VALUES (1,1);
-INSERT INTO t1 VALUES (2,3);
-INSERT INTO t1 VALUES (3,4), (4,5);
---exec $MYSQL_DUMP --replace --skip-comments test t1
-DROP TABLE t1;
-
-
#
# BUG#14554 - mysqldump does not separate words "ROW" and "BEGIN"
# for tables with trigger created in the IGNORE_SPACE sql mode.
@@ -1095,7 +1083,14 @@ SET SQL_MODE = @old_sql_mode;
DROP TRIGGER tr1;
DROP TABLE t1;
---echo End of 4.1 tests
+#
+# Bug #13318: Bad result with empty field and --hex-blob
+#
+create table t1 (a binary(1), b blob);
+insert into t1 values ('','');
+--exec $MYSQL_DUMP --skip-comments --skip-extended-insert --hex-blob test t1
+--exec $MYSQL_DUMP --skip-comments --hex-blob test t1
+drop table t1;
#
# Bug 14871 Invalid view dump output
@@ -1126,7 +1121,6 @@ select * from v3 order by a;
drop table t1;
drop view v1, v2, v3, v4, v5;
-
#
# Bug #16878 dump of trigger
#
@@ -1281,10 +1275,11 @@ use mysqldump_dbb;
drop view v1;
drop table t1;
drop database mysqldump_dbb;
+use test;
+
#
# Bug#21215 mysqldump creating incomplete backups without warning
#
-use test;
# Create user without sufficient privs to perform the requested operation
create user mysqltest_1@localhost;
@@ -1326,8 +1321,52 @@ grant REPLICATION CLIENT on *.* to mysqltest_1@localhost;
drop table t1;
drop user mysqltest_1@localhost;
+#
+# Bug #21527 mysqldump incorrectly tries to LOCK TABLES on the
+# information_schema database.
+#
+connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
+connection root;
+create database mysqldump_myDB;
+use mysqldump_myDB;
+create user myDB_User;
+grant create view, select on mysqldump_myDB.* to myDB_User@localhost;
+create table t1 (c1 int);
+insert into t1 values (3);
+
+connect (user1,localhost,myDB_User,,mysqldump_myDB,$MASTER_MYPORT,$MASTER_MYSOCK);
+connection user1;
+use mysqldump_myDB;
+create view v1 (c1) as select * from t1;
+
+# Backup should not fail.
+--exec $MYSQL_DUMP --all-databases --add-drop-table > $MYSQLTEST_VARDIR/tmp/bug21527.sql
+
+# Clean up
+connection root;
+use mysqldump_myDB;
+drop view v1;
+drop table t1;
+revoke all privileges on mysqldump_myDB.* from myDB_User@localhost;
+drop user myDB_User;
+drop database mysqldump_myDB;
+use test;
+
--echo End of 5.0 tests
+# Check new --replace option
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+CREATE TABLE t1(a int, b int);
+INSERT INTO t1 VALUES (1,1);
+INSERT INTO t1 VALUES (2,3);
+INSERT INTO t1 VALUES (3,4), (4,5);
+--exec $MYSQL_DUMP --replace --skip-comments test t1
+DROP TABLE t1;
+
#
# Added for use-thread option
#
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index 771a4ad3ed3..9985ed4f7f5 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -585,6 +585,16 @@ show variables like 'ssl%';
select @@log_queries_not_using_indexes;
show variables like 'log_queries_not_using_indexes';
+#
+# Bug#20908: Crash if select @@""
+#
+--error ER_PARSE_ERROR
+select @@"";
+--error ER_PARSE_ERROR
+select @@&;
+--error ER_PARSE_ERROR
+select @@@;
+
--echo End of 5.0 tests
# This is at the very after the versioned tests, since it involves doing
@@ -620,3 +630,4 @@ set global server_id =@my_server_id;
set global slow_launch_time =@my_slow_launch_time;
set global storage_engine =@my_storage_engine;
set global thread_cache_size =@my_thread_cache_size;
+