Description:
The drop database db_name fails as showed below:
C:\mysql\bin>mysql -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.4-beta-debug-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> create database if not exists appfuse;
Query OK, 1 row affected (0.06 sec)
mysql> drop database appfuse;
ERROR 1010 (HY000): Error dropping database (can't rmdir '.\appfuse', errno: 41)
How to repeat:
see description
Suggested fix:
Revert or modify the changeset which introduced the below lines of code in
/mysys/my_lib.c:
/*
If the directory is the root directory of the drive, Windows sometimes
creates hidden or system files there (like RECYCLER); do not show
them. We would need to see how this can be achieved with a Borland
compiler.
*/
#ifndef __BORLANDC__
if (attrib & (_A_HIDDEN | _A_SYSTEM))
continue;
#endif
Removing the above lines of code:
C:\mysql\bin>mysql -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 4.1.4-beta-debug-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> create database if not exists appfuse;
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+----------+
| Database |
+----------+
| appfuse |
| mysql |
| test |
| test2 |
| world |
+----------+
5 rows in set (0.00 sec)
mysql> drop database appfuse;
Query OK, 0 rows affected (0.05 sec)
mysql> show databases;
+----------+
| Database |
+----------+
| mysql |
| test |
| test2 |
| world |
+----------+
4 rows in set (0.00 sec)
In the debugger you can see the below variables values:
mysql_real_data_home 0x008f2230 "C:\mysql\data\"
mysql_data_home 0x008f3614 "."
path 0x0558f088 ".\appfuse\"
Then the path value most probably was compound with mysql_data_home
which is the hidden character and ".\appfuse\" is sent to my_dir(...).