List:Commits« Previous MessageNext Message »
From:Davi Arnaut Date:December 4 2009 4:00pm
Subject:bzr push into mysql-5.1-bugteam branch (davi:3244 to 3245) Bug#41569
View as plain text  
 3245 Davi Arnaut	2009-12-04
      Bug#41569: mysql_upgrade (ver 5.1) add 3 fields to mysql.proc table but does not set values
      
      Post-merge fix: Redirect stderr to a file as to avoid buffering
      problems due to redirecting stderr to stdout.
     @ mysql-test/r/mysql_upgrade.result
        Update test case result.
     @ mysql-test/t/mysql_upgrade.test
        Redirect stderr to a file, cat and remove.

    modified:
      mysql-test/r/mysql_upgrade.result
      mysql-test/t/mysql_upgrade.test
 3244 Alfranio Correia	2009-12-04
      BUG#45292 orphan binary log created when starting server twice
      
      This patch fixes three bugs as follows. First, aborting the server while purging
      binary logs might generate orphan files due to how the purge operation was
      implemented:
      
                (purge routine - sql/log.cc - MYSQL_BIN_LOG::purge_logs)
      
            1 - register the files to be removed in a temporary buffer.
            2 - update the log-bin.index.
            3 - flush the log-bin.index.
            4 - erase the files whose names where register in the temporary buffer
            in step 1.
      
      Thus a failure while  executing step 4 would generate an orphan file. Second,
      a similar issue might happen while creating a new binary as follows:
      
                (create routine - sql/log.cc - MYSQL_BIN_LOG::open)
      
            1 - open the new log-bin.
            2 - update the log-bin.index.
      
      Thus a failure while executing step 1 would generate an orphan file.
      
      To fix these issues, we record the files to be purged or created before really
      removing or adding them. So if a failure happens such records can be used to
      automatically remove dangling files. The new steps might be outlined as follows:
      
                (purge routine - sql/log.cc - MYSQL_BIN_LOG::purge_logs)
      
            1 - register the files to be removed in the log-bin.~rec~ placed in
            the data directory.
            2 - update the log-bin.index.
            3 - flush the log-bin.index.
            4 - delete the log-bin.~rec~.
      
                (create routine - sql/log.cc - MYSQL_BIN_LOG::open)
      
            1 - register the file to be created in the log-bin.~rec~
            placed in the data directory.
            2 - open the new log-bin.
            3 - update the log-bin.index.
            4 - delete the log-bin.~rec~.
      
                (recovery routine - sql/log.cc - MYSQL_BIN_LOG::open_index_file)
      
            1 - open the log-bin.index.
            2 - open the log-bin.~rec~.
            3 - for each file in log-bin.~rec~.
              3.1 Check if the file is in the log-bin.index and if so ignore it.
              3.2 Otherwise, delete it.
      
      The third issue can be described as follows. The purge operation was allowing
      to remove a file in use thus leading to the loss of data and possible
      inconsistencies between the master and slave. Roughly, the routine was only
      taking into account the dump threads and so if a slave was not connect the
      file might be delete even though it was in use.

    modified:
      mysql-test/suite/binlog/r/binlog_index.result
      mysql-test/suite/binlog/t/binlog_index.test
      sql/log.cc
      sql/log.h
      sql/mysqld.cc
      sql/rpl_rli.cc
=== modified file 'mysql-test/r/mysql_upgrade.result'
--- a/mysql-test/r/mysql_upgrade.result	2009-12-03 16:15:47 +0000
+++ b/mysql-test/r/mysql_upgrade.result	2009-12-04 16:00:20 +0000
@@ -135,9 +135,6 @@ CREATE PROCEDURE testproc() BEGIN END;
 UPDATE mysql.proc SET character_set_client = NULL WHERE name LIKE 'testproc';
 UPDATE mysql.proc SET collation_connection = NULL WHERE name LIKE 'testproc';
 UPDATE mysql.proc SET db_collation = NULL WHERE name LIKE 'testproc';
-WARNING: NULL values of the 'character_set_client' column ('mysql.proc' table) have been updated with a default value (latin1). Please verify if necessary.
-WARNING: NULL values of the 'collation_connection' column ('mysql.proc' table) have been updated with a default value (latin1_swedish_ci). Please verify if necessary.
-WARNING: NULL values of the 'db_collation' column ('mysql.proc' table) have been updated with default values. Please verify if necessary.
 mtr.global_suppressions                            OK
 mtr.test_suppressions                              OK
 mysql.columns_priv                                 OK
@@ -169,3 +166,6 @@ mysql.time_zone_transition_type         
 mysql.user                                         OK
 CALL testproc();
 DROP PROCEDURE testproc;
+WARNING: NULL values of the 'character_set_client' column ('mysql.proc' table) have been updated with a default value (latin1). Please verify if necessary.
+WARNING: NULL values of the 'collation_connection' column ('mysql.proc' table) have been updated with a default value (latin1_swedish_ci). Please verify if necessary.
+WARNING: NULL values of the 'db_collation' column ('mysql.proc' table) have been updated with default values. Please verify if necessary.

=== modified file 'mysql-test/t/mysql_upgrade.test'
--- a/mysql-test/t/mysql_upgrade.test	2009-12-03 16:15:47 +0000
+++ b/mysql-test/t/mysql_upgrade.test	2009-12-04 16:00:20 +0000
@@ -103,6 +103,8 @@ CREATE PROCEDURE testproc() BEGIN END;
 UPDATE mysql.proc SET character_set_client = NULL WHERE name LIKE 'testproc';
 UPDATE mysql.proc SET collation_connection = NULL WHERE name LIKE 'testproc';
 UPDATE mysql.proc SET db_collation = NULL WHERE name LIKE 'testproc';
---exec $MYSQL_UPGRADE --skip-verbose --force 2>&1
+--exec $MYSQL_UPGRADE --skip-verbose --force 2> $MYSQLTEST_VARDIR/tmp/41569.txt
 CALL testproc();
 DROP PROCEDURE testproc;
+--cat_file $MYSQLTEST_VARDIR/tmp/41569.txt
+--remove_file $MYSQLTEST_VARDIR/tmp/41569.txt


Attachment: [text/bzr-bundle] bzr/davi.arnaut@sun.com-20091204160020-z1t29xz3x6clazif.bundle
Thread
bzr push into mysql-5.1-bugteam branch (davi:3244 to 3245) Bug#41569Davi Arnaut4 Dec