From 72695c3fae1281ccf535907edf847077446e971d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 25 Aug 2006 10:11:15 +0200 Subject: [PATCH 1/7] Backport fix for finding executables from 5.0 mysql-test/lib/mtr_misc.pl: On windows the exe does not need to be executable for it to be found --- mysql-test/lib/mtr_misc.pl | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/mysql-test/lib/mtr_misc.pl b/mysql-test/lib/mtr_misc.pl index 26d5b9ed283..08c99e90906 100644 --- a/mysql-test/lib/mtr_misc.pl +++ b/mysql-test/lib/mtr_misc.pl @@ -82,7 +82,14 @@ sub mtr_path_exists (@) { sub mtr_script_exists (@) { foreach my $path ( @_ ) { - return $path if -x $path; + if($::glob_win32) + { + return $path if -f $path; + } + else + { + return $path if -x $path; + } } if ( @_ == 1 ) { @@ -99,7 +106,14 @@ sub mtr_exe_exists (@) { map {$_.= ".exe"} @path if $::glob_win32; foreach my $path ( @path ) { - return $path if -x $path; + if($::glob_win32) + { + return $path if -f $path; + } + else + { + return $path if -x $path; + } } if ( @path == 1 ) { From db2a86ce8fcb58fe67a73ec8bf1aa35e73490c77 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 25 Aug 2006 10:46:14 +0200 Subject: [PATCH 2/7] Fix running tests suite with non standard tmp dir. Default is "var/tmp" mysql-test/r/myisam.result: Update result file mysql-test/t/myisam.test: If running test suite with a non standard tmp dir, the "show create table" will print "DATA DIRECTORY=" Use replace_result to mask it out Set tmpdir to var/log to get the printout of DATA DIRECTORY also when running with standard tmpdir --- mysql-test/r/myisam.result | 4 ++-- mysql-test/t/myisam.test | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index ce601944f97..d7c9ba19a8a 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -773,12 +773,12 @@ show create table t1; Table Create Table t1 CREATE TEMPORARY TABLE `t1` ( `a` int(11) default NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQL_TEST_DIR/var/log/' show create table t1; Table Create Table t1 CREATE TEMPORARY TABLE `t1` ( `a` int(11) default NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQL_TEST_DIR/var/log/' create table t1 (a int) engine=myisam select 42 a; select * from t1; a diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index be7bec117f3..11d0693b511 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -734,14 +734,20 @@ connect (session2,localhost,root,,); connection session1; disable_query_log; -eval create temporary table t1 (a int) engine=myisam data directory="$MYSQL_TEST_DIR/var/tmp" select 9 a; +eval create temporary table t1 (a int) engine=myisam data directory="$MYSQL_TEST_DIR/var/log" select 9 a; enable_query_log; +# If running test suite with a non standard tmp dir, the "show create table" +# will print "DATA_DIRECTORY=". Use replace_result to mask it out +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR show create table t1; connection session2; disable_query_log; -eval create temporary table t1 (a int) engine=myisam data directory="$MYSQL_TEST_DIR/var/tmp" select 99 a; +eval create temporary table t1 (a int) engine=myisam data directory="$MYSQL_TEST_DIR/var/log" select 99 a; enable_query_log; +# If running test suite with a non standard tmp dir, the "show create table" +# will print "DATA_DIRECTORY=". Use replace_result to mask it out +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR show create table t1; connection default; From 28db55a79535ffa22e3de32db0115bac4985e8b1 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 25 Aug 2006 15:17:03 +0200 Subject: [PATCH 3/7] Backport from 5.0 a fix that will start ndb only for tests that needs it mysql-test/lib/mtr_cases.pl: Detect which tests that need ndb mysql-test/lib/mtr_match.pl: Add function mtr_match_substring mysql-test/mysql-test-run.pl: Only start cluster for test cases that need it --- mysql-test/lib/mtr_cases.pl | 22 ++++++++++++++++++++++ mysql-test/lib/mtr_match.pl | 17 +++++++++++++++++ mysql-test/mysql-test-run.pl | 28 ++++++++++++++++++++++++++-- 3 files changed, 65 insertions(+), 2 deletions(-) diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl index 3666c1aa01b..650fb79155d 100644 --- a/mysql-test/lib/mtr_cases.pl +++ b/mysql-test/lib/mtr_cases.pl @@ -193,6 +193,28 @@ sub collect_one_test_case($$$$$$) { $tinfo->{'slave_restart'}= 1; } + # Cluster is needed by test case if testname contains ndb + if ( defined mtr_match_substring($tname,"ndb") ) + { + $tinfo->{'ndb_test'}= 1; + if ( $::opt_skip_ndbcluster ) + { + # Skip all ndb tests + $tinfo->{'skip'}= 1; + return; + } + if ( ! $::opt_with_ndbcluster ) + { + # Ndb is not supported, skip them + $tinfo->{'skip'}= 1; + return; + } + } + else + { + $tinfo->{'ndb_test'}= 0; + } + # FIXME what about embedded_server + ndbcluster, skip ?! my $master_opt_file= "$testdir/$tname-master.opt"; diff --git a/mysql-test/lib/mtr_match.pl b/mysql-test/lib/mtr_match.pl index eb5de655520..66b639c7f8e 100644 --- a/mysql-test/lib/mtr_match.pl +++ b/mysql-test/lib/mtr_match.pl @@ -50,6 +50,23 @@ sub mtr_match_extension ($$) { } +# Match a substring anywere in a string + +sub mtr_match_substring ($$) { + my $string= shift; + my $substring= shift; + + if ( $string =~ /(.*)\Q$substring\E(.*)$/ ) # strncmp + { + return $1; + } + else + { + return undef; # NULL + } +} + + sub mtr_match_any_exact ($$) { my $string= shift; my $mlist= shift; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 8cf14faec0c..eff6c7ccfbe 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1581,6 +1581,16 @@ sub run_testcase ($) { { $do_restart= 1; # Always restart if script to run } + elsif ( $tinfo->{'ndb_test'} and $master->[0]->{'ndbcluster'} == 1 ) + { + $do_restart= 1; # Restart with cluster + # print "Restarting because cluster need to be enabled\n"; + } + elsif ($tinfo->{'ndb_test'} == 0 and $master->[0]->{'ndbcluster'} == 0) + { + $do_restart= 1; # Restart without cluster + # print "Restarting because cluster need to be disabled\n"; + } elsif ( $master->[0]->{'running_master_is_special'} and $master->[0]->{'running_master_is_special'}->{'timezone'} eq $tinfo->{'timezone'} and @@ -1646,7 +1656,7 @@ sub run_testcase ($) { if ( ! $opt_local_master ) { - if ( $master->[0]->{'ndbcluster'} ) + if ( $master->[0]->{'ndbcluster'} && $tinfo->{'ndb_test'}) { $master->[0]->{'ndbcluster'}= ndbcluster_start(); if ( $master->[0]->{'ndbcluster'} ) @@ -1659,8 +1669,22 @@ sub run_testcase ($) { { # FIXME not correct location for do_before_start_master() do_before_start_master($tname,$tinfo->{'master_sh'}); + + # Save skip_ndbcluster + my $save_opt_skip_ndbcluster= $opt_skip_ndbcluster; + if (!$tinfo->{'ndb_test'}) + { + # Modify skip_ndbcluster so cluster is skipped for this + # and subsequent testcases(until we find one that does not cluster) + $opt_skip_ndbcluster= 1; + } + $master->[0]->{'pid'}= mysqld_start('master',0,$tinfo->{'master_opt'},[]); + + # Restore skip_ndbcluster + $opt_skip_ndbcluster= $save_opt_skip_ndbcluster; + if ( ! $master->[0]->{'pid'} ) { report_failure_and_restart($tinfo); @@ -2026,7 +2050,7 @@ sub mysqld_arguments ($$$$$) { } } - if ( $opt_with_ndbcluster ) + if ( $opt_with_ndbcluster && !$opt_skip_ndbcluster) { mtr_add_arg($args, "%s--ndbcluster", $prefix); mtr_add_arg($args, "%s--ndb-connectstring=%s", $prefix, From 30031bbf37d7e277d2b67ccd8432f3c59343c34f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 25 Aug 2006 15:23:42 +0200 Subject: [PATCH 4/7] Add mysqld-max-nt to list of mysqld executales to look for on windows --- mysql-test/mysql-test-run.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index eff6c7ccfbe..54b680c6f0f 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -898,7 +898,8 @@ sub executable_setup () { $exe_mysqld= mtr_exe_exists ("$path_client_bindir/mysqld-nt", "$path_client_bindir/mysqld", "$path_client_bindir/mysqld-debug", - "$path_client_bindir/mysqld-max"); + "$path_client_bindir/mysqld-max", + "$path_client_bindir/mysqld-max-nt"); $path_language= mtr_path_exists("$glob_basedir/share/english/"); $path_charsetsdir= mtr_path_exists("$glob_basedir/share/charsets"); $exe_my_print_defaults= From 48966da630a80d4cad22900c3aade2719809be70 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 25 Aug 2006 17:01:04 +0200 Subject: [PATCH 5/7] Ignore --skip-im if specified on command line Null merge to 5.0 mysql-test/mysql-test-run.pl: Ignore --skip-im if specified on command line --- mysql-test/mysql-test-run.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 54b680c6f0f..aafc266a2f2 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -233,6 +233,7 @@ our $opt_result_ext; our $opt_skip; our $opt_skip_rpl; +our $opt_skip_im; # --skip-im on command line will just be ignored our $opt_skip_test; our $opt_sleep; @@ -519,6 +520,7 @@ sub command_line_setup () { 'do-test=s' => \$opt_do_test, 'suite=s' => \$opt_suite, 'skip-rpl' => \$opt_skip_rpl, + 'skip-im' => \$opt_skip_im, 'skip-test=s' => \$opt_skip_test, # Specify ports From 9aa12815b3a5e71beda2072e11f27bcc3c139b33 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 26 Aug 2006 18:38:42 +0200 Subject: [PATCH 6/7] Dont' ever use cluster for slave in 4.1 --- mysql-test/mysql-test-run.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index aafc266a2f2..d1e049ff883 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2053,7 +2053,7 @@ sub mysqld_arguments ($$$$$) { } } - if ( $opt_with_ndbcluster && !$opt_skip_ndbcluster) + if ( $opt_with_ndbcluster && !$opt_skip_ndbcluster && $type eq 'master') { mtr_add_arg($args, "%s--ndbcluster", $prefix); mtr_add_arg($args, "%s--ndb-connectstring=%s", $prefix, From 49e2267ebda7809a1f93e61b4544ae800ed0705a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 1 Sep 2006 11:21:12 +0200 Subject: [PATCH 7/7] Backport from 5.0 - Dont test "encrypt" in ctype_ucs mysql-test/r/ctype_ucs.result: Don't test "encrypt" function in ctype_ucs.test mysql-test/t/ctype_ucs.test: Don't test "encrypt" function in ctype_ucs.test --- mysql-test/r/ctype_ucs.result | 4 ---- mysql-test/t/ctype_ucs.test | 6 ------ 2 files changed, 10 deletions(-) diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 05866ea4966..24a4ca9a85f 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -755,10 +755,6 @@ 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) ???????? diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test index 62244b3d8f5..d96b9938f1b 100644 --- a/mysql-test/t/ctype_ucs.test +++ b/mysql-test/t/ctype_ucs.test @@ -489,12 +489,6 @@ select export_set(5, name, upper(name), ",", 5) from bug20536; 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.