Bug #40719 Problematic dot directories
Submitted: 13 Nov 2008 21:52 Modified: 14 Nov 2008 17:17
Reporter: Piotr Biel Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.x OS:Any
Assigned to: CPU Architecture:Any
Tags: dot

[13 Nov 2008 21:52] Piotr Biel
Description:
When "." (dot) in directory name located in 'datadir' MySQL will break serveral types of commands. MySQL will not allow to use '.' while creating database, but you can still do it from OS level and break things up.

How to repeat:
mysql> show global variables like 'datadir';
+---------------+-----------------+
| Variable_name | Value           |
+---------------+-----------------+
| datadir       | /var/lib/mysql/ | 
+---------------+-----------------+
1 row in set (0.00 sec)

Than manually create directory containing "." in name.

# mkdir -p /var/lib/mysql/TEST.TEST

And:

mysql> select * from information_schema.tables limit 1;
ERROR 1102 (42000): Incorrect database name 'TEST.TEST'

Suggested fix:
MySQL should ignore such invalid directories and not treat them as databases.
[14 Nov 2008 17:17] Valeriy Kravchuk
Sorry, but I can not repeat this neither with 5.0.70 on Windows nor with latest 5.0.74 from bzr on Linux:

openxs@suse:/home2/openxs/dbs/5.0> mkdir var/TEST.TEST
openxs@suse:/home2/openxs/dbs/5.0> bin/mysql -uroot test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.74-debug Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| TEST.TEST          |
| mysql              |
| test               |
+--------------------+
4 rows in set (0.00 sec)

mysql> select * from information_schema.tables limit 1;
+---------------+--------------------+----------------+-------------+--------+---------+------------+------------+----------------+-------------+-----------------+--------------+-----------+----------------+-------------+-------------+------------+-----------------+----------+----------------+---------------+
| TABLE_CATALOG | TABLE_SCHEMA       | TABLE_NAME     | TABLE_TYPE  | ENGINE | VERSION | ROW_FORMAT | TABLE_ROWS | AVG_ROW_LENGTH | DATA_LENGTH | MAX_DATA_LENGTH | INDEX_LENGTH | DATA_FREE | AUTO_INCREMENT | CREATE_TIME | UPDATE_TIME | CHECK_TIME | TABLE_COLLATION | CHECKSUM | CREATE_OPTIONS | TABLE_COMMENT |
+---------------+--------------------+----------------+-------------+--------+---------+------------+------------+----------------+-------------+-----------------+--------------+-----------+----------------+-------------+-------------+------------+-----------------+----------+----------------+---------------+
| NULL          | information_schema | CHARACTER_SETS | SYSTEM VIEW | MEMORY |       0 | Fixed      |       NULL |            576 |           0 |        16661376 |            0 |         0 |           NULL | NULL        | NULL        | NULL       | utf8_general_ci |     NULL | max_rows=29127 |               |
+---------------+--------------------+----------------+-------------+--------+---------+------------+------------+----------------+-------------+-----------------+--------------+-----------+----------------+-------------+-------------+------------+-----------------+----------+----------------+---------------+
1 row in set (0.07 sec)