diff options
author | Alexey Botchkov <holyfoot@askmonty.org> | 2019-02-01 17:10:27 +0400 |
---|---|---|
committer | Alexey Botchkov <holyfoot@askmonty.org> | 2019-02-01 17:10:27 +0400 |
commit | 09cea8703f3ec4e4f9e23855a339c9e3d5e84d3b (patch) | |
tree | 54779ab712b4a87e9207217c03c1397a70c4297c /sql/sql_db.cc | |
parent | 7c7161a1bd150e61f530933f096a8035932071af (diff) | |
download | mariadb-git-09cea8703f3ec4e4f9e23855a339c9e3d5e84d3b.tar.gz |
MDEV-17148 DROP DATABASE throw "Directory not empty" after changed lower_case_table_names.
No need to lowercase table names on case-sensitive file systems, as the
cache won't contain the 'lowercased' table anyway. And it prevents the
UPPERCASE.frm from being deleted.
Diffstat (limited to 'sql/sql_db.cc')
-rw-r--r-- | sql/sql_db.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/sql_db.cc b/sql/sql_db.cc index e94303f7e62..0e554e29380 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -1107,8 +1107,12 @@ static bool find_db_tables_and_rm_known_files(THD *thd, MY_DIR *dirp, table_list->table_name_length= table->length; table_list->open_type= OT_BASE_ONLY; - /* To be able to correctly look up the table in the table cache. */ - if (lower_case_table_names) + /* + On the case-insensitive file systems table is opened + with the lowercased file name. So we should lowercase + as well to look up the cache properly. + */ + if (lower_case_file_system) table_list->table_name_length= my_casedn_str(files_charset_info, table_list->table_name); |