diff options
author | unknown <msvensson@neptunus.(none)> | 2006-11-28 21:20:56 +0100 |
---|---|---|
committer | unknown <msvensson@neptunus.(none)> | 2006-11-28 21:20:56 +0100 |
commit | 7e14b6cb543e8b4a662b4bc5e927ccbf3500de2a (patch) | |
tree | 98867f6c782af07a2ae1e85067885b88173e2637 | |
parent | c789301fcd3877a21d328b8e3c4ab97148d879f3 (diff) | |
parent | befbebcfdb0749fc0167a7652900abae6a0060e7 (diff) | |
download | mariadb-git-7e14b6cb543e8b4a662b4bc5e927ccbf3500de2a.tar.gz |
Merge neptunus.(none):/home/msvensson/mysql/mysql-4.1-maint
into neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
Docs/Makefile.am:
Auto merged
Makefile.am:
Auto merged
client/mysqltest.c:
Auto merged
mysql-test/Makefile.am:
Auto merged
mysql-test/mysql-test-run-shell.sh:
Auto merged
mysql-test/lib/mtr_process.pl:
Auto merged
mysql-test/lib/mtr_report.pl:
Auto merged
mysql-test/r/func_time.result:
Auto merged
mysql-test/t/func_time.test:
Auto merged
sql-common/my_time.c:
Auto merged
sql/item_timefunc.cc:
Auto merged
mysql-test/mysql-test-run.pl:
Manual merge
-rw-r--r-- | Docs/Makefile.am | 12 | ||||
-rwxr-xr-x | mysql-test/mysql-test-run.pl | 138 |
2 files changed, 94 insertions, 56 deletions
diff --git a/Docs/Makefile.am b/Docs/Makefile.am index 66e77ae7d7c..ad78a30118e 100644 --- a/Docs/Makefile.am +++ b/Docs/Makefile.am @@ -26,7 +26,7 @@ all-local: $(TXT_FILES) # make sure that "make install" installs the info page, too # automake only seems to take care of this automatically, # if we're building the info page from texi directly. -install-data-hook: mysql.info +install-data-hook: $(srcdir)/mysql.info $(mkinstalldirs) $(DESTDIR)$(infodir) $(INSTALL_DATA) $(srcdir)/mysql.info $(DESTDIR)$(infodir) @@ -44,22 +44,22 @@ CLEAN_FILES: $(TXT_FILES) GT = $(srcdir)/Support/generate-text-files.pl -../INSTALL-SOURCE: mysql.info $(GT) +../INSTALL-SOURCE: $(srcdir)/mysql.info $(GT) perl -w $(GT) $(srcdir)/mysql.info "installing-source" "windows-source-build" > $@ -../INSTALL-WIN-SOURCE: mysql.info $(GT) +../INSTALL-WIN-SOURCE: $(srcdir)/mysql.info $(GT) perl -w $(GT) $(srcdir)/mysql.info "windows-source-build" "post-installation" > $@ # We put the description for the binary installation here so that # people who download source wont have to see it. It is moved up to # the toplevel by the script that makes the binary tar files. -INSTALL-BINARY: mysql.info $(GT) +INSTALL-BINARY: $(srcdir)/mysql.info $(GT) perl -w $(GT) $(srcdir)/mysql.info "installing-binary" "installing-source" > $@ -../EXCEPTIONS-CLIENT: mysql.info $(GT) +../EXCEPTIONS-CLIENT: $(srcdir)/mysql.info $(GT) perl -w $(GT) $(srcdir)/mysql.info "mysql-floss-license-exception" "function-index" > $@ -../support-files/MacOSX/ReadMe.txt: mysql.info $(GT) +../support-files/MacOSX/ReadMe.txt: $(srcdir)/mysql.info $(GT) perl -w $(GT) $(srcdir)/mysql.info "mac-os-x-installation" "netware-installation" > $@ # Don't update the files from bitkeeper diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index c17529a927b..91a5b09e4df 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -318,7 +318,7 @@ sub main (); sub initial_setup (); sub command_line_setup (); sub set_mtr_build_thread_ports($); -sub datadir_setup (); +sub datadir_list_setup (); sub executable_setup (); sub environment_setup (); sub kill_running_servers (); @@ -467,6 +467,15 @@ sub command_line_setup () { $im_port= 9312; $im_mysqld1_port= 9313; $im_mysqld2_port= 9314; + + # If so requested, we try to avail ourselves of a unique build thread number. + if ( $ENV{'MTR_BUILD_THREAD'} ) { + if ( lc($ENV{'MTR_BUILD_THREAD'}) eq 'auto' ) { + print "Requesting build thread... "; + $ENV{'MTR_BUILD_THREAD'} = mtr_require_unique_id_and_wait("/tmp/mysql-test-ports", 200, 299); + print "got ".$ENV{'MTR_BUILD_THREAD'}."\n"; + } + } if ( $ENV{'MTR_BUILD_THREAD'} ) { @@ -668,7 +677,7 @@ sub command_line_setup () { # number as early as possible # - # Look for the client binaries + # Look for the client binaries directory $path_client_bindir= mtr_path_exists("$glob_basedir/client_release", "$glob_basedir/client_debug", vs_config_dirs('client', ''), @@ -802,13 +811,6 @@ sub command_line_setup () { $opt_vardir= "$glob_mysql_test_dir/$opt_vardir"; } - # Ensure a proper error message - mkpath("$opt_vardir"); - unless ( -d $opt_vardir and -w $opt_vardir ) - { - mtr_error("Writable 'var' directory is needed, use the '--vardir' option"); - } - # -------------------------------------------------------------------------- # Set tmpdir # -------------------------------------------------------------------------- @@ -1243,7 +1245,7 @@ sub set_mtr_build_thread_ports() { } -sub datadir_setup () { +sub datadir_list_setup () { # Make a list of all data_dirs @data_dir_lst = ( @@ -2008,10 +2010,6 @@ sub kill_running_servers () { } } -sub created_by_mem_filename(){ - return "$glob_mysql_test_dir/var/created_by_mem"; -} - # # Remove var and any directories in var/ created by previous @@ -2034,18 +2032,25 @@ sub remove_stale_vardir () { if ( -l $opt_vardir) { # var is a symlink - if (-f created_by_mem_filename() ) + + if ( $opt_mem and readlink($opt_vardir) eq $opt_mem ) { # Remove the directory which the link points at mtr_verbose("Removing " . readlink($opt_vardir)); rmtree(readlink($opt_vardir)); - # Remove the entire "var" dir - mtr_verbose("Removing $opt_vardir/"); - rmtree("$opt_vardir/"); + # Remove the "var" symlink mtr_verbose("unlink($opt_vardir)"); unlink($opt_vardir); } + elsif ( $opt_mem ) + { + # Just remove the "var" symlink + mtr_report("WARNING: Removing '$opt_vardir' symlink it's wrong"); + + mtr_verbose("unlink($opt_vardir)"); + unlink($opt_vardir); + } else { # Some users creates a soft link in mysql-test/var to another area @@ -2053,6 +2058,10 @@ sub remove_stale_vardir () { mtr_report("WARNING: Using the 'mysql-test/var' symlink"); + # Make sure the directory where it points exist + mtr_error("The destination for symlink $opt_vardir does not exist") + if ! -d readlink($opt_vardir); + my $dir= shift; foreach my $bin ( glob("$opt_vardir/*") ) { @@ -2091,18 +2100,28 @@ sub remove_stale_vardir () { sub setup_vardir() { mtr_report("Creating Directories"); - if ( $opt_mem ) + if ( $opt_vardir eq $default_vardir ) { - # Runinng with var as a link to some "memory" location, normally tmpfs - mtr_verbose("Creating $opt_mem"); - mkpath($opt_mem); + # + # Running with "var" in mysql-test dir + # + if ( -l $opt_vardir ) + { + # it's a symlink - mtr_report("Symlinking 'var' to '$opt_mem'"); - symlink($opt_mem, $opt_vardir); + # Make sure the directory where it points exist + mtr_error("The destination for symlink $opt_vardir does not exist") + if ! -d readlink($opt_vardir); + } + elsif ( $opt_mem ) + { + # Runinng with "var" as a link to some "memory" location, normally tmpfs + mtr_verbose("Creating $opt_mem"); + mkpath($opt_mem); - # Put a small file to recognize this dir was created by --mem - mtr_verbose("Creating " . created_by_mem_filename()); - mtr_tofile(created_by_mem_filename(), $opt_mem); + mtr_report("Symlinking 'var' to '$opt_mem'"); + symlink($opt_mem, $opt_vardir); + } } mkpath("$opt_vardir/log"); @@ -2655,7 +2674,7 @@ sub run_suite () { sub initialize_servers () { - datadir_setup(); + datadir_list_setup(); if ( $opt_extern ) { @@ -3056,26 +3075,15 @@ sub do_before_run_mysqltest($) unlink("$result_dir/$tname.log"); unlink("$result_dir/$tname.warnings"); - 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($path_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 ( $mysql_version_id < 50000 ) { - # Set envirnoment variable NDB_STATUS_OK to 1 + # Set environment variable NDB_STATUS_OK to 1 # if script decided to run mysqltest cluster _is_ installed ok $ENV{'NDB_STATUS_OK'} = "1"; } elsif ( $mysql_version_id < 50100 ) { - # Set envirnoment variable NDB_STATUS_OK to YES + # Set environment variable NDB_STATUS_OK to YES # if script decided to run mysqltest cluster _is_ installed ok $ENV{'NDB_STATUS_OK'} = "YES"; } @@ -3086,9 +3094,9 @@ sub do_after_run_mysqltest($) my $tinfo= shift; my $tname= $tinfo->{'name'}; - mtr_tofile($path_mysqltest_log,"CURRENT TEST $tname\n"); - # Save info from this testcase run to mysqltest.log + mtr_appendfile_to_file($path_current_test_log, $path_mysqltest_log) + if -f $path_current_test_log; mtr_appendfile_to_file($path_timefile, $path_mysqltest_log) if -f $path_timefile; @@ -3098,6 +3106,26 @@ sub do_after_run_mysqltest($) } +sub run_testcase_mark_logs($) +{ + my ($log_msg)= @_; + + # Write a marker to all log files + + # The file indicating current test name + mtr_tonewfile($path_current_test_log, $log_msg); + + # each mysqld's .err file + foreach my $mysqld (@{$master}, @{$slave}) + { + mtr_tofile($mysqld->{path_myerr}, $log_msg); + } + + # ndbcluster log file + mtr_tofile($path_ndb_testrun_log, $log_msg); + +} + sub find_testcase_skipped_reason($) { my ($tinfo)= @_; @@ -3217,6 +3245,10 @@ sub run_testcase ($) { run_testcase_stop_servers($tinfo, $master_restart, $slave_restart); } + + # Write to all log files to indicate start of testcase + run_testcase_mark_logs("CURRENT_TEST: $tinfo->{name}\n"); + my $died= mtr_record_dead_children(); if ($died or $master_restart or $slave_restart) { @@ -3558,6 +3590,12 @@ sub mysqld_arguments ($$$$$) { mtr_add_arg($args, "%s--ndb-extra-logging", $prefix); } } + + if ( $mysql_version_id <= 50106 ) + { + # Force mysqld to use log files up until 5.1.6 + mtr_add_arg($args, "%s--log=%s", $prefix, $master->[0]->{'path_mylog'}); + } } if ( $type eq 'slave' ) @@ -3575,8 +3613,6 @@ sub mysqld_arguments ($$$$$) { mtr_add_arg($args, "%s--log-slave-updates", $prefix); } - mtr_add_arg($args, "%s--log=%s", $prefix, - $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_pid'}); @@ -3637,6 +3673,13 @@ sub mysqld_arguments ($$$$$) { mtr_add_arg($args, "%s--ndb-extra-logging", $prefix); } } + + if ( $mysql_version_id <= 50106 ) + { + # Force mysqld to use log files up until 5.1.6 + mtr_add_arg($args, "%s--log=%s", $prefix, $master->[0]->{'path_mylog'}); + } + } # end slave if ( $opt_debug ) @@ -3713,7 +3756,6 @@ sub mysqld_arguments ($$$$$) { elsif ( $type eq 'master' ) { mtr_add_arg($args, "%s--open-files-limit=1024", $prefix); - mtr_add_arg($args, "%s--log=%s", $prefix, $master->[0]->{'path_mylog'}); } return $args; @@ -4218,8 +4260,6 @@ sub run_testcase_start_servers($) { return 1; } } - mtr_tofile($master->[1]->{'path_myerr'},"CURRENT_TEST: $tname\n"); - mysqld_start($master->[1],$tinfo->{'master_opt'},[]); } @@ -4247,8 +4287,6 @@ sub run_testcase_start_servers($) { # ---------------------------------------------------------------------- if ( $tinfo->{'slave_num'} ) { - mtr_tofile($slave->[0]->{'path_myerr'},"CURRENT_TEST: $tname\n"); - restore_slave_databases($tinfo->{'slave_num'}); do_before_start_slave($tinfo); |