diff options
author | unknown <msvensson@shellback.(none)> | 2006-09-01 11:23:08 +0200 |
---|---|---|
committer | unknown <msvensson@shellback.(none)> | 2006-09-01 11:23:08 +0200 |
commit | 4991cc07e5ec7a982145fa74539977bcedb0af30 (patch) | |
tree | f8c7e6cc8b0bf666906a0c4e12e7ac8ba06ba7cb /mysql-test | |
parent | 22d76f5a5520f384985e7de1dc30b2c3cd4d0feb (diff) | |
parent | 5d58edf00ffb3ebdb857dfe3d07e6aff0343b0ed (diff) | |
download | mariadb-git-4991cc07e5ec7a982145fa74539977bcedb0af30.tar.gz |
Merge shellback.(none):/home/msvensson/mysql/mysql-5.1
into shellback.(none):/home/msvensson/mysql/mysql-5.1-new-maint
configure.in:
Auto merged
include/mysql_com.h:
Auto merged
mysql-test/lib/mtr_process.pl:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/grant.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/grant.test:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/item_strfunc.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_show.cc:
Auto merged
Diffstat (limited to 'mysql-test')
26 files changed, 655 insertions, 362 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..daed111dfce 100644 --- a/mysql-test/lib/mtr_cases.pl +++ b/mysql-test/lib/mtr_cases.pl @@ -469,14 +469,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..ac9872ac2ab 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= 1; 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/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/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..eb26b0324e7 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -2925,7 +2925,22 @@ 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; End of 5.0 tests +use test; 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/openssl_1.result b/mysql-test/r/openssl_1.result index 1fcfb11525e..8f9fd50eced 100644 --- a/mysql-test/r/openssl_1.result +++ b/mysql-test/r/openssl_1.result @@ -3,9 +3,12 @@ create table t1(f1 int); insert into t1 values (5); grant select on test.* to ssl_user1@localhost require SSL; grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA"; -grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/emailAddress=abstract.mysql.developer@mysql.com"; -grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/emailAddress=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/emailAddress=abstract.mysql.developer@mysql.com"; +grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB"; +grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB" ISSUER "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB"; +grant select on test.* to ssl_user5@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "xxx"; flush privileges; +connect(localhost,ssl_user5,,test,MASTER_PORT,MASTER_SOCKET); +ERROR 28000: Access denied for user 'ssl_user5'@'localhost' (using password: NO) SHOW STATUS LIKE 'Ssl_cipher'; Variable_name Value Ssl_cipher DHE-RSA-AES256-SHA @@ -39,7 +42,7 @@ f1 delete from t1; ERROR 42000: DELETE command denied to user 'ssl_user4'@'localhost' for table 't1' drop user ssl_user1@localhost, ssl_user2@localhost, -ssl_user3@localhost, ssl_user4@localhost; +ssl_user3@localhost, ssl_user4@localhost, ssl_user5@localhost; drop table t1; mysqltest: Could not open connection 'default': 2026 SSL connection error mysqltest: Could not open connection 'default': 2026 SSL connection error 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/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 81773dbf999..06f9cb7d2c6 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -32,7 +32,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/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..545edcac315 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -1326,8 +1326,37 @@ grant REPLICATION CLIENT on *.* to mysqltest_1@localhost; drop table t1; drop user mysqltest_1@localhost; ---echo End of 5.0 tests +# +# 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; +--echo End of 5.0 tests +use test; # # Added for use-thread option # diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test index afee381f5b7..49f8fc4d7d4 100644 --- a/mysql-test/t/openssl_1.test +++ b/mysql-test/t/openssl_1.test @@ -10,14 +10,18 @@ insert into t1 values (5); grant select on test.* to ssl_user1@localhost require SSL; grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA"; -grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/emailAddress=abstract.mysql.developer@mysql.com"; -grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/emailAddress=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/emailAddress=abstract.mysql.developer@mysql.com"; +grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB"; +grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB" ISSUER "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB"; +grant select on test.* to ssl_user5@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "xxx"; flush privileges; connect (con1,localhost,ssl_user1,,,,,SSL); connect (con2,localhost,ssl_user2,,,,,SSL); connect (con3,localhost,ssl_user3,,,,,SSL); connect (con4,localhost,ssl_user4,,,,,SSL); +--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT +--error 1045 +connect (con5,localhost,ssl_user5,,,,,SSL); connection con1; # Check ssl turned on @@ -49,7 +53,7 @@ delete from t1; connection default; drop user ssl_user1@localhost, ssl_user2@localhost, -ssl_user3@localhost, ssl_user4@localhost; +ssl_user3@localhost, ssl_user4@localhost, ssl_user5@localhost; drop table t1; 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; + |