Menu

#557 table name changed to lower-case in Alter Table

4.3.1
closed-works-for-me
nobody
None
1
2018-01-24
2017-06-14
Doqnach
No

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.

  • MySQL version: 5.5.54 through PHP extension PDO_MySQL
  • PDO Client API version mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $
  • PHP Version 5.6.30
  • Apache running in docker: php:5.6-apache
  • MySQL running in docker: mysql:5.5
    • lower_case_file_system ON
    • lower_case_table_names 2
  • Host system is macOS 10.12.5

This is highly annoying.

Discussion

  • Marek

    Marek - 2017-08-31

    I got the same issue here (y)

     
  • Boris Belenski

    Boris Belenski - 2017-11-20

    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"

     
  • Jakub Vrána

    Jakub Vrána - 2018-01-23
    • status: open --> open-accepted
     
  • Jakub Vrána

    Jakub Vrána - 2018-01-23

    I don't have a Mac but I'll try this on Windows.

     
  • Jakub Vrána

    Jakub Vrána - 2018-01-24
    • status: open-accepted --> closed-works-for-me
     
  • Jakub Vrána

    Jakub Vrána - 2018-01-24

    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.TABLES and SHOW TABLE STATUS) but it respects whatever these commands return.

    After changing lower_case_table_names to 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.

     
  • Marek

    Marek - 2018-01-24

    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.

     
  • Jakub Vrána

    Jakub Vrána - 2018-01-24

    This looks like a MySQL bug. It seems that SELECT TABLE_NAME FROM information_schema.TABLES returns the wrong name. Please verify this and then report this to MySQL.

    You can also try setting lower_case_table_names to 0.

     
  • Marek

    Marek - 2018-01-24

    SELECT TABLE_NAME FROM information_schema.TABLES returns correct name

     
  • Jakub Vrána

    Jakub Vrána - 2018-01-24

    Please download Adminer's source codes and try to debug it on your own.

     

Log in to post a comment.

MongoDB Logo MongoDB