Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL)
-
None
Description
to reproduce
OS: Unix
lower_case_table_names = 0 # default value for unix
CREATE DATABASE to_be_lowered;
|
USE to_be_lowered;
|
CREATE TABLE T1(c1 INT);
|
Stop service
Change lower_case_table_names in my.cnf to
lower_case_table_names = 1
start service
DROP DATABASE to_be_lowered;
|
SQL Error (1010): Error drop database (can't rmdir './to_be_lowered', errno: 39 "Directory not empty) |
The error message comes from unix rmdir himself.
All *.ibd and db.opt already deleted, but files T1.frm still exists in database directory,
which provoke above error message.
DROP DATABASE should check, if some .frm names are in the datadir with capital_letters,
if lower_case_table_names = 1
2 Solutions are possible.
1. Throw an error before ! deleting *.ibd files
2. Delete also the .frm files with Captial letter.
I can't reproduce it on the current 10.0.
MariaDB [(none)]> select @@lower_case_table_names;
+--------------------------+
| @@lower_case_table_names |
+--------------------------+
| 0 |
+--------------------------+
1 row in set (0.00 sec)
MariaDB [(none)]> CREATE DATABASE to_be_lowered;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> USE to_be_lowered;
Database changed
MariaDB [to_be_lowered]> CREATE TABLE t1(c1 INT);
Query OK, 0 rows affected (0.28 sec)
MariaDB [to_be_lowered]> shutdown;
After restart:
MariaDB [(none)]> select @@lower_case_table_names;
+--------------------------+
| @@lower_case_table_names |
+--------------------------+
| 1 |
+--------------------------+
1 row in set (0.00 sec)
MariaDB [(none)]> DROP DATABASE to_be_lowered;
Query OK, 1 row affected (0.21 sec)
Was there anything else in the scenario that you haven't mentioned?