diff --git a/ChangeLog b/ChangeLog index 0208f46c72..df7f4a3952 100644 --- a/ChangeLog +++ b/ChangeLog @@ -32,6 +32,7 @@ phpMyAdmin - ChangeLog - issue #12868 Fix check for user groups freatures being enabled - issue #12831 Fix table formatting on Insert tab, which mostly affected row highlighting - issue #12495 Reintroduced phpinfo page with limited capabilities +- issue #12861 Fix renaming tables with lower_case_table_names=2 4.6.5.2 (2016-12-05) - issue #12765 Fixed SQL export with newlines diff --git a/libraries/Table.php b/libraries/Table.php index c4fca789a8..5aae6a7043 100644 --- a/libraries/Table.php +++ b/libraries/Table.php @@ -1342,15 +1342,7 @@ class Table */ function rename($new_name, $new_db = null) { - $lowerCaseTableNames = Util::cacheGet( - 'lower_case_table_names', - function () { - return $GLOBALS['dbi']->fetchValue( - "SELECT @@lower_case_table_names" - ); - } - ); - if ($lowerCaseTableNames) { + if ($GLOBALS['dbi']->getLowerCaseNames() === '1') { $new_name = strtolower($new_name); } diff --git a/libraries/operations.lib.php b/libraries/operations.lib.php index 358bd8a2b5..89d6103881 100644 --- a/libraries/operations.lib.php +++ b/libraries/operations.lib.php @@ -353,10 +353,7 @@ function PMA_runProcedureAndFunctionDefinitions($db) function PMA_createDbBeforeCopy() { // lower_case_table_names=1 `DB` becomes `db` - $lowerCaseTableNames = $GLOBALS['dbi']->fetchValue( - 'SELECT @@lower_case_table_names' - ); - if ($lowerCaseTableNames === '1') { + if ($GLOBALS['dbi']->getLowerCaseNames() === '1') { $_REQUEST['newname'] = mb_strtolower( $_REQUEST['newname'] ); diff --git a/test/classes/TableTest.php b/test/classes/TableTest.php index 760cdefe02..97ed81d4fa 100644 --- a/test/classes/TableTest.php +++ b/test/classes/TableTest.php @@ -751,7 +751,6 @@ class TableTest extends PMATestCase { $table = 'PMA_BookMark'; $db = 'PMA'; - Util::cacheSet('lower_case_table_names', false); $table = new Table($table, $db);