]> git.joonet.de Git - adminer.git/commitdiff
Fixes foreign key pattern in MySQL
authorJared Brandt <jrdbrndt@gmail.com>
Thu, 17 May 2018 11:56:35 +0000 (05:56 -0600)
committerJakub Vrana <jakub@vrana.cz>
Sun, 15 Jul 2018 18:51:09 +0000 (20:51 +0200)
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.

adminer/drivers/mysql.inc.php
changes.txt

index c54ade0f77085e9405cb46b23126a0eaac731476..82ea8fc103eace4b055ca9e9b54e84cb2467562c 100644 (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) {
index baa2a8870c3afabe7296c115660633984aee7188..6b775e89a2aa45ad8272659f1b5bddcbb6bd4aec 100644 (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