summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <tsmith@maint1.mysql.com>2006-09-03 23:54:48 +0200
committerunknown <tsmith@maint1.mysql.com>2006-09-03 23:54:48 +0200
commit7ec288b51ead46bcd84ad42438532c16ce14db45 (patch)
tree9d7413378c12127bf63cd6a65555c6439924bbca
parent9c9a27d91a1528412e4d0c9dbfb022385f81575c (diff)
parent7fb745f52a72b6f7088001ece3be82cc5ef009e2 (diff)
downloadmariadb-git-7ec288b51ead46bcd84ad42438532c16ce14db45.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into maint1.mysql.com:/data/localhome/tsmith/bk/mysql-5.0-maint
-rw-r--r--.bzrignore1
-rw-r--r--client/mysqldump.c1
-rw-r--r--mysql-test/Makefile.am7
-rw-r--r--mysql-test/lib/mtr_cases.pl58
4 files changed, 39 insertions, 28 deletions
diff --git a/.bzrignore b/.bzrignore
index 84713371ce8..555199fd166 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -671,6 +671,7 @@ mysql-test/*.ds?
mysql-test/*.vcproj
mysql-test/gmon.out
mysql-test/install_test_db
+mysql-test/mtr
mysql-test/mysql-test-run
mysql-test/mysql-test-run.log
mysql-test/mysql_test_run_new
diff --git a/client/mysqldump.c b/client/mysqldump.c
index d6f89022e32..e774a07295b 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -852,6 +852,7 @@ static void DB_error(MYSQL *mysql, const char *when)
DBUG_ENTER("DB_error");
fprintf(stderr, "%s: Got error: %d: %s %s\n", my_progname,
mysql_errno(mysql), mysql_error(mysql), when);
+ fflush(stderr);
safe_exit(EX_MYSQLERR);
DBUG_VOID_RETURN;
} /* DB_error */
diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am
index 11bcef10fff..9f54b4fe192 100644
--- a/mysql-test/Makefile.am
+++ b/mysql-test/Makefile.am
@@ -34,7 +34,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 std_data/cacert.pem \
@@ -112,6 +112,11 @@ std_data/server-cert.pem: $(top_srcdir)/SSL/$(@F)
std_data/server-key.pem: $(top_srcdir)/SSL/$(@F)
@RM@ -f $@; @CP@ $(top_srcdir)/SSL/$(@F) $(srcdir)/std_data
+# mtr - a shortcut for executing mysql-test-run.pl
+mtr:
+ $(RM) -f mtr
+ $(LN_S) mysql-test-run.pl mtr
+
SUFFIXES = .sh
.sh:
diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl
index ed0395abd9d..009269f382e 100644
--- a/mysql-test/lib/mtr_cases.pl
+++ b/mysql-test/lib/mtr_cases.pl
@@ -82,7 +82,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 )
{
@@ -154,34 +154,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;