Bug #27653 Temp table can't be created if lower_case_table_names=1 and tmpdir has uppercase
Submitted: 4 Apr 2007 15:16 Modified: 4 May 2007 18:29
Reporter: Valeriy Kravchuk Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0.40-BK, 5.0.36 OS:Linux
Assigned to: Timothy Smith CPU Architecture:Any
Tags: bfsm_2007_04_19

[4 Apr 2007 15:16] Valeriy Kravchuk
Description:
Temporary tables can not be created successfully on Linux if lower_case_table_names is set to 1 and tmpdir points to a directory with uppercase letter(s) in a pathname. A really weird and misleading error message like

ERROR 1049 (42000): Unknown database 'test'

is the result.

How to repeat:
openxs@suse:~/dbs/5.0> mkdir TMP
openxs@suse:~/dbs/5.0> bin/mysqld_safe --lower-case-table-names=1 --tmpdir=/home/openxs/dbs/5.0/TMP &
[1] 580
openxs@suse:~/dbs/5.0> Starting mysqld daemon with databases from /home/openxs/d
bs/5.0/var

openxs@suse:~/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.40 Source distribution

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

mysql>  create table repro (c1 varchar(10));
Query OK, 0 rows affected (0.01 sec)

mysql> insert into repro values ('eins'), ('zwei');
Query OK, 2 rows affected (0.00 sec)
Records: 2  Duplicates: 0  Warnings: 0

mysql>  create temporary table temptable select * from repro;
ERROR 1049 (42000): Unknown database 'test'

Suggested fix:
At least describe this in the manual...
[28 Apr 2007 8:54] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/25661

ChangeSet@1.2463, 2007-04-28 10:54:20+02:00, tsmith@quadxeon.mysql.com +7 -0
  Bug #27653: Temp table can't be created if lower_case_table_names=1 and tmpdir has uppercase
  
  Fix: don't convert mysql_tmpdir to lower case when building the path to a temporary table
[30 Apr 2007 21:16] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/25799

ChangeSet@1.2463, 2007-04-30 23:16:46+02:00, tsmith@quadxeon.mysql.com +7 -0
  Bug #27653: Temp table can't be created if lower_case_table_names=1 and
              tmpdir has uppercase
  
  Fix: don't convert mysql_tmpdir to lower case when building the path to a
  temporary table
[1 May 2007 9:47] Timothy Smith
Patch queued to 5.0- and 5.1-maint team trees; will be merged up to top repos soon.
[1 May 2007 20:58] Bugs System
Pushed into 5.1.18-beta
[1 May 2007 21:00] Bugs System
Pushed into 5.0.42
[4 May 2007 18:29] Paul DuBois
Noted in 5.0.42, 5.1.18 changelogs.

On Linux, the server could not create temporary tables if
lower_case_table_names was set to 1 and the value of tmpdir was a
directory name containing any uppercase letters.