List:Commits« Previous MessageNext Message »
From:Guilhem Bichot Date:August 11 2010 5:57pm
Subject:bzr commit into mysql-5.5 branch (guilhem.bichot:3078) Bug#55672
View as plain text  
#At file:///home/mysql_src/bzrrepos_new/mysql-5.5/ based on revid:alik@ibmvm-20100804081425-u3d3gh1urrrxcd5k

 3078 Guilhem Bichot	2010-08-11
      fix for Bug #55672 "mysql_upgrade dies with internal error":
      it couldn't parse the --ssl option.
     @ client/mysql_upgrade.c
        mysql_upgrade parses its options and passes some of them to the underlying
        tools (mysqlcheck etc). To do this passdown, it reconstructs a
        command-line-suitable text from the my_option object (which
        contains the option's name and option's value). For options
        which expect no parameter, it just had to use the option's name;
        for other options, it had to concatenate the option's name,
        a "=" symbol, and the option's value; it had code to handle
        this latter case, but only for GET_STR options (options taking a
        string as value). But since the work on WL 4738, the --ssl
        option, a GET_BOOL, which used to have no parameter (NO_ARG), can
        now have one (OPT_ARG), so with --ssl we came to the "default"
        label, error. Fixed by constructing the command-line-suitable
        representation for GET_BOOL too. For --ssl it will produce
        --ssl=1 ; for --ssl=0, it will produce --ssl=0.
     @ mysql-test/include/mysql_upgrade_preparation.inc
        handles requirements of tests which use mysql_upgrade
     @ mysql-test/r/mysql_upgrade_ssl.result
        result; without the code fix we would get "internal error".
     @ mysql-test/t/mysql_upgrade.test
        This test has requirements before running; moved them
        to an include file in order to share with mysql_upgrade_ssl.
     @ mysql-test/t/mysql_upgrade_ssl.test
        test for bug. Couldn't go into mysql_upgrade.test as this new test requires
        SSL support. --force is needed, in case mysql_upgrade.test run before
        (in which case mysql_upgrade_ssl would say that upgrade has already been
        done); --force forces the upgrade in all cases.

    added:
      mysql-test/include/mysql_upgrade_preparation.inc
      mysql-test/r/mysql_upgrade_ssl.result
      mysql-test/t/mysql_upgrade_ssl.test
    modified:
      client/mysql_upgrade.c
      mysql-test/t/mysql_upgrade.test
=== modified file 'client/mysql_upgrade.c'
--- a/client/mysql_upgrade.c	2010-07-20 19:30:10 +0000
+++ b/client/mysql_upgrade.c	2010-08-11 17:56:56 +0000
@@ -209,6 +209,9 @@ static void add_one_option(DYNAMIC_STRIN
     case GET_STR:
       arg= argument;
       break;
+    case GET_BOOL:
+      arg= (*(my_bool *)opt->value) ? "1" : "0";
+      break;
     default:
       die("internal error at %s: %d",__FILE__, __LINE__);
     }

=== added file 'mysql-test/include/mysql_upgrade_preparation.inc'
--- a/mysql-test/include/mysql_upgrade_preparation.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/mysql_upgrade_preparation.inc	2010-08-11 17:56:56 +0000
@@ -0,0 +1,30 @@
+# Include this in any test using mysql_upgrade
+
+# Can't run test of external client with embedded server
+-- source include/not_embedded.inc
+
+# Only run test if "mysql_upgrade" is found
+--require r/have_mysql_upgrade.result
+--disable_query_log
+select LENGTH("$MYSQL_UPGRADE")>0 as have_mysql_upgrade;
+--enable_query_log
+
+#
+# Hack:
+#
+# If running with Valgrind ($VALGRIND_TEST <> 0) then the resource
+# consumption (CPU) for upgrading a large log table will be intense.
+# Therefore, truncate the log table in advance and issue a statement
+# that should be logged.
+#
+if (`SELECT $VALGRIND_TEST`)
+{
+  --disable_query_log
+  --disable_result_log
+  --disable_abort_on_error
+  TRUNCATE TABLE mysql.general_log;
+  SELECT 1;
+  --enable_abort_on_error
+  --enable_result_log
+  --enable_query_log
+}

