Moving table reflects input case, not installation case setting #12901

Closed
MPLew-is opened this Issue Jan 17, 2017 · 3 comments

Projects

None yet

2 participants

@MPLew-is
Contributor

Steps to reproduce

  1. On a MySQL installation with a lower_case_table_names setting of 1, create or import a table (the example used in this issue is testing).
  2. Through the "Operations" tab, move the table (using the "Move table" form) to a table name with at least one upper-cease letter (the example used in this issue is Testing).

Expected behaviour

The resulting page, including both the response message and the refreshed "Operations" tab, should reflect the actual case of the table. PHPMyAdmin should also prevent the table from being moved to the same name, as it does when you directly input the same name in the same case.

Actual behaviour

The response message and the refreshed page both include the input-cased version of the table name, which could lead to some confusion. PHPMyAdmin also does not prevent you from moving the table (which is actually testing, but is shown as Testing in the interface) to testing, which results in a move to the same name. That doesn't itself pose a problem, but it's just generally weird behavior since a table move to itself is prevented already.

screen shot 2017-01-17 at 14 02 21 pm

Server configuration

Operating system: macOS 10.12.2

Web server: Apache 2.4.25

Database: MySQL 5.6.34

PHP version: 5.6.29

phpMyAdmin version: 4.6.5.2

Client configuration

Browser: Safari 10.0.2

Operating system: macOS 10.12.2

I realize this is a minor cosmetic issue, but I figured I'd report it anyways. I also was going to make a pull request for part of this (specifically, the response message that is retrieved via AJAX upon successful moving), but I have absolutely no clue how you want to approach changing the JS side of this. The two methods I could think of were to either have the AJAX calls somehow return the real table name (rather than just use the table name input by the user, as it currently does), or have the JS code be aware of the server's lower_case_table_names setting, which it currently is not.

@nijel nijel added the enhancement label Jan 18, 2017
@nijel
Member
nijel commented Jan 18, 2017

Actually the new table and database name should be already part of the AJAX response in _params array, so that's probably easiest approach to deal with this.

@MPLew-is
Contributor

Well, in that case I'll definitely look into a bit more, and try to have a PR fixing it later today. Thanks!

@nijel nijel self-assigned this Jan 21, 2017
@nijel nijel added this to the 4.7.0 milestone Jan 21, 2017
@nijel nijel added a commit that closed this issue Jan 21, 2017
@nijel nijel Use server returned table name on renaming table
Fixes #12901

Signed-off-by: Michal Čihař <michal@cihar.com>
b2e2e77
@nijel nijel closed this in b2e2e77 Jan 21, 2017
@MPLew-is
Contributor

Sorry for not getting a pull request in for this, but thanks for taking care of it!

However, the change made seems to have not fully fixed the issue, as the message returned byoperations.lib.php still uses the request case instead of the server name. The functionality issues have been resolved, but for completeness I'm making a pull request fixing the message as well.

@MPLew-is MPLew-is added a commit to MPLew-is/phpmyadmin that referenced this issue Jan 21, 2017
@MPLew-is MPLew-is Use correct-case table name in message for successful rename
Previously, the name returned was the name used in the request, rather
than the name after the correcting for the server’s
`lower_case_table_names` setting.

Following up on issue #12901 and @b2e2e77.

Signed-off-by: Mike Lewis <mike@mplew.is>
e940aad
@MPLew-is MPLew-is added a commit to MPLew-is/phpmyadmin that referenced this issue Jan 21, 2017
@MPLew-is MPLew-is Use correct-case table name in message for successful rename
Previously, the name returned was the name used in the request, rather
than the name after the correcting for the server’s
`lower_case_table_names` setting.

Following up on issue #12901 and @b2e2e77.

Signed-off-by: Mike Lewis <mike@mplew.is>
f3de7eb
@MPLew-is MPLew-is added a commit to MPLew-is/phpmyadmin that referenced this issue Jan 21, 2017
@MPLew-is MPLew-is Use correct-case table name in message for successful rename
Previously, the name returned was the name used in the request, rather
than the name after the correcting for the server’s
`lower_case_table_names` setting.

Following up on issue #12901 and @b2e2e77.

Signed-off-by: Mike Lewis <mike@mplew.is>
52fa45e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment