Backport of:
---------------------------------------------------------- revno: 2630.2.20 committer: Konstantin Osipov <konstantin@mysql.com> branch nick: mysql-6.0-runtime timestamp: Fri 2008-06-27 20:10:42 +0400 message: Fix a regression introduced by WL#3726 when a table was left in the table cache after DROP DATABASE. Implementation of DROP DATABASE reads a list of files in the database directory and constructs from it the list of tables to be dropped. If the filesystem is case-insensitive and case-preserving, the table names should be lowercased, because the same has been done when entries for them were inserted into the table cache. Skipping this step will lead to orphaned TABLEs left in the table cache. Fixes lowercase_table2 failure on powermacg5. sql/sql_db.cc: Lowercase the table name, it's used to construct the table cache key.
This commit is contained in:
parent
93b55a006d
commit
6d5dd31584
@ -1142,6 +1142,11 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
|
||||
(void) filename_to_tablename(file->name, table_list->table_name,
|
||||
MYSQL50_TABLE_NAME_PREFIX_LENGTH +
|
||||
strlen(file->name) + 1);
|
||||
|
||||
/* To be able to correctly look up the table in the table cache. */
|
||||
if (lower_case_table_names)
|
||||
my_casedn_str(files_charset_info, table_list->table_name);
|
||||
|
||||
table_list->alias= table_list->table_name; // If lower_case_table_names=2
|
||||
table_list->internal_tmp_table= is_prefix(file->name, tmp_file_prefix);
|
||||
/* Link into list */
|
||||
|
Loading…
x
Reference in New Issue
Block a user