=== added file 'mysql-test/r/mysql_upgrade_ssl.result'
--- a/mysql-test/r/mysql_upgrade_ssl.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/mysql_upgrade_ssl.result	2010-08-11 17:56:56 +0000
@@ -0,0 +1,32 @@
+#
+# Bug#55672 mysql_upgrade dies with internal error 
+#
+mtr.global_suppressions                            OK
+mtr.test_suppressions                              OK
+mysql.columns_priv                                 OK
+mysql.db                                           OK
+mysql.event                                        OK
+mysql.func                                         OK
+mysql.general_log
+Error    : You can't use locks with log tables.
+status   : OK
+mysql.help_category                                OK
+mysql.help_keyword                                 OK
+mysql.help_relation                                OK
+mysql.help_topic                                   OK
+mysql.host                                         OK
+mysql.ndb_binlog_index                             OK
+mysql.plugin                                       OK
+mysql.proc                                         OK
+mysql.procs_priv                                   OK
+mysql.servers                                      OK
+mysql.slow_log
+Error    : You can't use locks with log tables.
+status   : OK
+mysql.tables_priv                                  OK
+mysql.time_zone                                    OK
+mysql.time_zone_leap_second                        OK
+mysql.time_zone_name                               OK
+mysql.time_zone_transition                         OK
+mysql.time_zone_transition_type                    OK
+mysql.user                                         OK

=== modified file 'mysql-test/t/mysql_upgrade.test'
--- a/mysql-test/t/mysql_upgrade.test	2010-07-05 10:22:13 +0000
+++ b/mysql-test/t/mysql_upgrade.test	2010-08-11 17:56:56 +0000
@@ -1,31 +1,4 @@
-# Can't run test of external client with embedded server
--- source include/not_embedded.inc
-
-# Only run test if "mysql_upgrade" is found
---require r/have_mysql_upgrade.result
---disable_query_log
-select LENGTH("$MYSQL_UPGRADE")>0 as have_mysql_upgrade;
---enable_query_log
-
-#
-# Hack:
-#
-# If running with Valgrind ($VALGRIND_TEST <> 0) then the resource
-# consumption (CPU) for upgrading a large log table will be intense.
-# Therefore, truncate the log table in advance and issue a statement
-# that should be logged.
-#
-if (`SELECT $VALGRIND_TEST`)
-{
-  --disable_query_log
-  --disable_result_log
-  --disable_abort_on_error
-  TRUNCATE TABLE mysql.general_log;
-  SELECT 1;
-  --enable_abort_on_error
-  --enable_result_log
-  --enable_query_log
-}
+-- source include/mysql_upgrade_preparation.inc
 
 #
 # Basic test that we can run mysql_upgrde and that it finds the

=== added file 'mysql-test/t/mysql_upgrade_ssl.test'
--- a/mysql-test/t/mysql_upgrade_ssl.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/mysql_upgrade_ssl.test	2010-08-11 17:56:56 +0000
@@ -0,0 +1,10 @@
+# mysql_upgrade tests requiring SSL support
+
+-- source include/have_ssl_communication.inc
+-- source include/mysql_upgrade_preparation.inc
+
+--echo #
+--echo # Bug#55672 mysql_upgrade dies with internal error 
+--echo #
+--exec $MYSQL_UPGRADE --skip-verbose --ssl --force 2>&1
+--exit


Attachment: [text/bzr-bundle] bzr/guilhem.bichot@oracle.com-20100811175656-ly3qslouqe3nhl3c.bundle
Thread
bzr commit into mysql-5.5 branch (guilhem.bichot:3078) Bug#55672Guilhem Bichot11 Aug