Bug #27425 Falcon: case sensitive table names
Submitted: 25 Mar 2007 17:57 Modified: 3 Dec 2007 14:26
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Falcon storage engine Severity:S3 (Non-critical)
Version:5.2.4-falcon-alpha-debug OS:Linux (SUSE 10.0 / 64-bit)
Assigned to: Jim Starkey

[25 Mar 2007 17:57] Peter Gulutzan
Description:
Although there is a verified bug
Bug#22166 Falcon: case insensitive table names
I can in fact create a Falcon table named
"A" and another Falcon table named "a",
using partitions. However, if I try to
remove the partitioning on "a", and then
try to shutdown with mysqladmin, crash.

How to repeat:
On mysql client, say:

create table a (s1 int) engine=falcon partition by list (s1) (partition A
 values in (1));
create table A (s1 int) engine=falcon;
alter table a remove partitioning;

Then quit, and say 'mysqladmin shutdown'.
The result will be a crash of mysqld.

Sample session:

pgulutzan@linux:~> /usr/local/mysql/bin/mysql --user=root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.2.4-falcon-alpha-debug Source distribution

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

mysql> create database d;
Query OK, 1 row affected (0.01 sec)

mysql> use d
Database changed
mysql> create table a (s1 int) engine=falcon partition by list (s1) (partition A
    ->  values in (1));
Query OK, 0 rows affected (0.57 sec)

mysql> create table A (s1 int) engine=falcon;
Query OK, 0 rows affected (0.01 sec)

mysql> alter table a remove partitioning;
ERROR 1025 (HY000): Error on rename of './d/#sql-2323_2' to './d/a' (errno: -2)
mysql> quit
Bye
pgulutzan@linux:~> /usr/local/mysql/bin/mysqladmin --user=root shutdown
... and mysqld will go down.
[26 Mar 2007 16:16] Miguel Solorzano
Thank you for the bug report. Verified as described on FC 6 32-bit.

[miguel@light 5.1f]$ bin/mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.2.4-falcon-alpha-debug Source distribution

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

mysql> create database db3;
Query OK, 1 row affected (0.00 sec)

mysql> use db3;
Database changed
mysql> create table a (s1 int) engine=falcon partition by list (s1) (partition A
    ->  values in (1));
Query OK, 0 rows affected (0.35 sec)

mysql> create table A (s1 int) engine=falcon;
Query OK, 0 rows affected (0.01 sec)

mysql> alter table a remove partitioning;
ERROR 1025 (HY000): Error on rename of './db3/#sql-181c_1' to './db3/a' (errno: -2)
mysql> 
mysql> exit
Bye
[miguel@light 5.1f]$ bin/mysqladmin -uroot shutdown
[30 Jul 2007 16:24] Peter Gulutzan
Another way to crash, with MySQL 6.0.2, just after mysql_install_db:

On mysql client, say:
use test
create table x (s1 int) engine=falcon;
create table X (s1 int) engine=falcon;
quit

Try to shut down with mysqladmin --user=root shutdown.
[23 Oct 2007 19:43] Kevin Lewis
Christoffer,

This test only fails on case sensitive file systems like Linux.  Could you isolate where the bug is here?  Is it in the partition engine or Falcon?  Please reference the crash in Bug#27474.  

>Ann wrote;
>  This is also a crash related to table name case sensitivity, this
>time with regard to partitioning.  My guess is that we can transfer
>it to partition which probably isn't handling a failure in removing
>partitioning gracefully.  It happens only on case sensitive file
>systems.
[23 Oct 2007 19:48] Kevin Lewis
Sorry, the similar bug is Bug#27424
[29 Oct 2007 3:15] Kevin Lewis
Jim says he know what is going on here.
[29 Oct 2007 3:19] Kevin Lewis
Change to P2 since it is a crash.
[1 Nov 2007 21:10] Jim Starkey
The server was trying to delete an non-existent table after a failed rename. 

The fix was to validate table paths as part of delete_table.
[30 Nov 2007 2:46] Hakan Küçükyılmaz
Does not crash anymore:

hakan@lu0011:~$ mysql -uroot test
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 6.0.4-alpha-debug Source distribution

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

[03:44] root@test>create table a (s1 int) engine=falcon partition by list (s1) (partition A
    ->  values in (1));
Query OK, 0 rows affected (0.22 sec)

[03:44] root@test>create table A (s1 int) engine=falcon;
Query OK, 0 rows affected (0.00 sec)

[03:45] root@test>alter table a remove partitioning;
ERROR 1025 (HY000): Error on rename of './test/#sql-b37_2' to './test/a' (errno: 121)

[03:45] root@test>Bye
hakan@lu0011:~$ mysqladmin --user=root shutdown

071130  3:45:20 [Note] /usr/local/mysql-6.0-debug/libexec/mysqld: Shutdown complete

[Thread 0x40841950 (LWP 2875) exited]

Program exited normally.
(gdb)
[3 Dec 2007 14:26] MC Brown
A note has been added to the 6.0.4 changelog: 

Removing a partition on a Falcon table when there are two tables with the same name, but different case, would cause a crash during normal shutdown.