From 9131b599360ba9a62fc0124a4e00932a605ecf82 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Thu, 10 Sep 2015 00:31:52 +1000 Subject: [PATCH] Fix #11461 Foreign key constraints for InnoDB tables with upper-case letters disabled Signed-off-by: Madhura Jayaratne --- ChangeLog | 1 + libraries/DatabaseInterface.class.php | 5 +++-- libraries/Util.class.php | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 03a163f773..c344015d14 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,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 3913426054..2915cc7782 100644 --- a/libraries/DatabaseInterface.class.php +++ b/libraries/DatabaseInterface.class.php @@ -322,7 +322,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 { @@ -424,7 +425,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 e8e4bc7d45..04e504ef9b 100644 --- a/libraries/Util.class.php +++ b/libraries/Util.class.php @@ -4517,7 +4517,9 @@ class PMA_Util "SHOW VARIABLES LIKE 'lower_case_table_names'", 0, 1 ); - if ($lowerCaseTableNames === '0') { + if ($lowerCaseTableNames === '0' // issue #10961 + || $lowerCaseTableNames === '2' // issue #11461 + ) { return "COLLATE utf8_bin"; } return "";