diff options
author | unknown <msvensson@neptunus.(none)> | 2005-03-22 14:29:34 +0100 |
---|---|---|
committer | unknown <msvensson@neptunus.(none)> | 2005-03-22 14:29:34 +0100 |
commit | 5e598cced3f01c7cefbe02443eb64f3ab8a71fed (patch) | |
tree | d487a073c52ca9f4e50f1b66d22f78f317cc32b5 | |
parent | 11e01bfa2d5a764e3f6b772d252e047985a02186 (diff) | |
parent | bac0698065f605eb43981e23903241f6eb27e2b7 (diff) | |
download | mariadb-git-5e598cced3f01c7cefbe02443eb64f3ab8a71fed.tar.gz |
Merge neptunus.(none):/home/msvensson/mysql/bug9072
into neptunus.(none):/home/msvensson/mysql/mysql-4.1
-rw-r--r-- | include/config-netware.h | 3 | ||||
-rw-r--r-- | innobase/include/trx0trx.h | 6 | ||||
-rw-r--r-- | innobase/trx/trx0trx.c | 10 | ||||
-rw-r--r-- | mysql-test/lib/mtr_cases.pl | 33 | ||||
-rw-r--r-- | mysql-test/lib/mtr_report.pl | 11 | ||||
-rwxr-xr-x | mysql-test/mysql-test-run.pl | 30 | ||||
-rw-r--r-- | sql/sql_select.cc | 2 |
7 files changed, 63 insertions, 32 deletions
diff --git a/include/config-netware.h b/include/config-netware.h index 3e145f566a1..c48aff70f3b 100644 --- a/include/config-netware.h +++ b/include/config-netware.h @@ -79,6 +79,9 @@ extern "C" { /* On NetWare, stack grows towards lower address*/ #define STACK_DIRECTION -1 +/* On NetWare, to fix the problem with the deletion of open files */ +#define CANT_DELETE_OPEN_FILES 1 + /* default directory information */ #define DEFAULT_MYSQL_HOME "sys:/mysql" #define PACKAGE "mysql" diff --git a/innobase/include/trx0trx.h b/innobase/include/trx0trx.h index 8336e05bdb0..905b25447a8 100644 --- a/innobase/include/trx0trx.h +++ b/innobase/include/trx0trx.h @@ -346,6 +346,12 @@ struct trx_struct{ in MySQL's binlog write, we will flush the log to disk later in a separate call */ + ibool must_flush_log_later;/* this flag is set to TRUE in + trx_commit_off_kernel() if + flush_log_later was TRUE, and there + were modifications by the transaction; + in that case we must flush the log + in trx_commit_complete_for_mysql() */ dulint commit_lsn; /* lsn at the time of the commit */ ibool dict_operation; /* TRUE if the trx is used to create a table, create an index, or drop a diff --git a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c index 8f409034df0..13575a3cedd 100644 --- a/innobase/trx/trx0trx.c +++ b/innobase/trx/trx0trx.c @@ -96,6 +96,7 @@ trx_create( trx->check_unique_secondary = TRUE; trx->flush_log_later = FALSE; + trx->must_flush_log_later = FALSE; trx->dict_operation = FALSE; @@ -654,6 +655,8 @@ trx_commit_off_kernel( ut_ad(mutex_own(&kernel_mutex)); #endif /* UNIV_SYNC_DEBUG */ + trx->must_flush_log_later = FALSE; + rseg = trx->rseg; if (trx->insert_undo != NULL || trx->update_undo != NULL) { @@ -821,6 +824,7 @@ trx_commit_off_kernel( if (trx->flush_log_later) { /* Do nothing yet */ + trx->must_flush_log_later = TRUE; } else if (srv_flush_log_at_trx_commit == 0) { /* Do nothing */ } else if (srv_flush_log_at_trx_commit == 1) { @@ -1539,7 +1543,9 @@ trx_commit_complete_for_mysql( trx->op_info = "flushing log"; - if (srv_flush_log_at_trx_commit == 0) { + if (!trx->must_flush_log_later) { + /* Do nothing */ + } else if (srv_flush_log_at_trx_commit == 0) { /* Do nothing */ } else if (srv_flush_log_at_trx_commit == 1) { if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) { @@ -1560,6 +1566,8 @@ trx_commit_complete_for_mysql( } else { ut_error; } + + trx->must_flush_log_later = FALSE; trx->op_info = ""; 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; } diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index 9947fed9d27..fd665b154b8 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -89,12 +89,11 @@ sub mtr_report_test_passed ($) { my $tinfo= shift; my $timer= ""; -# FIXME -# if ( $::opt_timer and -f "$::glob_mysql_test_dir/var/log/timer" ) -# { -# $timer= `cat var/log/timer`; -# $timer= sprintf "%13s", $timer; -# } + if ( $::opt_timer and -f "$::glob_mysql_test_dir/var/log/timer" ) + { + $timer= mtr_fromfile("$::glob_mysql_test_dir/var/log/timer"); + $timer= sprintf "%12s", $timer; + } $tinfo->{'result'}= 'MTR_RES_PASSED'; print "[ pass ] $timer\n"; } diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index f8adf372585..80ba98e4e97 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -214,6 +214,7 @@ our $opt_embedded_server; our $opt_extern; our $opt_fast; our $opt_force; +our $opt_reorder; our $opt_gcov; our $opt_gcov_err; @@ -525,6 +526,7 @@ sub command_line_setup () { 'local-master' => \$opt_local_master, 'netware' => \$opt_netware, 'old-master' => \$opt_old_master, + 'reorder' => \$opt_reorder, 'script-debug' => \$opt_script_debug, 'sleep=i' => \$opt_sleep, 'socket=s' => \$opt_socket, @@ -1368,7 +1370,10 @@ sub run_testcase ($) { mtr_report_test_name($tinfo); mtr_tofile($master->[0]->{'path_myerr'},"CURRENT_TEST: $tname\n"); - do_before_start_master($tname,$tinfo->{'master_sh'}); + +# FIXME test cases that depend on each other, prevent this from +# being at this location. +# do_before_start_master($tname,$tinfo->{'master_sh'}); # ---------------------------------------------------------------------- # If any mysqld servers running died, we have to know @@ -1400,6 +1405,8 @@ sub run_testcase ($) { } if ( ! $master->[0]->{'pid'} ) { + # FIXME not correct location for do_before_start_master() + do_before_start_master($tname,$tinfo->{'master_sh'}); $master->[0]->{'pid'}= mysqld_start('master',0,$tinfo->{'master_opt'},[]); if ( ! $master->[0]->{'pid'} ) @@ -1535,9 +1542,10 @@ sub do_before_start_master ($$) { $tname ne "rpl_crash_binlog_ib_3b") { # FIXME we really want separate dir for binlogs - # FIXME replace 'rm' in backticks with portable Perl function - `rm -f $glob_mysql_test_dir/var/log/master-bin*`; -# unlink("$glob_mysql_test_dir/var/log/master-bin*"); + foreach my $bin ( glob("$glob_mysql_test_dir/var/log/master*-bin.*") ) + { + unlink($bin); + } } # Remove old master.info and relay-log.info files @@ -1571,9 +1579,10 @@ sub do_before_start_slave ($$) { $tname ne "rpl_crash_binlog_ib_3b" ) { # FIXME we really want separate dir for binlogs - # FIXME replace 'rm' in backticks with portable Perl function - `rm -fr $glob_mysql_test_dir/var/log/slave*-bin.*`; -# unlink("$glob_mysql_test_dir/var/log/slave*-bin.*"); # FIXME idx??? + foreach my $bin ( glob("$glob_mysql_test_dir/var/log/slave*-bin.*") ) + { + unlink($bin); + } # FIXME really master?! unlink("$glob_mysql_test_dir/var/slave-data/master.info"); unlink("$glob_mysql_test_dir/var/slave-data/relay-log.info"); @@ -1659,13 +1668,15 @@ sub mysqld_arguments ($$$$$) { mtr_add_arg($args, "%s--datadir=%s", $prefix, $slave->[$idx]->{'path_myddir'}); + % FIXME slave get this option twice?! mtr_add_arg($args, "%s--exit-info=256", $prefix); mtr_add_arg($args, "%s--init-rpl-role=slave", $prefix); mtr_add_arg($args, "%s--log-bin=%s/var/log/slave%s-bin", $prefix, $glob_mysql_test_dir, $sidx); # FIXME use own dir for binlogs mtr_add_arg($args, "%s--log-slave-updates", $prefix); + % FIXME option duplicated for slave mtr_add_arg($args, "%s--log=%s", $prefix, - $slave->[$idx]->{'path_myerr'}); + $slave->[$idx]->{'path_mylog'}); mtr_add_arg($args, "%s--master-retry-count=10", $prefix); mtr_add_arg($args, "%s--pid-file=%s", $prefix, $slave->[$idx]->{'path_mypid'}); @@ -2046,7 +2057,7 @@ sub run_mysqltest ($$) { if ( $opt_timer ) { - mtr_add_arg($args, "--timer-file=var/log/timer"); + mtr_add_arg($args, "--timer-file=%s/var/log/timer", $glob_mysql_test_dir); } if ( $opt_big_test ) @@ -2175,6 +2186,7 @@ Misc options timer Show test case execution time start-and-exit Only initiate and start the "mysqld" servers fast Don't try to cleanup from earlier runs + reorder Reorder tests to get less server restarts help Get this help text unified-diff | udiff When presenting differences, use unified diff diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 4b2484d1e06..c79912e7eae 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -9149,7 +9149,7 @@ bool JOIN::rollup_make_fields(List<Item> &fields_arg, List<Item> &sel_fields, { /* Check if this is something that is part of this group by */ ORDER *group_tmp; - for (group_tmp= start_group, i-- ; + for (group_tmp= start_group, i= pos ; group_tmp ; group_tmp= group_tmp->next, i++) { if (*group_tmp->item == item) |