MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Ritheesh Vedire Date:November 9 2009 10:56am
Subject:bzr commit into mysql-6.0-backup branch (ritheesh.vedire:2888)
Bug#45587
View as plain text  
#At file:///home/rith/Work/MySQl/bug45587/ based on revid:charles.bell@stripped

 2888 Ritheesh Vedire	2009-11-09
      BUG#45587:Backup of tables using a non-existent storage engine does not give warning/error.
      
        
     @ mysql-test/suite/backup/t/backup_no_engine.test
        Changed the test case to throw errors. Test case suppresses the errors in the Server Log.
     @ sql/si_objects.cc
        Changed the query s_stream  in get_db_tables() to return invalid tables. See BUG#47697.

    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-11-09 10:56:12 +0000
@@ -1,3 +1,6 @@
+Suppress this error in the server log
+call mtr.add_suppression("Can't access storage engine of table ");
+
 DROP DATABASE IF EXISTS db;
 CREATE DATABASE db;
 CREATE TABLE db.t1 (a int, b char(32));
@@ -6,19 +9,10 @@ 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'
+SHOW WARNINGS;
+Level	Code	Message
+Error	1286	Unknown storage engine 'PARADOX'
+Error	1642	Can't access storage engine of table `db`.`t2`
+Warning	1777	Operation aborted
 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-11-09 10:56:12 +0000
@@ -3,6 +3,10 @@
 
 --source include/not_embedded.inc
 
+--echo Suppress this error in the server log
+call mtr.add_suppression("Can't access storage engine of table ");
+--echo
+
 # .frm file for a table using non-existent storage engine
 --let $table_def=$MYSQL_TEST_DIR/std_data/bug30938.frm
 
@@ -20,21 +24,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;	
-
+SHOW WARNINGS;
 # clean up
 DROP DATABASE db;
-remove_file $MYSQLD_BACKUPDIR/db.backup;

=== modified file 'sql/si_objects.cc'
--- a/sql/si_objects.cc	2009-11-04 14:18:21 +0000
+++ b/sql/si_objects.cc	2009-11-09 10:56:12 +0000
@@ -2692,12 +2692,28 @@ bool check_user_access(THD *thd, const S
 Obj_iterator *get_db_tables(THD *thd, const String *db_name)
 {
   String_stream s_stream;
+  /*
+    BUG#45587: Backup of tables using a non-existent storage engine
+               does not give warning/error 
+    BUG#47697: Inconsistencies in the query outputs on
+               INFORMATION_SCHEMA.TABLES 
+
+    Once BUG#47697 is fixed, the query s_stream  should be reverted 
+    to following query:
+    s_stream<<
+      "SELECT '" << db_name << "', table_name "
+      "FROM INFORMATION_SCHEMA.TABLES "
+      "WHERE table_schema = '" << db_name << "' AND "
+      "table_type = 'BASE TABLE'";
+   */
 
   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:2888)Bug#45587Ritheesh Vedire9 Nov