[MDEV-5111] Mac OS X : lower_case_table_names and case-sensitive filesystem Created: 2013-10-08 Updated: 2013-10-08 Resolved: 2013-10-08 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 5.5.33a |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Klaus W. (Inactive) | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | upstream | ||
| Description |
|
Hello, i've just updated my mysql database from 5.1 to mariadb 5.5.33a on macosx with a case-sensitive filesystem (via macports). Now, i get foreign-key constraints errors, when truncate a table because the table-names doesn't match any longer. Kind regards, |
| Comments |
| Comment by Elena Stepanova [ 2013-10-08 ] | |||||||||||||||||||||||||||
|
Hi, lower_case_table_names is a static variable, which means you need to set it on the server startup (either in the cnf file or on the command line). Did you try that? | |||||||||||||||||||||||||||
| Comment by Klaus W. (Inactive) [ 2013-10-08 ] | |||||||||||||||||||||||||||
|
Hi, If i delete some rows with foreign-constraints, i don't get errors. | |||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2013-10-08 ] | |||||||||||||||||||||||||||
|
I see. Could you please provide SHOW CREATE TABLE output for one of such tables, ls -l for the table-related files on the disk, and the error message from the TRUNCATE command? Thanks. | |||||||||||||||||||||||||||
| Comment by Klaus W. (Inactive) [ 2013-10-08 ] | |||||||||||||||||||||||||||
|
i created a new database and then the tables with:
then truncate the table:
the result of ls for the tables:
Thanks in advance | |||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2013-10-08 ] | |||||||||||||||||||||||||||
|
Thank you. Indeed, I also observe the same error on 5.5 and higher (both MariaDB and MySQL), while on 5.1 TRUNCATE goes smoothly. I don't think however that it's related to lower/upper case names, is there any reason you suspect that? I will try to look up for the reason of the error. | |||||||||||||||||||||||||||
| Comment by Klaus W. (Inactive) [ 2013-10-08 ] | |||||||||||||||||||||||||||
|
I was a little bit wrong, the bug doesn't depend on lower_case_table_names settings or case-sensitive filesystem. | |||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2013-10-08 ] | |||||||||||||||||||||||||||
|
So, MySQL manual for 5.1 says (http://dev.mysql.com/doc/refman/5.1/en/truncate-table.html): "In MySQL 5.5 and higher, TRUNCATE TABLE is not allowed for InnoDB tables referenced by foreign keys. For ease of upgrading, rewrite such statements to use DELETE instead." However, the 5.5 manual says (http://dev.mysql.com/doc/refman/5.5/en/truncate-table.html): "TRUNCATE TABLE fails for an InnoDB table if there are any FOREIGN KEY constraints from other tables that reference the table. Foreign key constraints between columns of the same table are permitted." The latter seems to be your case, the foreign key constraints between columns of the same table, but it fails. At least it looks like a documentation issue, or maybe it's actually a code problem if it's supposed to work as described in the 5.5 manual. We normally share the information with MySQL team by refiling bugs in their system. Do you want to create a bug report at bugs.mysql.com or should we do it on your behalf? | |||||||||||||||||||||||||||
| Comment by Klaus W. (Inactive) [ 2013-10-08 ] | |||||||||||||||||||||||||||
|
No, i don't want to create a new ticket. Thank you very much for your help. | |||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2013-10-08 ] | |||||||||||||||||||||||||||
|
Right, and of course my note about your case having only one table was wrong – it actually has two, so it works as described in the manual. Closing as documented behavior. |