#At file:///home/rith/Work/MySQl/bug45587/ based on
revid:charles.bell@stripped
2888 Ritheesh Vedire 2009-11-06
BUG#45587: Backup of tables using a non-existent storage engine does not give
warning/error
@ mysql-test/suite/backup/r/backup_no_engine.result
T
@ mysql-test/suite/backup/t/backup_no_engine.test
Test case suppresses errors in the Server Log file.
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-06 12:10:31 +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,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-11-06 12:10:31 +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;
-
# 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-06 12:10:31 +0000
@@ -2692,12 +2692,24 @@ 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 and BUG#47697
+ 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]