diff --git a/ChangeLog b/ChangeLog index a85b74102d..132331f1a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -113,6 +113,7 @@ phpMyAdmin - ChangeLog - issue #11458 Invalid UTF-8 sequence in argument - issue #11457 Request URI too large - issue Invalid argument supplied for foreach() +- issue #11461 Foreign key constraints for InnoDB tables with upper-case letters disabled 4.4.14.1 (2015-09-08) - issue [security] reCaptcha bypass diff --git a/libraries/DatabaseInterface.class.php b/libraries/DatabaseInterface.class.php index b99decc960..688affb850 100644 --- a/libraries/DatabaseInterface.class.php +++ b/libraries/DatabaseInterface.class.php @@ -387,7 +387,8 @@ class PMA_DatabaseInterface ) . '%\''; } else { - $sql_where_table = 'AND t.`TABLE_NAME` = \'' + $sql_where_table = 'AND t.`TABLE_NAME` ' + . PMA_Util::getCollateForIS() . ' = \'' . PMA_Util::sqlAddSlashes($table) . '\''; } } else { @@ -489,7 +490,7 @@ class PMA_DatabaseInterface `CREATE_OPTIONS` AS `Create_options`, `TABLE_COMMENT` AS `Comment` FROM `information_schema`.`TABLES` t - WHERE ' . (PMA_IS_WINDOWS ? '' : 'BINARY') . ' `TABLE_SCHEMA` + WHERE `TABLE_SCHEMA` ' . PMA_Util::getCollateForIS() . ' IN (\'' . implode("', '", $this_databases) . '\') ' . $sql_where_table; } diff --git a/libraries/Util.class.php b/libraries/Util.class.php index 516a71dbf1..875bc8e438 100644 --- a/libraries/Util.class.php +++ b/libraries/Util.class.php @@ -4654,7 +4654,9 @@ class PMA_Util } ); - if ($lowerCaseTableNames === '0') { + if ($lowerCaseTableNames === '0' // issue #10961 + || $lowerCaseTableNames === '2' // issue #11461 + ) { return "COLLATE utf8_bin"; } return ""; diff --git a/libraries/dbi/DBIDummy.class.php b/libraries/dbi/DBIDummy.class.php index d288aa7cbb..a24e2f1809 100644 --- a/libraries/dbi/DBIDummy.class.php +++ b/libraries/dbi/DBIDummy.class.php @@ -25,6 +25,10 @@ $GLOBALS['dummy_queries'] = array( 'query' => 'SELECT CURRENT_USER();', 'result' => array(array('pma_test@localhost')), ), + array( + 'query' => "SHOW VARIABLES LIKE 'lower_case_table_names'", + 'result' => array(array('lower_case_table_names', '1')) + ), array( 'query' => 'SELECT 1 FROM mysql.user LIMIT 1', 'result' => array(array('1')), @@ -264,7 +268,7 @@ $GLOBALS['dummy_queries'] = array( . ' `CHECKSUM` AS `Checksum`, `CREATE_OPTIONS` AS `Create_options`,' . ' `TABLE_COMMENT` AS `Comment`' . ' FROM `information_schema`.`TABLES` t' - . ' WHERE BINARY `TABLE_SCHEMA` IN (\'pma_test\')' + . ' WHERE `TABLE_SCHEMA` IN (\'pma_test\')' . ' AND t.`TABLE_NAME` = \'table1\' ORDER BY Name ASC', 'columns' => array( 'TABLE_CATALOG', 'TABLE_SCHEMA', 'TABLE_NAME', 'TABLE_TYPE', 'ENGINE',