table name changed to lower-case in Alter Table
Database management in a single PHP file
Brought to you by:
jakubvrana
I noticed that recently I started having issues where the name of tables were changed to lower-case after using the "Alter Table" view. This seems to be caused because $L['name'] is used at many places, instead of $L['Name'] (or $row['name'] being used instead of $row['Name']). For instance: create.inc.php on line 165.
This is highly annoying.
I got the same issue here (y)
Same issue in here. Using v 4.3.1 on Windows.
It's happend only when I'm currently on "Show structure" page and from there I do click on "Alter table". Actually when I'm on "Show structure" page all of the links pointing to the other actions are with table name in lowercase.
So the only way to alter my table without changing the letter's case is to go at the page "Select data" at first and from there is't "safe" to go at "Alter table"
I don't have a Mac but I'll try this on Windows.
I wasn't able to reproduce this. Adminer uses different commands on Structure and Select pages for performance reasons (
SELECT TABLE_NAME FROM information_schema.TABLESandSHOW TABLE STATUS) but it respects whatever these commands return.After changing
lower_case_table_namesto 2, I've tried to rename the table to a different letter case (ALTER TABLE Test RENAME TO test) but MySQL just ignored it. Even after this, both pages still showed the same links.I'm still having the issue. Like Boris said. If I go Show structure -> Alter table then there's a lowercase name in the edit form. The issue for me is that when I click save, the sql command executed is also with a lowercase name.
We like to grab the executed command and copy&paste it into our flyway scripts which are run on production linux servers with lower_case_table_names 0. Doing so actually renames the table on the linux servers which in turn breaks our case-sensitive application.
video showing the issue
using Adminer in docker
macOS High Sierra 10.13.2
Adminer 4.4.0
mysql show variables
Thanks for looking into it.
This looks like a MySQL bug. It seems that
SELECT TABLE_NAME FROM information_schema.TABLESreturns the wrong name. Please verify this and then report this to MySQL.You can also try setting
lower_case_table_namesto 0.SELECT TABLE_NAME FROM information_schema.TABLES returns correct name
Please download Adminer's source codes and try to debug it on your own.