From 12c43f4f15e505c0db34c46dbcd90f27a7334345 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 20 Oct 2006 17:09:07 +0200 Subject: [PATCH 01/21] Init some variables that changes between test cases direclty in run_testcase This can not be done in run_testcase_start_servers as embedded never starts a server Add error if mysqld_start is called in embedded mode --- mysql-test/mysql-test-run.pl | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 286bb8a11c5..7dac63b5373 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2880,6 +2880,13 @@ sub find_testcase_skipped_reason($) sub run_testcase ($) { my $tinfo= shift; + # ------------------------------------------------------- + # Init variables that can change between each test case + # ------------------------------------------------------- + + $ENV{'TZ'}= $tinfo->{'timezone'}; + mtr_verbose("Starting server with timezone: $tinfo->{'timezone'}"); + my $master_restart= run_testcase_need_master_restart($tinfo); my $slave_restart= run_testcase_need_slave_restart($tinfo); @@ -3409,6 +3416,9 @@ sub mysqld_start ($$$) { my $type= $mysqld->{'type'}; my $idx= $mysqld->{'idx'}; + mtr_error("Internal error: mysqld should never be started for embedded") + if $glob_use_embedded_server; + if ( $type eq 'master' ) { $exe= $exe_master_mysqld; @@ -3849,12 +3859,6 @@ sub run_testcase_start_servers($) { my $tinfo= shift; my $tname= $tinfo->{'name'}; - # ------------------------------------------------------- - # Init variables that can change between server starts - # ------------------------------------------------------- - $ENV{'TZ'}= $tinfo->{'timezone'}; - mtr_verbose("Starting server with timezone: $tinfo->{'timezone'}"); - if ( $tinfo->{'component_id'} eq 'mysqld' ) { if ( ! $opt_skip_ndbcluster and From a71a524eeb5d70414f43d2708a47d729f2ad6640 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 20 Oct 2006 17:17:24 -0400 Subject: [PATCH 02/21] Bug #23427: incompatible ABI change in 5.0.26? Revert 1 June change enough to restore ABI compatibility with previous versions. include/mysql.h: Revert patch that breaks ABI compatibility libmysqld/lib_sql.cc: Remove useless assignment. --- include/mysql.h | 6 ------ libmysqld/lib_sql.cc | 1 - 2 files changed, 7 deletions(-) diff --git a/include/mysql.h b/include/mysql.h index ae4a8222c5b..8ef3f1273ec 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -293,12 +293,6 @@ typedef struct st_mysql /* needed for embedded server - no net buffer to store the 'info' */ char *info_buffer; #endif - /* - In embedded server it points to the statement that is processed - in the current query. We store some results directly in statement - fields then. - */ - struct st_mysql_stmt *current_stmt; } MYSQL; typedef struct st_mysql_res { diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 40966be46a5..98c75dfe719 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -100,7 +100,6 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command, mysql->affected_rows= ~(my_ulonglong) 0; mysql->field_count= 0; net->last_errno= 0; - mysql->current_stmt= stmt; thd->store_globals(); // Fix if more than one connect /* From f9223bc7e84d7143cac00153fe300ee635253404 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 23 Oct 2006 10:56:13 +0200 Subject: [PATCH 03/21] Copy *.cnf file from std_data/ when doing a binary distribution --- scripts/make_binary_distribution.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index b2eb9f3b727..d05c4427627 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -225,6 +225,7 @@ $CP mysql-test/lib/*.sql $BASE/mysql-test/lib $CP mysql-test/t/*.def $BASE/mysql-test/t $CP mysql-test/include/*.inc $BASE/mysql-test/include $CP mysql-test/std_data/*.dat mysql-test/std_data/*.*001 \ + mysql-test/std_data/*.cnf \ $BASE/mysql-test/std_data $CP mysql-test/std_data/des_key_file $BASE/mysql-test/std_data $CP mysql-test/t/*test mysql-test/t/*.opt mysql-test/t/*.slave-mi \ From e78a1931795d65e4b593f3016b37e8165cd26656 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 23 Oct 2006 12:02:56 +0200 Subject: [PATCH 04/21] As both ndb and im are components that may be disabled as well as the binaries may not exist. Look for their binaries in a separate function and produce test casea failures for the test thet needs these components --- mysql-test/mysql-test-run.pl | 178 ++++++++++++++++++++++------------- 1 file changed, 115 insertions(+), 63 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 7dac63b5373..acba4d843dd 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1295,6 +1295,54 @@ sub collect_mysqld_features () { } +sub executable_setup_im () { + + # Look for instance manager binary - mysqlmanager + $exe_im= + mtr_exe_maybe_exists( + "$glob_basedir/server-tools/instance-manager/mysqlmanager", + "$glob_basedir/libexec/mysqlmanager"); + + return ($exe_im eq ""); +} + +sub executable_setup_ndb () { + + # Look for ndb tols and binaries + my $ndb_path= mtr_file_exists("$glob_basedir/ndb", + "$glob_basedir/storage/ndb", + "$glob_basedir/bin"); + + $exe_ndbd= + mtr_exe_maybe_exists("$ndb_path/src/kernel/ndbd", + "$ndb_path/ndbd"); + $exe_ndb_mgm= + mtr_exe_maybe_exists("$ndb_path/src/mgmclient/ndb_mgm", + "$ndb_path/ndb_mgm"); + $exe_ndb_mgmd= + mtr_exe_maybe_exists("$ndb_path/src/mgmsrv/ndb_mgmd", + "$ndb_path/ndb_mgmd"); + $exe_ndb_waiter= + mtr_exe_maybe_exists("$ndb_path/tools/ndb_waiter", + "$ndb_path/ndb_waiter"); + + # May not exist + $path_ndb_tools_dir= mtr_file_exists("$ndb_path/tools", + "$ndb_path"); + # May not exist + $path_ndb_examples_dir= + mtr_file_exists("$ndb_path/ndbapi-examples", + "$ndb_path/examples"); + # May not exist + $exe_ndb_example= + mtr_file_exists("$path_ndb_examples_dir/ndbapi_simple/ndbapi_simple"); + + return ( $exe_ndbd eq "" or + $exe_ndb_mgm eq "" or + $exe_ndb_mgmd eq "" or + $exe_ndb_waiter eq ""); +} + sub executable_setup () { # @@ -1333,20 +1381,6 @@ sub executable_setup () { "$glob_basedir/extra/release/perror", "$glob_basedir/extra/debug/perror"); - - if ( ! $opt_skip_im ) - { - # Look for instance manager binary - mysqlmanager - $exe_im= - mtr_exe_exists( - "$glob_basedir/server-tools/instance-manager/mysqlmanager", - "$glob_basedir/libexec/mysqlmanager"); - } - else - { - $exe_im= "not_available"; - } - # Look for the client binaries $exe_mysqlcheck= mtr_exe_exists("$path_client_bindir/mysqlcheck"); $exe_mysqldump= mtr_exe_exists("$path_client_bindir/mysqldump"); @@ -1368,35 +1402,25 @@ sub executable_setup () { "$path_client_bindir/mysql_fix_privilege_tables"); } - if ( ! $opt_skip_ndbcluster) + + if ( ! $opt_skip_ndbcluster and executable_setup_ndb()) { - # Look for ndb tols and binaries - my $ndb_path= mtr_path_exists("$glob_basedir/ndb", - "$glob_basedir/storage/ndb", - "$glob_basedir/bin"); + mtr_warning("Could not find all required ndb binaries, " . + "all ndb tests will fail, use --skip-ndbcluster to " . + "skip testing it."); - $path_ndb_tools_dir= mtr_path_exists("$ndb_path/tools", - "$ndb_path"); - $exe_ndb_mgm= - mtr_exe_exists("$ndb_path/src/mgmclient/ndb_mgm", - "$ndb_path/ndb_mgm"); - $exe_ndb_mgmd= - mtr_exe_exists("$ndb_path/src/mgmsrv/ndb_mgmd", - "$ndb_path/ndb_mgmd"); - $exe_ndb_waiter= - mtr_exe_exists("$ndb_path/tools/ndb_waiter", - "$ndb_path/ndb_waiter"); - $exe_ndbd= - mtr_exe_exists("$ndb_path/src/kernel/ndbd", - "$ndb_path/ndbd"); + foreach my $cluster (@{$clusters}) + { + $cluster->{"executable_setup_failed"}= 1; + } + } - # May not exist - $path_ndb_examples_dir= - mtr_file_exists("$ndb_path/ndbapi-examples", - "$ndb_path/examples"); - # May not exist - $exe_ndb_example= - mtr_file_exists("$path_ndb_examples_dir/ndbapi_simple/ndbapi_simple"); + if ( ! $opt_skip_im and executable_setup_im()) + { + mtr_warning("Could not find all required instance manager binaries, " . + "all im tests will fail, use --skip-im to " . + "continue without instance manager"); + $instance_manager->{"executable_setup_failed"}= 1; } # Look for the udf_example library @@ -1424,7 +1448,8 @@ sub executable_setup () { if ( $glob_use_embedded_server ) { $exe_mysql_client_test= - mtr_exe_maybe_exists("$glob_basedir/libmysqld/examples/mysql_client_test_embedded"); + mtr_exe_maybe_exists( + "$glob_basedir/libmysqld/examples/mysql_client_test_embedded"); } else { @@ -1567,19 +1592,28 @@ sub environment_setup () { # ---------------------------------------------------- # Setup env for IM # ---------------------------------------------------- - $ENV{'IM_EXE'}= $exe_im; - $ENV{'IM_PATH_PID'}= $instance_manager->{path_pid}; - $ENV{'IM_PATH_ANGEL_PID'}= $instance_manager->{path_angel_pid}; - $ENV{'IM_PORT'}= $instance_manager->{port}; - $ENV{'IM_DEFAULTS_PATH'}= $instance_manager->{defaults_file}; - $ENV{'IM_PASSWORD_PATH'}= $instance_manager->{password_file}; + if ( ! $opt_skip_im ) + { + $ENV{'IM_EXE'}= $exe_im; + $ENV{'IM_PATH_PID'}= $instance_manager->{path_pid}; + $ENV{'IM_PATH_ANGEL_PID'}= $instance_manager->{path_angel_pid}; + $ENV{'IM_PORT'}= $instance_manager->{port}; + $ENV{'IM_DEFAULTS_PATH'}= $instance_manager->{defaults_file}; + $ENV{'IM_PASSWORD_PATH'}= $instance_manager->{password_file}; - $ENV{'IM_MYSQLD1_SOCK'}= $instance_manager->{instances}->[0]->{path_sock}; - $ENV{'IM_MYSQLD1_PORT'}= $instance_manager->{instances}->[0]->{port}; - $ENV{'IM_MYSQLD1_PATH_PID'}=$instance_manager->{instances}->[0]->{path_pid}; - $ENV{'IM_MYSQLD2_SOCK'}= $instance_manager->{instances}->[1]->{path_sock}; - $ENV{'IM_MYSQLD2_PORT'}= $instance_manager->{instances}->[1]->{port}; - $ENV{'IM_MYSQLD2_PATH_PID'}=$instance_manager->{instances}->[1]->{path_pid}; + $ENV{'IM_MYSQLD1_SOCK'}= + $instance_manager->{instances}->[0]->{path_sock}; + $ENV{'IM_MYSQLD1_PORT'}= + $instance_manager->{instances}->[0]->{port}; + $ENV{'IM_MYSQLD1_PATH_PID'}= + $instance_manager->{instances}->[0]->{path_pid}; + $ENV{'IM_MYSQLD2_SOCK'}= + $instance_manager->{instances}->[1]->{path_sock}; + $ENV{'IM_MYSQLD2_PORT'}= + $instance_manager->{instances}->[1]->{port}; + $ENV{'IM_MYSQLD2_PATH_PID'}= + $instance_manager->{instances}->[1]->{path_pid}; + } # ---------------------------------------------------- # Setup env so childs can execute mysqlcheck @@ -2037,14 +2071,6 @@ sub check_ndbcluster_support ($) { $opt_skip_ndbcluster_slave= 1; return; } - elsif ( -e "$glob_basedir/bin" && ! -f "$glob_basedir/bin/ndbd") - { - # Binary dist with a mysqld that supports ndb, but no ndbd found - mtr_report("Skipping ndbcluster, can't fint binaries"); - $opt_skip_ndbcluster= 1; - $opt_skip_ndbcluster_slave= 1; - return; - } $glob_ndbcluster_supported= 1; mtr_report("Using ndbcluster when necessary, mysqld supports it"); @@ -2475,7 +2501,8 @@ sub mysql_install_db () { my $cluster_started_ok= 1; # Assume it can be started - if ($opt_skip_ndbcluster || $glob_use_running_ndbcluster) + if ($opt_skip_ndbcluster || $glob_use_running_ndbcluster || + $clusters->[0]->{executable_setup_failed}) { # Don't install master cluster } @@ -2486,7 +2513,8 @@ sub mysql_install_db () { } if ($max_slave_num == 0 || - $opt_skip_ndbcluster_slave || $glob_use_running_ndbcluster_slave) + $opt_skip_ndbcluster_slave || $glob_use_running_ndbcluster_slave || + $clusters->[1]->{executable_setup_failed}) { # Don't install slave cluster } @@ -2760,6 +2788,16 @@ sub run_testcase_check_skip_test($) last if ($opt_skip_ndbcluster_slave and $cluster->{'name'} eq 'Slave'); + # If test needs this cluster, check binaries was found ok + if ( $cluster->{'executable_setup_failed'} ) + { + mtr_report_test_name($tinfo); + $tinfo->{comment}= + "Failed to find cluster binaries"; + mtr_report_test_failed($tinfo); + return 1; + } + # If test needs this cluster, check it was installed ok if ( !$cluster->{'installed_ok'} ) { @@ -2769,6 +2807,20 @@ sub run_testcase_check_skip_test($) mtr_report_test_failed($tinfo); return 1; } + + } + } + + if ( $tinfo->{'component_id'} eq 'im' ) + { + # If test needs im, check binaries was found ok + if ( $instance_manager->{'executable_setup_failed'} ) + { + mtr_report_test_name($tinfo); + $tinfo->{comment}= + "Failed to find MySQL manager binaries"; + mtr_report_test_failed($tinfo); + return 1; } } From 788968a61b5a9a80d8716cacb2f28a36c8c29bcf Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 23 Oct 2006 12:16:40 +0200 Subject: [PATCH 05/21] If "var" is a symlink which does not point to anything, remove it before creating real var mysql-test/mysql-test-run.pl: If "var" is a symlink which does not point to anything, remove it --- mysql-test/mysql-test-run.pl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index acba4d843dd..f429bac850d 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1868,6 +1868,11 @@ sub kill_running_servers () { if ( ! -d $opt_vardir ) { + if ( -l $opt_vardir and ! -d readlink($opt_vardir) ) + { + mtr_report("Removing $opt_vardir symlink without destination"); + unlink($opt_vardir); + } # The "var" dir does not exist already # the processes that mtr_kill_leftovers start will write # their log files to var/log so it should be created From 88e5b3166dc4eb17bd4517fa47346ea2f6fefe4d Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 23 Oct 2006 12:56:25 +0200 Subject: [PATCH 06/21] When looking for libc the path need to be converted from wine to unix format before test that directory exists --- netware/BUILD/mwenv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netware/BUILD/mwenv b/netware/BUILD/mwenv index bc797c442ab..a60da17d987 100755 --- a/netware/BUILD/mwenv +++ b/netware/BUILD/mwenv @@ -27,8 +27,8 @@ WINE_BUILD_DIR="$base/$WINE_BUILD_DIR" echo "WINE_BUILD_DIR: $WINE_BUILD_DIR" # Look for libc, MySQL 5.0.x uses libc-2003 by default -libcdir="$MYDEV/libc-2003" -if test ! -d $libcdir +libc_dir="$MYDEV/libc-2003" +if [ ! -d `winepath $libc_dir` ] then # The libcdir didn't exist, set default libc_dir="$MYDEV/libc" From 394b27b6b415f0042829d99ba6557e3c5db6e601 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 23 Oct 2006 13:26:04 +0200 Subject: [PATCH 07/21] Netware uses size_t as socklen_t --- extra/yassl/testsuite/test.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extra/yassl/testsuite/test.hpp b/extra/yassl/testsuite/test.hpp index 0266c802657..b23b36f0ba2 100644 --- a/extra/yassl/testsuite/test.hpp +++ b/extra/yassl/testsuite/test.hpp @@ -27,9 +27,12 @@ #endif /* _WIN32 */ -#if !defined(_SOCKLEN_T) && (defined(_WIN32) || defined(__NETWARE__)) +#if !defined(_SOCKLEN_T) && defined(_WIN32) typedef int socklen_t; #endif +#if !defined(_SOCKLEN_T) && defined(__NETWARE__) + typedef size_t socklen_t; +#endif // Check type of third arg to accept From edf668e8fa76fe4558c43d54308c6a0cad59e325 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 23 Oct 2006 13:32:20 +0200 Subject: [PATCH 08/21] Don't use the "4.1 vardir trick" on OS that does not have native symlink(i.e 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 f429bac850d..c36a06f56ef 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -758,7 +758,8 @@ sub command_line_setup () { $opt_vardir= $default_vardir; } elsif ( $mysql_version_id < 50000 and - $opt_vardir ne $default_vardir ) + ! $glob_win32 and # No supported on platforms without native symlink + $opt_vardir ne $default_vardir) { # Version 4.1 and --vardir was specified # Only supported as a symlink from var/ From 13c55f3c1783d8820ad6f2c538a187b371b3017a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 23 Oct 2006 16:51:48 +0200 Subject: [PATCH 09/21] The vardir trick can only bge used on platforms with native symlinks - otherwise opt_vardir need to be set to default value. --- mysql-test/mysql-test-run.pl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index c36a06f56ef..84d84cf8f14 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -758,15 +758,19 @@ sub command_line_setup () { $opt_vardir= $default_vardir; } elsif ( $mysql_version_id < 50000 and - ! $glob_win32 and # No supported on platforms without native symlink $opt_vardir ne $default_vardir) { # Version 4.1 and --vardir was specified # Only supported as a symlink from var/ # by setting up $opt_mem that symlink will be created - $opt_mem= $opt_vardir; + if ( ! $glob_win32 ) + { + # Only platforms that have native symlinks can use the vardir trick + $opt_mem= $opt_vardir; + mtr_report("Using 4.1 vardir trick"); + } + $opt_vardir= $default_vardir; - mtr_report("Using 4.1 vardir trick"); } $path_vardir_trace= $opt_vardir; From f9ff7472a23d97cc7235b5396191b02aad37fc21 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 23 Oct 2006 20:36:44 +0200 Subject: [PATCH 10/21] Avoid matching the trailing carriage return when parsing the mysqld.spec file This fixes problem where --replace_result failed in rpl000015 because the MYSQL_TCP_PORT variable was "3306\r" mysql-test/mysql-test-run.pl: Avoid matching the trailing carriage return when parsing the mysqld.spec file --- mysql-test/mysql-test-run.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 84d84cf8f14..7f1f7a43b10 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1269,9 +1269,9 @@ sub collect_mysqld_features () { else { # Put variables into hash - if ( $line =~ /^([\S]+)[ \t]+(.*)$/ ) + if ( $line =~ /^([\S]+)[ \t]+(.*?)\r?$/ ) { - # print "$1=$2\n"; + # print "$1=\"$2\"\n"; $mysqld_variables{$1}= $2; } else From 0b381c94cb262958fa672f00c308099b227c1fbe Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 Oct 2006 10:43:15 +0200 Subject: [PATCH 11/21] When using yaSSL on NetWare some of the OpenSSL specifix hacks can be skipped vio/viossl.c: No need for special code to switch from WinSock to BSD sockets when using yaSSL vio/viosslfactories.c: The OpenSSL port to NetWare has added some extra functions to free up memory, no need to call them when using yaSSL --- vio/viossl.c | 5 +++++ vio/viosslfactories.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/vio/viossl.c b/vio/viossl.c index 9cc4523d32e..b5fd0e11c02 100644 --- a/vio/viossl.c +++ b/vio/viossl.c @@ -26,6 +26,10 @@ #ifdef HAVE_OPENSSL #ifdef __NETWARE__ + +/* yaSSL already uses BSD sockets */ +#ifndef HAVE_YASSL + /* The default OpenSSL implementation on NetWare uses WinSock. This code allows us to use the BSD sockets. @@ -47,6 +51,7 @@ static int SSL_set_fd_bsd(SSL *s, int fd) #define SSL_set_fd(A, B) SSL_set_fd_bsd((A), (B)) +#endif /* HAVE_YASSL */ #endif /* __NETWARE__ */ diff --git a/vio/viosslfactories.c b/vio/viosslfactories.c index 2c528e9a2fc..9fd18579351 100644 --- a/vio/viosslfactories.c +++ b/vio/viosslfactories.c @@ -180,11 +180,15 @@ void netware_ssl_cleanup() /* free memory from SSL_library_init() */ EVP_cleanup(); +/* OpenSSL NetWare port specific functions */ +#ifndef HAVE_YASSL + /* free global X509 method */ X509_STORE_method_cleanup(); /* free the thread_hash error table */ ERR_free_state_table(); +#endif } From 375b04b9fe8826bd666b49421b5176a9316039e8 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 Oct 2006 11:16:53 +0200 Subject: [PATCH 12/21] Temporary fixes for building from source dist in pushbuild netware/BUILD/compile-netware-END: If running as user pushbuild don't run autotools again netware/BUILD/mwenv: Set ARFLAGS to value of AR_FLAGS --- netware/BUILD/compile-netware-END | 9 +++++++-- netware/BUILD/mwenv | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/netware/BUILD/compile-netware-END b/netware/BUILD/compile-netware-END index a8d829499bd..6c531ab5c7c 100755 --- a/netware/BUILD/compile-netware-END +++ b/netware/BUILD/compile-netware-END @@ -18,8 +18,13 @@ rm -rf Makefile.in.bk # Setup Metrowerks environment . $path/mwenv -# Run autotools(use BUILD/autorun.sh) -. BUILD/autorun.sh +# Temporary hack to allow building from source dist +if [ ! "$USER"=pushbuild ] +then + # Run autotools(use BUILD/autorun.sh) + echo "Running autotools again(BUILD/autorun.sh)" + . BUILD/autorun.sh +fi # configure ./configure $base_configs $extra_configs diff --git a/netware/BUILD/mwenv b/netware/BUILD/mwenv index a60da17d987..a8d31949736 100755 --- a/netware/BUILD/mwenv +++ b/netware/BUILD/mwenv @@ -65,5 +65,11 @@ then export TERM=linux fi +# Temporary hack to allow building from source dist +if [ "$USER"=pushbuild ] +then + export ARFLAGS=$AR_FLAGS +fi + # Print all env. variables export From b0626431808b30a4dac6f5442157ad878c8caa93 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 Oct 2006 13:12:34 +0200 Subject: [PATCH 13/21] Replace all refernces to .la libraries with direct references to their .libs/*.a library Add comment describing why mwldnlm is called with "x" flag configure.in: Replace references to yassl .la libraries with direct reference to the .a libraries netware/BUILD/mwldnlm: Add comment about why mwldnlm is called with the "x" flag and how to avoid it --- configure.in | 4 ++++ netware/BUILD/mwldnlm | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/configure.in b/configure.in index 55da1dfb241..c050d31a917 100644 --- a/configure.in +++ b/configure.in @@ -1176,12 +1176,16 @@ EOF cat > $filesed << EOF s,\(\./conf_to_src\)\( \$(top_srcdir)\),\1.linux\2, s,\(: conf_to_src\),\1.linux, +s,libyassl.la,.libs/libyassl.a, +s,libtaocrypt.la,.libs/libtaocrypt.a, EOF ;; libmysql_r/Makefile.in) cat > $filesed << EOF s,\(\./conf_to_src\)\( \$(top_srcdir)\),\1.linux\2, s,\(: conf_to_src\),\1.linux, +s,libyassl.la,.libs/libyassl.a, +s,libtaocrypt.la,.libs/libtaocrypt.a, EOF ;; strings/Makefile.in) diff --git a/netware/BUILD/mwldnlm b/netware/BUILD/mwldnlm index cc8c9e63c6e..b1822827b59 100755 --- a/netware/BUILD/mwldnlm +++ b/netware/BUILD/mwldnlm @@ -3,6 +3,13 @@ # stop on errors set -e +# If libtool passes "x" as the first argument to this script +# it's an indication that libtool is trying to unpack .la's +# so they can be added to a new library +# This step does not work on Netware and we avoid it by +# replacing the .la library with the path to the .a library +# in Makefile.in + args=" $*" # NOTE: Option 'pipefail' is not standard sh From 7e1fcb649f9e2e7a113da14db8bd290c8dc97f66 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 Oct 2006 13:34:10 +0200 Subject: [PATCH 14/21] Enable the ATTRIBUTE_FORMAT macros to check format of variable arg parameters --- client/mysqltest.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 5bc132a874f..9f41586afae 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -398,13 +398,13 @@ TYPELIB command_typelib= {array_elements(command_names),"", DYNAMIC_STRING ds_res, ds_progress, ds_warning_messages; void die(const char *fmt, ...) - /* ATTRIBUTE_FORMAT(printf, 1, 2) */; + ATTRIBUTE_FORMAT(printf, 1, 2); void abort_not_supported_test(const char *fmt, ...) - /* ATTRIBUTE_FORMAT(printf, 1, 2) */; + ATTRIBUTE_FORMAT(printf, 1, 2); void verbose_msg(const char *fmt, ...) - /* ATTRIBUTE_FORMAT(printf, 1, 2) */; + ATTRIBUTE_FORMAT(printf, 1, 2); void warning_msg(const char *fmt, ...) - /* ATTRIBUTE_FORMAT(printf, 1, 2) */; + ATTRIBUTE_FORMAT(printf, 1, 2); VAR* var_from_env(const char *, const char *); VAR* var_init(VAR* v, const char *name, int name_len, const char *val, From 8b3f82322eafdd369861f52eaef95ee26780cf70 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 Oct 2006 13:52:50 +0200 Subject: [PATCH 15/21] Use same type for local variables as arguments, avoid compile error on NetWare --- client/mysqldump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 28a220bf61e..757bec09b50 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1195,7 +1195,7 @@ static void print_xml_tag(FILE * xml_file, const char* sbeg, const char* send, const char* first_attribute_name, ...) { va_list arg_list; - char *attribute_name, *attribute_value; + const char *attribute_name, *attribute_value; fputs(sbeg, xml_file); fputc('<', xml_file); @@ -1318,7 +1318,7 @@ static void print_xml_row(FILE *xml_file, const char *row_name, static void print_blob_as_hex(FILE *output_file, const char *str, ulong len) { /* sakaik got the idea to to provide blob's in hex notation. */ - char *ptr= str, *end= ptr + len; + const char *ptr= str, *end= ptr + len; for (; ptr < end ; ptr++) fprintf(output_file, "%02X", *((uchar *)ptr)); check_io(output_file); From e3936b1065c501e958986ab70c1bebc24785de19 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 Oct 2006 17:36:46 +0200 Subject: [PATCH 16/21] Add analyze_testcase_failure which is called when mysqltest has failed with error 1 and we are running with --force The specific "analyze" code is enclosed in a .test file fwich can easily be modified to be more advanced mysql-test/mysql-test-run.pl: Attempt to run some quick queries to analyze the failure when mysqltest returns 1 indicating test has failed Initially only code to analyze "could not sync with master" is added as that is a blackbox and all problems looks the same mysql-test/include/analyze_failure_sync_with_master.test: New BitKeeper file ``mysql-test/include/analyze_failure_sync_with_master.test'' --- .../analyze_failure_sync_with_master.test | 15 +++++ mysql-test/mysql-test-run.pl | 56 +++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 mysql-test/include/analyze_failure_sync_with_master.test diff --git a/mysql-test/include/analyze_failure_sync_with_master.test b/mysql-test/include/analyze_failure_sync_with_master.test new file mode 100644 index 00000000000..e6fd32d2f46 --- /dev/null +++ b/mysql-test/include/analyze_failure_sync_with_master.test @@ -0,0 +1,15 @@ +# Connect to both master and slave +connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,); +connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,); + +vertical_results; + +echo == MASTER ===========================================================; +connection master; +show master status; +show slave status; + +echo == SLAVE ===========================================================; +connection slave; +show master status; +show slave status; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 7f1f7a43b10..f88cd333b91 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2923,6 +2923,58 @@ sub find_testcase_skipped_reason($) } +sub analyze_testcase_failure_sync_with_master($) +{ + my ($tinfo)= @_; + mtr_verbose("analyze_testcase_failure_sync_with_master"); + print "analyze_testcase_failure_sync_with_master\n"; + + my $args; + mtr_init_args(\$args); + + mtr_add_arg($args, "--no-defaults"); + mtr_add_arg($args, "--silent"); + mtr_add_arg($args, "-v"); + mtr_add_arg($args, "--skip-safemalloc"); + mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir); + + mtr_add_arg($args, "--socket=%s", $master->[0]->{'path_sock'}); + mtr_add_arg($args, "--port=%d", $master->[0]->{'port'}); + mtr_add_arg($args, "--database=test"); + mtr_add_arg($args, "--user=%s", $opt_user); + mtr_add_arg($args, "--password="); + + # Run the test file and append output to log file + mtr_run_test($exe_mysqltest,$args, + "include/analyze_failure_sync_with_master.test", + "$path_timefile", "$path_timefile","", + { append_log_file => 1 }); + +} + +sub analyze_testcase_failure($) +{ + my ($tinfo)= @_; + + # Open mysqltest.log + my $F= IO::File->new($path_timefile) or + mtr_error("can't open file \"$path_timefile\": $!"); + + while ( my $line= <$F> ) + { + # Look for "mysqltest: At line nnn: + if ( $line =~ /mysqltest: At line [0-9]*: (.*)/ ) + { + my $error= $1; + # Look for "could not sync with master" + if ( $error =~ /could not sync with master/ ) + { + analyze_testcase_failure_sync_with_master($tinfo); + } + } + } +} + ############################################################################## # # Run a single test case @@ -3011,6 +3063,10 @@ sub run_testcase ($) { } elsif ( $res == 1 ) { + if ( $opt_force ) + { + analyze_testcase_failure($tinfo); + } # Test case failure reported by mysqltest report_failure_and_restart($tinfo); } From 1023e010587c63e3a7fb04b3dea804de5e556468 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 Oct 2006 17:54:45 +0200 Subject: [PATCH 17/21] Fix spelling errors in test files mysql-test/r/mysqldump-max.result: Update test result after fix of spelling error mysql-test/r/rpl_trigger.result: Update test result after fix of spelling error mysql-test/r/type_newdecimal.result: Update test result after fix of spelling error mysql-test/t/mysqldump-max.test: Fix spelling error "disable_warnings" Write shorter "drop table..." mysql-test/t/rpl_trigger.test: Fix spelling error, there is no --ignore_warnings mysql-test/t/type_newdecimal.test: Fix spelling error --- mysql-test/r/mysqldump-max.result | 19 +------------------ mysql-test/r/rpl_trigger.result | 2 -- mysql-test/r/type_newdecimal.result | 2 -- mysql-test/t/mysqldump-max.test | 11 +++-------- mysql-test/t/rpl_trigger.test | 2 +- mysql-test/t/type_newdecimal.test | 4 ++-- 6 files changed, 7 insertions(+), 33 deletions(-) diff --git a/mysql-test/r/mysqldump-max.result b/mysql-test/r/mysqldump-max.result index 78867d1e430..9ae3e368e28 100644 --- a/mysql-test/r/mysqldump-max.result +++ b/mysql-test/r/mysqldump-max.result @@ -1,21 +1,4 @@ -drop table if exists t1; -Warnings: -Note 1051 Unknown table 't1' -drop table if exists t2; -Warnings: -Note 1051 Unknown table 't2' -drop table if exists t3; -Warnings: -Note 1051 Unknown table 't3' -drop table if exists t4; -Warnings: -Note 1051 Unknown table 't4' -drop table if exists t5; -Warnings: -Note 1051 Unknown table 't5' -drop table if exists t6; -Warnings: -Note 1051 Unknown table 't6' +drop table if exists t1, t2, t3, t4, t5, t6; create table t1 (id int(8), name varchar(32)); create table t2 (id int(8), name varchar(32)) ENGINE="MyISAM"; create table t3 (id int(8), name varchar(32)) ENGINE="MEMORY"; diff --git a/mysql-test/r/rpl_trigger.result b/mysql-test/r/rpl_trigger.result index 49f0f5c4c44..3c740bf8e64 100644 --- a/mysql-test/r/rpl_trigger.result +++ b/mysql-test/r/rpl_trigger.result @@ -71,8 +71,6 @@ get_lock("bug12480",2) 1 create table t1 (a datetime,b datetime, c datetime); drop function if exists bug12480; -Warnings: -Note 1305 FUNCTION bug12480 does not exist create function bug12480() returns datetime begin set @a=get_lock("bug12480",2); diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index 33f1ece0390..84d2ea47298 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -978,8 +978,6 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; drop procedure if exists wg2; -Warnings: -Note 1305 PROCEDURE wg2 does not exist create procedure wg2() begin declare v int default 1; diff --git a/mysql-test/t/mysqldump-max.test b/mysql-test/t/mysqldump-max.test index fbea84808b4..359c4ea5793 100644 --- a/mysql-test/t/mysqldump-max.test +++ b/mysql-test/t/mysqldump-max.test @@ -3,14 +3,9 @@ --source include/have_innodb.inc --source include/have_archive.inc ---disable-warnings -drop table if exists t1; -drop table if exists t2; -drop table if exists t3; -drop table if exists t4; -drop table if exists t5; -drop table if exists t6; ---enable-warnings +--disable_warnings +drop table if exists t1, t2, t3, t4, t5, t6; +--enable_warnings create table t1 (id int(8), name varchar(32)); create table t2 (id int(8), name varchar(32)) ENGINE="MyISAM"; diff --git a/mysql-test/t/rpl_trigger.test b/mysql-test/t/rpl_trigger.test index 3c8cbb97b31..d6e9410b1d3 100644 --- a/mysql-test/t/rpl_trigger.test +++ b/mysql-test/t/rpl_trigger.test @@ -62,7 +62,7 @@ select get_lock("bug12480",2); connection default; create table t1 (a datetime,b datetime, c datetime); ---ignore_warnings +--disable_warnings drop function if exists bug12480; --enable_warnings diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test index de1ebd74d17..e4843c3b83e 100644 --- a/mysql-test/t/type_newdecimal.test +++ b/mysql-test/t/type_newdecimal.test @@ -1000,9 +1000,9 @@ drop table t1; # # Bug 12938 (arithmetic loop's zero) # ---disable-warnings +--disable_warnings drop procedure if exists wg2; ---enable-warnings +--enable_warnings delimiter //; create procedure wg2() begin From c58d8ffb4fd7eb86b663fd8f3831af70b5785cfb Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 Oct 2006 18:21:23 +0200 Subject: [PATCH 18/21] Test "rpl_ndb_auto_inc" need ndb - add "include/have_ndb.inc" mysql-test/t/rpl_ndb_auto_inc.test: Test need ndb --- mysql-test/t/rpl_ndb_auto_inc.test | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/t/rpl_ndb_auto_inc.test b/mysql-test/t/rpl_ndb_auto_inc.test index 0fc31de9b3a..53bb7e764f1 100644 --- a/mysql-test/t/rpl_ndb_auto_inc.test +++ b/mysql-test/t/rpl_ndb_auto_inc.test @@ -6,6 +6,7 @@ # Date: 2006-02-10 # Change: Augmented test to use with cluster ##################################### +--source include/have_ndb.inc --source include/master-slave.inc --source include/have_binlog_format_mixed_or_row.inc From 297d968a8c5b313c139c6d96b8bd26b57a7dc64c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 Oct 2006 18:49:19 +0200 Subject: [PATCH 19/21] Run mysql_client_test without --silent Flush both stdout and stderr before abort'ing mysql_client_test mysql-test/mysql-test-run.pl: Run mysql_client_test wihtout --silent flag tests/mysql_client_test.c: Before aborting mysql_client_test in die, make sure to first flush stdout and finally after the error message has been printed also fflush stderr --- mysql-test/mysql-test-run.pl | 2 +- tests/mysql_client_test.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index f88cd333b91..731d07c86c5 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1735,7 +1735,7 @@ sub environment_setup () { # Setup env so childs can execute mysql_client_test # ---------------------------------------------------- my $cmdline_mysql_client_test= - "$exe_mysql_client_test --no-defaults --testcase --user=root --silent " . + "$exe_mysql_client_test --no-defaults --testcase --user=root " . "--port=$master->[0]->{'port'} " . "--socket=$master->[0]->{'path_sock'}"; if ( $mysql_version_id >= 50000 ) diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 9fabde993b8..64c260666d3 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -113,7 +113,9 @@ static void client_disconnect(); void die(const char *file, int line, const char *expr) { + fflush(stdout); fprintf(stderr, "%s:%d: check failed: '%s'\n", file, line, expr); + fflush(stderr); abort(); } From 7941fdd0271e5e772d925105aefe283b03ab1ba0 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 Oct 2006 19:16:18 +0200 Subject: [PATCH 20/21] Bug#23037 Bug in field "Default" of query "SHOW COLUMNS FROM table" - Fix check in mysql_client_test to reflect the change of datatype for DEFAULT column tests/mysql_client_test.c: Update check of datatype for field DEFAULT returned from "explain" as datatype has changed after patch for bug 23037 --- tests/mysql_client_test.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 5a718b7bde9..96fdb9a4696 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -7497,10 +7497,22 @@ static void test_explain_bug() MYSQL_TYPE_STRING : MYSQL_TYPE_VAR_STRING, 0, 0, "", 3, 0); - verify_prepare_field(result, 4, "Default", "COLUMN_DEFAULT", - mysql_get_server_version(mysql) <= 50000 ? - MYSQL_TYPE_STRING : MYSQL_TYPE_VAR_STRING, - 0, 0, "", 64, 0); + if ( mysql_get_server_version(mysql) >= 50027 ) + { + /* The patch for bug#23037 changes column type of DEAULT to blob */ + verify_prepare_field(result, 4, "Default", "COLUMN_DEFAULT", + MYSQL_TYPE_BLOB, 0, 0, "", 0, 0); + } + else + { + verify_prepare_field(result, 4, "Default", "COLUMN_DEFAULT", + mysql_get_server_version(mysql) >= 50027 ? + MYSQL_TYPE_BLOB : + mysql_get_server_version(mysql) <= 50000 ? + MYSQL_TYPE_STRING : MYSQL_TYPE_VAR_STRING, + 0, 0, "", + mysql_get_server_version(mysql) >= 50027 ? 0 :64, 0); + } verify_prepare_field(result, 5, "Extra", "EXTRA", mysql_get_server_version(mysql) <= 50000 ? From c7cedcd645703c80b076bae316affa23cee5bf73 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 Oct 2006 19:22:27 +0200 Subject: [PATCH 21/21] Remove debug printout --- mysql-test/mysql-test-run.pl | 2 -- 1 file changed, 2 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 731d07c86c5..3046e5ba2fe 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2926,8 +2926,6 @@ sub find_testcase_skipped_reason($) sub analyze_testcase_failure_sync_with_master($) { my ($tinfo)= @_; - mtr_verbose("analyze_testcase_failure_sync_with_master"); - print "analyze_testcase_failure_sync_with_master\n"; my $args; mtr_init_args(\$args);