#At file:///Users/cbell/source/bzr/mysql-6.0-bug-47804-fix/ based on revid:thavamuni.alagu@stripped
2894 Chuck Bell 2009-11-18
BUG#47804 : Backup catalog does not preserve object relationships
The backup_xpfm_compat_backup test fails on pushbuild on Windows
platforms.
While investigating a problem found with this test, it was
discovered that while using lower_case_table_names = 2 on
Windows that the SELECTs on the INFORMATION_SCHEMA.ROUTINES
and INFORMATION_SCHEMA.EVENTS tables failed to find the events
for databases with uppercase names.
This patch corrects this behavior by using a case insensitive
compare.
It was also discovered that the test hangs on Windows. A new bug
was opened to address this - BUG#48850. This patch adds FLUSH
TABLES as a workaround to ensure the databases can be dropped
and the test will not hang.
@ mysql-test/suite/backup/include/backup_xpfm_compat_backup.inc
Added flush for workaround to hang on PB2.
@ sql/si_objects.cc
Added code to use case insensitive compare if running on Windows
and lctn=2.
modified:
mysql-test/suite/backup/include/backup_xpfm_compat_backup.inc
sql/si_objects.cc
=== modified file 'mysql-test/suite/backup/include/backup_xpfm_compat_backup.inc'
--- a/mysql-test/suite/backup/include/backup_xpfm_compat_backup.inc 2009-07-20 09:27:48 +0000
+++ b/mysql-test/suite/backup/include/backup_xpfm_compat_backup.inc 2009-11-18 15:27:51 +0000
@@ -897,6 +897,11 @@ DROP USER 'no_user'@'%';
DROP USER 'bup_user1'@'%';
DROP USER 'BUP_USER2';
DROP USER 'BupUser3'@'%';
+# BUG#48850 : This test will hang on the DROP DATABASE commands.
+# Remove the FLUSH TABLES when this bug is fixed.
+--disable_query_log
+FLUSH TABLES;
+--enable_query_log
DROP DATABASE bup_xpfm_compat_db1;
DROP DATABASE BUP_XPFM_COMPAT_DB2;
DROP DATABASE BupXPfmCompat_db3;
=== modified file 'sql/si_objects.cc'
--- a/sql/si_objects.cc 2009-11-17 20:18:50 +0000
+++ b/sql/si_objects.cc 2009-11-18 15:27:51 +0000
@@ -2745,9 +2745,15 @@ Obj_iterator *get_db_stored_procedures(T
String_stream s_stream;
s_stream <<
"SELECT '" << db_name << "', routine_name "
- "FROM INFORMATION_SCHEMA.ROUTINES "
- "WHERE routine_schema COLLATE utf8_bin = '" << db_name << "' AND "
- "routine_type = 'PROCEDURE'";
+ "FROM INFORMATION_SCHEMA.ROUTINES ";
+ /*
+ We need to use case insensitive compare when LCTN = 2 and on Windows.
+ */
+ if ((lower_case_table_names == 2) && IF_WIN(1,0))
+ s_stream << "WHERE routine_schema COLLATE utf8_general_ci = '" << db_name;
+ else
+ s_stream << "WHERE routine_schema COLLATE utf8_bin = '" << db_name;
+ s_stream << "' AND routine_type = 'PROCEDURE'";
return create_row_set_iterator<Db_stored_proc_iterator>(thd, s_stream.lex_string());
}
@@ -2759,9 +2765,15 @@ Obj_iterator *get_db_stored_functions(TH
String_stream s_stream;
s_stream <<
"SELECT '" << db_name << "', routine_name "
- "FROM INFORMATION_SCHEMA.ROUTINES "
- "WHERE routine_schema COLLATE utf8_bin = '" << db_name <<"' AND "
- "routine_type = 'FUNCTION'";
+ "FROM INFORMATION_SCHEMA.ROUTINES ";
+ /*
+ We need to use case insensitive compare when LCTN = 2 and on Windows.
+ */
+ if ((lower_case_table_names == 2) && IF_WIN(1,0))
+ s_stream << "WHERE routine_schema COLLATE utf8_general_ci = '" << db_name;
+ else
+ s_stream << "WHERE routine_schema COLLATE utf8_bin = '" << db_name;
+ s_stream << "' AND routine_type = 'FUNCTION'";
return create_row_set_iterator<Db_stored_func_iterator>(thd, s_stream.lex_string());
}
@@ -2774,8 +2786,14 @@ Obj_iterator *get_db_events(THD *thd, co
String_stream s_stream;
s_stream <<
"SELECT '" << db_name << "', event_name "
- "FROM INFORMATION_SCHEMA.EVENTS "
- "WHERE event_schema COLLATE utf8_bin = '" << db_name <<"'";
+ "FROM INFORMATION_SCHEMA.EVENTS ";
+ /*
+ We need to use case insensitive compare when LCTN = 2 and on Windows.
+ */
+ if ((lower_case_table_names == 2) && IF_WIN(1,0))
+ s_stream << "WHERE event_schema COLLATE utf8_general_ci = '" << db_name << "'";
+ else
+ s_stream << "WHERE event_schema COLLATE utf8_bin = '" << db_name <<"'";
return create_row_set_iterator<Db_event_iterator>(thd, s_stream.lex_string());
#else
Attachment: [text/bzr-bundle] bzr/charles.bell@sun.com-20091118152751-qmjxw26wpq2eodbs.bundle
| Thread |
|---|
| • bzr commit into mysql-6.0-backup branch (charles.bell:2894) Bug#47804 | Chuck Bell | 18 Nov |