Fixes foreign key pattern in MySQL

Foreign keys are not displaying in MySQL when ANSI_QUOTES is enabled because the preg_match_all() is looking specifically for backticks. This fix allows for double quotes as well, so foreign keys are recognized even when ANSI_QUOTES is enabled.
This commit is contained in:
Jared Brandt 2018-05-17 05:56:35 -06:00 committed by Jakub Vrana
parent bb3d2957e1
commit e959e46fa5
2 changed files with 2 additions and 1 deletions

View file

@ -579,7 +579,7 @@ if (!defined("DRIVER")) {
*/
function foreign_keys($table) {
global $connection, $on_actions;
static $pattern = '`(?:[^`]|``)+`';
static $pattern = '(?:`(?:[^`]|``)+`)|(?:"(?:[^"]|"")+")';
$return = array();
$create_table = $connection->result("SHOW CREATE TABLE " . table($table), 1);
if ($create_table) {

View file

@ -2,6 +2,7 @@ Adminer 4.6.4-dev:
Fix inline editing of empty cells (regression from 4.6.3)
Allow adding more than two indexes and forign key columns at a time (regression from 4.4.0)
Fix function change with set data type
MySQL: Support foreign keys created with ANSI quotes (bug #620)
Adminer 4.6.3 (released 2018-06-28):
Disallow using password-less databases