List:Commits« Previous MessageNext Message »
From:Chuck Bell Date:March 3 2009 10:25pm
Subject:bzr commit into mysql-6.0-backup branch (charles.bell:2783) Bug#39655
View as plain text  
#At file:///C:/source/bzr/mysql-6.0-bug-39655/ based on revid:ingo.struewing@stripped

 2783 Chuck Bell	2009-03-03
      BUG#39655 : The mysql_upgrade process does not remove old online_backup tables
      
      This patch adds to the scripts mysql_upgrade uses to
      upgrade the mysql database tables. Specifically, it
      adds the drops to drop the old mysql online backup
      progress tables (online_backup, online_backup_progress).
      added:
        mysql-test/suite/backup/r/backup_mysql_upgrade.result
        mysql-test/suite/backup/t/backup_mysql_upgrade.test
      modified:
        scripts/mysql_system_tables.sql

per-file messages:
  mysql-test/suite/backup/r/backup_mysql_upgrade.result
    New result file.
  mysql-test/suite/backup/t/backup_mysql_upgrade.test
    New test to simulate upgrade of mysql backup logs from previous 
    releases.
  scripts/mysql_system_tables.sql
    Added drops for dropping old mysql progress tables.
=== added file 'mysql-test/suite/backup/r/backup_mysql_upgrade.result'
--- a/mysql-test/suite/backup/r/backup_mysql_upgrade.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/backup/r/backup_mysql_upgrade.result	2009-03-03 22:25:06 +0000
@@ -0,0 +1,49 @@
+# Create the old mysql progress tables.
+CREATE TABLE mysql.online_backup (a int);
+CREATE TABLE mysql.online_backup_progress (a int);
+# Check to see if old tables exist.
+SHOW TABLES FROM mysql LIKE 'online%';
+Tables_in_mysql (online%)
+online_backup
+online_backup_progress
+# Run mysql_upgrade once
+mtr.global_suppressions                            OK
+mtr.test_suppressions                              OK
+mysql.backup_history
+Error    : You can't use locks with log tables.
+status   : OK
+mysql.backup_progress
+Error    : You can't use locks with log tables.
+status   : 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.online_backup                                OK
+mysql.online_backup_progress                       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
+# Check to see if old tables exist.
+SHOW TABLES FROM mysql LIKE 'online%';
+Tables_in_mysql (online%)

=== added file 'mysql-test/suite/backup/t/backup_mysql_upgrade.test'
--- a/mysql-test/suite/backup/t/backup_mysql_upgrade.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/backup/t/backup_mysql_upgrade.test	2009-03-03 22:25:06 +0000
@@ -0,0 +1,24 @@
+#
+# Test upgrade of the backup logs.
+#
+
+--source include/not_embedded.inc
+--require r/have_mysql_upgrade.result
+
+--disable_query_log
+select LENGTH("$MYSQL_UPGRADE")>0 as have_mysql_upgrade;
+--enable_query_log
+
+--echo # Create the old mysql progress tables.
+CREATE TABLE mysql.online_backup (a int);
+CREATE TABLE mysql.online_backup_progress (a int);
+
+--echo # Check to see if old tables exist.
+SHOW TABLES FROM mysql LIKE 'online%';
+
+--echo # Run mysql_upgrade once
+--exec $MYSQL_UPGRADE --skip-verbose --force --user=root 2>&1
+
+--echo # Check to see if old tables exist.
+SHOW TABLES FROM mysql LIKE 'online%';
+

=== modified file 'scripts/mysql_system_tables.sql'
--- a/scripts/mysql_system_tables.sql	2009-02-02 12:28:30 +0000
+++ b/scripts/mysql_system_tables.sql	2009-03-03 22:25:06 +0000
@@ -82,6 +82,13 @@ DROP PREPARE stmt;
 
 CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode  set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','!
 NOT_USED'
 
+#
+# Remove the old backup progress tables.
+#
+DROP TABLE IF EXISTS mysql.online_backup;
+
+DROP TABLE IF EXISTS mysql.online_backup_progress;
+
 CREATE TABLE IF NOT EXISTS backup_history ( backup_id BIGINT UNSIGNED NOT NULL COMMENT 'Surrogate key for (near) duplicate entries', process_id INT UNSIGNED NOT NULL COMMENT 'The process id that operation ran as', binlog_pos INT UNSIGNED  NOT NULL DEFAULT 0 COMMENT 'The recorded binlog position of backup/restore', binlog_file CHAR(64)  NOT NULL DEFAULT '' COMMENT 'The recorded binlog filename at time of backup/restore', backup_state ENUM('complete', 'starting', 'validity point', 'running', 'error', 'cancel') NOT NULL COMMENT 'Status of current operation', operation ENUM('backup', 'restore') NOT NULL COMMENT 'Type of operation', error_num INT NOT NULL DEFAULT 0 COMMENT 'The error from this run 0 == none', num_objects INT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'The number of objects in the backup', total_bytes BIGINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'The size of the backup repository in bytes', validity_point_time datetime NOT NULL DEFAULT 0 COMMENT 'The time of the validity !
 point.', 
 
 CREATE TABLE IF NOT EXISTS backup_progress ( backup_id BIGINT UNSIGNED NOT NULL COMMENT 'Key for backup_history table entries', object CHAR (30) NOT NULL DEFAULT '' COMMENT 'The object being operated on', start_time datetime NOT NULL DEFAULT 0 COMMENT 'The date/time of start of operation', stop_time datetime NOT NULL DEFAULT 0 COMMENT 'The date/time of end of operation', total_bytes BIGINT NOT NULL DEFAULT 0 COMMENT 'The size of the object in bytes', progress BIGINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'The number of bytes processed', error_num INT NOT NULL DEFAULT 0 COMMENT 'The error from this run 0 == none', notes CHAR(100) NOT NULL DEFAULT '' COMMENT 'Commentary from the backup engine') ENGINE=CSV DEFAULT CHARACTER SET utf8;

Thread
bzr commit into mysql-6.0-backup branch (charles.bell:2783) Bug#39655Chuck Bell3 Mar