]> git.joonet.de Git - adminer.git/commitdiff
Foreign keys default actions (bug #3397606)
authorJakub Vrana <jakub@vrana.cz>
Mon, 29 Aug 2011 11:21:02 +0000 (13:21 +0200)
committerJakub Vrana <jakub@vrana.cz>
Mon, 29 Aug 2011 11:21:02 +0000 (13:21 +0200)
adminer/drivers/mysql.inc.php
adminer/drivers/pgsql.inc.php
changes.txt

index 0f030204c1d65346bea43fa62d8e96bfbf4ae4fd..fe8d17b798508076bedb82871b18d34d8e1238df 100644 (file)
@@ -457,8 +457,8 @@ if (!defined("DRIVER")) {
                                        "table" => idf_unescape($match[4] != "" ? $match[4] : $match[3]),
                                        "source" => array_map('idf_unescape', $source[0]),
                                        "target" => array_map('idf_unescape', $target[0]),
-                                       "on_delete" => $match[6],
-                                       "on_update" => $match[7],
+                                       "on_delete" => ($match[6] ? $match[6] : "RESTRICT"),
+                                       "on_update" => ($match[7] ? $match[7] : "RESTRICT"),
                                );
                        }
                }
index 71057e5cb0cec93d629fff8a67382be091f88739..dfbd5d229977c85258317778fa99d6ae8e86430d 100644 (file)
@@ -287,8 +287,8 @@ ORDER BY conkey, conname") as $row) {
                                        $row['table'] = $match2[2];
                                }
                                $row['target'] = array_map('trim', explode(',', $match[3]));
-                               $row['on_delete'] = (preg_match("~ON DELETE ($on_actions)~", $match[4], $match2) ? $match2[1] : '');
-                               $row['on_update'] = (preg_match("~ON UPDATE ($on_actions)~", $match[4], $match2) ? $match2[1] : '');
+                               $row['on_delete'] = (preg_match("~ON DELETE ($on_actions)~", $match[4], $match2) ? $match2[1] : 'NO ACTION');
+                               $row['on_update'] = (preg_match("~ON UPDATE ($on_actions)~", $match[4], $match2) ? $match2[1] : 'NO ACTION');
                                $return[$row['conname']] = $row;
                        }
                }
index 5e9eee5252a41b68fb56668d72d343ac3bd1455c..28133307f4ce0e2f9ea099b239a4f1fb373bc815 100644 (file)
@@ -1,4 +1,5 @@
 Adminer 3.3.4-dev:
+Foreign keys default actions (bug #3397606)
 PostgreSQL: fix alter foreign key
 PostgreSQL over PDO: connect if the eponymous database does not exist (bug #3391619)
 Boolean search (Editor)