Commit f198e8be authored by Konstantin Osipov's avatar Konstantin Osipov

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.
parent ded46870
...@@ -1142,6 +1142,11 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db, ...@@ -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, (void) filename_to_tablename(file->name, table_list->table_name,
MYSQL50_TABLE_NAME_PREFIX_LENGTH + MYSQL50_TABLE_NAME_PREFIX_LENGTH +
strlen(file->name) + 1); 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->alias= table_list->table_name; // If lower_case_table_names=2
table_list->internal_tmp_table= is_prefix(file->name, tmp_file_prefix); table_list->internal_tmp_table= is_prefix(file->name, tmp_file_prefix);
/* Link into list */ /* Link into list */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment