MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Hema Sridharan Date:September 1 2009 3:51pm
Subject:bzr commit into mysql-6.0-backup branch (hema:2866) Bug#42756 Bug#46982
View as plain text  
#At file:///export/home/tmp/mysql-0828/mysql-6.0-backup/ based on revid:jorgen.loland@stripped

 2866 Hema Sridharan	2009-09-01
      BUG#46982 (There is no test in backup suite that
      performs BACKUP DATABASE * TO 'image' and  
      RESTORE FROM 'image')
      This patch will add new test backup_all.test in 
      backup suite. This test is added as exprimental because
      of bug#42756.
      added:
        mysql-test/suite/backup/r/backup_all.result
        mysql-test/suite/backup/t/backup_all.test
      modified:
        mysql-test/collections/default.experimental

per-file messages:
  mysql-test/suite/backup/r/backup_all.result
    Result file for backup_all.test
  mysql-test/suite/backup/t/backup_all.test
    New test file that will verify BACKUP DATABASE * TO 'image' and RESTORE FROM 'image'
=== modified file 'mysql-test/collections/default.experimental'
--- a/mysql-test/collections/default.experimental	2009-08-04 09:00:23 +0000
+++ b/mysql-test/collections/default.experimental	2009-09-01 15:50:53 +0000
@@ -1,5 +1,6 @@
 backup.backup_external_non_win           # BUG#45877
 backup.backup_external_non_win_not_falcon # BUG#45877
+backup.backup_all                         # BUG#42756
 
 binlog.binlog_tmp_table                  # Bug#45578 2009-07-10 alik Test binlog_tmp_table fails ramdonly on PB2: Unknown table 't2'
 

=== added file 'mysql-test/suite/backup/r/backup_all.result'
--- a/mysql-test/suite/backup/r/backup_all.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/backup/r/backup_all.result	2009-09-01 15:50:53 +0000
@@ -0,0 +1,75 @@
+DROP DATABASE IF EXISTS db1;
+DROP DATABASE IF EXISTS db2;
+DROP DATABASE IF EXISTS db3;
+# Create database
+CREATE DATABASE db1;
+CREATE DATABASE db2;
+CREATE DATABASE db3;
+# Create tables in database
+CREATE TABLE db1.t1(id INT);
+CREATE TABLE db1.t2(a CHAR(5));
+CREATE TABLE db2.t1(id INT);
+CREATE TABLE db2.t2(a CHAR(5));
+CREATE TABLE db3.t1(id INT);
+CREATE TABLE db3.t2(a CHAR(5));
+# Check the databases and tables
+SHOW DATABASES;
+Database
+information_schema
+db1
+db2
+db3
+mtr
+mysql
+test
+SHOW TABLES FROM db1;
+Tables_in_db1
+t1
+t2
+SHOW TABLES FROM db2;
+Tables_in_db2
+t1
+t2
+SHOW TABLES FROM db3;
+Tables_in_db3
+t1
+t2
+# Perform backup
+BACKUP DATABASE * TO 'alldb.bak';
+backup_id
+#
+# Drop database and perform restore
+DROP DATABASE db1;
+DROP DATABASE db2;
+DROP DATABASE db3;
+DROP DATABASE test;
+DROP DATABASE mtr;
+RESTORE FROM 'alldb.bak';
+backup_id
+#
+# Check that all the databases are restored
+SHOW DATABASES;
+Database
+information_schema
+db1
+db2
+db3
+mtr
+mysql
+test
+SHOW TABLES FROM db1;
+Tables_in_db1
+t1
+t2
+SHOW TABLES FROM db2;
+Tables_in_db2
+t1
+t2
+SHOW TABLES FROM db3;
+Tables_in_db3
+t1
+t2
+# Test clean-up section
+DROP DATABASE db1;
+DROP DATABASE db2;
+DROP DATABASE db3;

=== added file 'mysql-test/suite/backup/t/backup_all.test'
--- a/mysql-test/suite/backup/t/backup_all.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/backup/t/backup_all.test	2009-09-01 15:50:53 +0000
@@ -0,0 +1,78 @@
+# This test is performed for BUG#46982
+# The primary goal of this test is to execute BACKUP DATABASE * TO 'image' and
+# then RESTORE FROM 'image'
+
+--source include/not_embedded.inc
+
+--disable_warnings
+DROP DATABASE IF EXISTS db1;
+DROP DATABASE IF EXISTS db2;
+DROP DATABASE IF EXISTS db3;
+
+let $MYSQLD_BACKUPDIR= `select @@backupdir`;
+--error 0,1
+remove_file $MYSQLD_BACKUPDIR/alldb.bak;
+--enable_warnings
+
+--echo # Create database
+
+CREATE DATABASE db1;
+CREATE DATABASE db2;
+CREATE DATABASE db3;
+
+--echo # Create tables in database
+
+CREATE TABLE db1.t1(id INT);
+CREATE TABLE db1.t2(a CHAR(5));
+
+CREATE TABLE db2.t1(id INT);
+CREATE TABLE db2.t2(a CHAR(5));
+
+CREATE TABLE db3.t1(id INT);
+CREATE TABLE db3.t2(a CHAR(5));
+
+--echo # Check the databases and tables
+
+SHOW DATABASES;
+SHOW TABLES FROM db1;
+SHOW TABLES FROM db2;
+SHOW TABLES FROM db3;
+
+--echo # Perform backup
+# BACKUP DATABASE * performs backup of all the databases in the server
+
+--replace_column 1 #
+BACKUP DATABASE * TO 'alldb.bak';
+
+--echo # Drop database and perform restore
+
+DROP DATABASE db1;
+DROP DATABASE db2;
+DROP DATABASE db3;
+DROP DATABASE test;
+DROP DATABASE mtr;
+
+# Note that restore will produce warnings because of BUG#46765
+# BUG#46765 :Restore throws warnings when performing backup of test database
+# One this bug is fixed, restore should not produce any warning. Also remove
+# disable_warnings, enable_warnings and replace_regex from below lines while
+# performing restore.
+
+--disable_warnings
+--replace_column 1 #
+RESTORE FROM 'alldb.bak';
+--enable_warnings
+
+--echo # Check that all the databases are restored
+
+SHOW DATABASES;
+SHOW TABLES FROM db1;
+SHOW TABLES FROM db2;
+SHOW TABLES FROM db3;
+
+--echo # Test clean-up section
+
+DROP DATABASE db1;
+DROP DATABASE db2;
+DROP DATABASE db3;
+--remove_file $MYSQLD_BACKUPDIR/alldb.bak

Thread
bzr commit into mysql-6.0-backup branch (hema:2866) Bug#42756 Bug#46982Hema Sridharan1 Sep