summaryrefslogtreecommitdiff
path: root/mysql-test/lib/mtr_cases.pl
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/lib/mtr_cases.pl')
-rw-r--r--mysql-test/lib/mtr_cases.pl33
1 files changed, 18 insertions, 15 deletions
diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl
index 5977bb380cf..878afe95f2c 100644
--- a/mysql-test/lib/mtr_cases.pl
+++ b/mysql-test/lib/mtr_cases.pl
@@ -63,21 +63,24 @@ sub collect_test_cases ($) {
# To speed things up, we sort first in if the test require a restart
# or not, second in alphanumeric order.
-# @$cases = sort {
-# if ( $a->{'master_restart'} and $b->{'master_restart'} or
-# ! $a->{'master_restart'} and ! $b->{'master_restart'} )
-# {
-# return $a->{'name'} cmp $b->{'name'};
-# }
-# if ( $a->{'master_restart'} )
-# {
-# return 1; # Is greater
-# }
-# else
-# {
-# return -1; # Is less
-# }
-# } @$cases;
+ if ( $::opt_reorder )
+ {
+ @$cases = sort {
+ if ( $a->{'master_restart'} and $b->{'master_restart'} or
+ ! $a->{'master_restart'} and ! $b->{'master_restart'} )
+ {
+ return $a->{'name'} cmp $b->{'name'};
+ }
+ if ( $a->{'master_restart'} )
+ {
+ return 1; # Is greater
+ }
+ else
+ {
+ return -1; # Is less
+ }
+ } @$cases;
+ }
return $cases;
}