List:Commits« Previous MessageNext Message »
From:Ritheesh Vedire Date:September 30 2009 1:41pm
Subject:bzr commit into mysql-6.0-backup branch (ritheesh.vedire:2876)
Bug#45587
View as plain text  
#At file:///home/rith/Work/MySQl/bug45587/ based on revid:rafal.somla@stripped

 2876 Ritheesh Vedire	2009-09-30
      Bug#45587 Backup of tables using a non-existent storage engine
      does not give warning/error
      
       This happens because backup engine does not know the existence of
      all invalid tables
     @ mysql-test/suite/backup/t/backup_no_engine.test
        The test file was edited and RESTORE command is removed ( as there is no point in restoring if backup fails) . This test reports errors for unidentified storage engines
     @ sql/si_objects.cc
        The query s_stream in the function obs::get_db_tables() (file:
        si_objects.cc):
                
                    SELECT <db_name>, table_name FROM INFORMATION_SCHEMA.TABLES
                    WHERE table_schema = '<db_name>' AND table_type = 'BASE
        TABLE';
                
                does not return invalid tables  . See bug#47697
                
                So I have changed the query , to get all the tables
        including invalid ones from the information_schema.tables. After that
        back up engine knows about invalid tables and throws error messages. 
                
                This fix is temporary . once bug#47697 is fixed, the present
        fix is redundant and we can revert to original s_stream query.

    modified:
      mysql-test/suite/backup/r/backup_no_engine.result
      mysql-test/suite/backup/t/backup_no_engine.test
      sql/si_objects.cc
=== modified file 'mysql-test/suite/backup/r/backup_no_engine.result'
--- a/mysql-test/suite/backup/r/backup_no_engine.result	2009-06-18 11:28:01 +0000
+++ b/mysql-test/suite/backup/r/backup_no_engine.result	2009-09-30 13:40:57 +0000
@@ -6,19 +6,5 @@ Tables_in_db
 t1
 t2
 BACKUP DATABASE db TO "db.backup";
-backup_id
-#
-DROP DATABASE db;
-RESTORE FROM "db.backup";
-backup_id
-#
-SHOW TABLES IN db;
-Tables_in_db
-t1
-SHOW CREATE TABLE db.t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) DEFAULT NULL,
-  `b` char(32) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ERROR 42000: Unknown storage engine 'PARADOX'
 DROP DATABASE db;

=== modified file 'mysql-test/suite/backup/t/backup_no_engine.test'
--- a/mysql-test/suite/backup/t/backup_no_engine.test	2009-06-18 11:28:01 +0000
+++ b/mysql-test/suite/backup/t/backup_no_engine.test	2009-09-30 13:40:57 +0000
@@ -20,21 +20,11 @@ copy_file $table_def $MYSQLD_DATADIR/db/
 
 SHOW TABLES IN db;
 
-# backup test database, the table with no storage engine will be ignored
+# backup test database, an error will be displayed
+# as storage engine of the table is not identified
 --replace_column 1 #
+--error ER_UNKNOWN_STORAGE_ENGINE
 BACKUP DATABASE db TO "db.backup";
 
-# wipe-out backed-up database
-DROP DATABASE db;
-
---replace_column 1 #
-RESTORE FROM "db.backup";
-
-# check that the table with no engine was excluded
-SHOW TABLES IN db;
-# check that table t was correctly restored
-SHOW CREATE TABLE db.t1;	
-
 # clean up
 DROP DATABASE db;
-remove_file $MYSQLD_BACKUPDIR/db.backup;

=== modified file 'sql/si_objects.cc'
--- a/sql/si_objects.cc	2009-09-10 13:46:13 +0000
+++ b/sql/si_objects.cc	2009-09-30 13:40:57 +0000
@@ -2645,10 +2645,12 @@ Obj_iterator *get_db_tables(THD *thd, co
   String_stream s_stream;
 
   s_stream <<
-    "SELECT '" << db_name << "', table_name "
+    "SELECT '" << db_name << "', table_name " 
+    "FROM ( SELECT * "
     "FROM INFORMATION_SCHEMA.TABLES "
     "WHERE table_schema = '" << db_name << "' AND "
-    "table_type = 'BASE TABLE'";
+    "table_type = 'BASE TABLE'"
+    ") AS get_table";
 
   return create_row_set_iterator<Db_tables_iterator>(thd, s_stream.lex_string());
 }


Attachment: [text/bzr-bundle]
Thread
bzr commit into mysql-6.0-backup branch (ritheesh.vedire:2876)Bug#45587Ritheesh Vedire30 Sep