List:Commits« Previous MessageNext Message »
From:Nirbhay Choubey Date:November 15 2011 12:36pm
Subject:bzr push into mysql-5.5 branch (nirbhay.choubey:3607 to 3608) Bug#11827359
View as plain text  
 3608 Nirbhay Choubey	2011-11-15
      Bug#11827359 60223: MYSQL_UPGRADE PROBLEM WITH
                          OPTION SKIP-WRITE-BINLOG
      
      System tables were not getting upgraded when
      mysql_upgrade was run with --skip-write-binlog
      option. (Same for --write-binlog.) Also, with
      this option, mysql_upgrade_info file was not
      getting created after the upgrade.
      
      mysql_upgrade makes use of mysql client tool in
      order to run upgrade scripts, while doing so it
      passes some of the command line options (used to
      start mysql_upgrade) directly to mysql client.
      The reason behind this bug being, some options
      like skip-write-binlog and upgrade-system-tables
      were being passed to mysql tool along with other
      options, and hence mysql execution failed due
      presence of these invalid options.
      
      Fixed this issue by filtering out the above mentioned
      options from the list of options that will be passed to
      mysql and mysqlcheck tools. However, since --write-binlog
      is supported by mysqlcheck, this option would be used
      explicitly while running mysqlcheck. (not part of patch,
      already there)
      
      Checking the contents of general log after the upgrade
      is not doable via an mtr test. So performed manual test.
      Added a test to verify the creation of mysql_upgrade_info.
     @ client/mysql_upgrade.c
        Bug#11827359 60223: MYSQL_UPGRADE PROBLEM WITH
                            OPTION SKIP-WRITE-BINLOG
        
        With this patch, --upgrade-system-tables and
        --write-binlog options will not be added to the
        list of options, used to start mysql and mysqlcheck
        tools.
     @ mysql-test/r/mysql_upgrade.result
        Added a testcase for Bug#11827359.
     @ mysql-test/t/mysql_upgrade.test
        Added a testcase for Bug#11827359.

    modified:
      client/mysql_upgrade.c
      mysql-test/r/mysql_upgrade.result
      mysql-test/t/mysql_upgrade.test
 3607 Tor Didriksen	2011-11-15
      Bug#13261955 TRUNCATE(DBL_MAX) RETURNS DBL_MAX RATHER THAN 'INF'
      
      my_double_round(DBL_MAX, -12, ....)
      should return 'inf' rather than DBL_MAX
      
      The problem is that floor(value/tmp) * tmp
      is inlined, and optimized away.
      
      The solution seems to be to prevent inlining by pre-computing value/tmp and
      storing it in a variable.
      
      No new test case: main.type_float fails without this patch.

    modified:
      sql/item_func.cc
=== modified file 'client/mysql_upgrade.c'
--- a/client/mysql_upgrade.c	2011-07-22 07:50:44 +0000
+++ b/client/mysql_upgrade.c	2011-11-15 12:18:42 +0000
@@ -286,6 +286,8 @@ get_one_option(int optid, const struct m
 
   case 'v': /* --verbose   */
   case 'f': /* --force     */
+  case 's':                                     /* --upgrade-system-tables */
+  case OPT_WRITE_BINLOG:                        /* --write-binlog */
     add_option= FALSE;
     break;
 

=== modified file 'mysql-test/r/mysql_upgrade.result'
--- a/mysql-test/r/mysql_upgrade.result	2010-12-17 11:11:34 +0000
+++ b/mysql-test/r/mysql_upgrade.result	2011-11-15 12:18:42 +0000
@@ -194,3 +194,36 @@ GRANT ALL PRIVILEGES ON `roelt`.`test2` 
 DROP USER 'user3'@'%';
 End of 5.1 tests
 The --upgrade-system-tables option was used, databases won't be touched.
+#
+# Bug#11827359 60223: MYSQL_UPGRADE PROBLEM WITH OPTION
+#                     SKIP-WRITE-BINLOG
+#
+# Droping the previously created mysql_upgrade_info file..
+# Running mysql_upgrade with --skip-write-binlog..
+mtr.global_suppressions                            OK
+mtr.test_suppressions                              OK
+mysql.columns_priv                                 OK
+mysql.db                                           OK
+mysql.event                                        OK
+mysql.func                                         OK
+mysql.general_log                                  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.proxies_priv                                 OK
+mysql.servers                                      OK
+mysql.slow_log                                     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
+End of tests

=== modified file 'mysql-test/t/mysql_upgrade.test'
--- a/mysql-test/t/mysql_upgrade.test	2010-08-11 17:56:56 +0000
+++ b/mysql-test/t/mysql_upgrade.test	2011-11-15 12:18:42 +0000
@@ -102,5 +102,24 @@ DROP USER 'user3'@'%';
 # Test the --upgrade-system-tables option
 #
 --replace_result $MYSQLTEST_VARDIR var
---exec $MYSQL_UPGRADE --skip-verbose --upgrade-system-tables
+--exec $MYSQL_UPGRADE --skip-verbose --force --upgrade-system-tables
 
+--echo #
+--echo # Bug#11827359 60223: MYSQL_UPGRADE PROBLEM WITH OPTION
+--echo #                     SKIP-WRITE-BINLOG
+--echo #
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+
+--echo # Droping the previously created mysql_upgrade_info file..
+--remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+
+--echo # Running mysql_upgrade with --skip-write-binlog..
+--replace_result $MYSQLTEST_VARDIR var
+--exec $MYSQL_UPGRADE --skip-verbose --skip-write-binlog
+
+# mysql_upgrade must have created mysql_upgrade_info file,
+# so the following command should never fail.
+--remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+
+--echo End of tests

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.5 branch (nirbhay.choubey:3607 to 3608) Bug#11827359Nirbhay Choubey16 Nov