]> git.joonet.de Git - adminer.git/commitdiff
SQLite: Allow working with INSTEAD OF triggers
authorJakub Vrana <jakub@vrana.cz>
Sat, 21 Dec 2013 00:12:42 +0000 (16:12 -0800)
committerJakub Vrana <jakub@vrana.cz>
Sat, 21 Dec 2013 00:12:42 +0000 (16:12 -0800)
adminer/drivers/sqlite.inc.php

index c3d2d9cf423556366b321afc2850c799ec773182..8cdf39dc9759b083f7e0947fb3e342ccc85e1730 100644 (file)
@@ -630,7 +630,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
                        return array("Statement" => "BEGIN\n\t;\nEND");
                }
                preg_match(
-                       '~^CREATE\\s+TRIGGER\\s*(?:[^`"\\s]+|`[^`]*`|"[^"]*")+\\s*([a-z]+)\\s+([a-z]+)\\s+ON\\s*(?:[^`"\\s]+|`[^`]*`|"[^"]*")+\\s*(?:FOR\\s*EACH\\s*ROW\\s)?(.*)~is',
+                       '~^CREATE\\s+TRIGGER\\s*(?:[^`"\\s]+|`[^`]*`|"[^"]*")+\\s*(BEFORE|AFTER|INSTEAD\\s+OF)\\s+([a-z]+)\\s+ON\\s*(?:[^`"\\s]+|`[^`]*`|"[^"]*")+\\s*(?:FOR\\s*EACH\\s*ROW\\s)?(.*)~is',
                        $connection->result("SELECT sql FROM sqlite_master WHERE type = 'trigger' AND name = " . q($name)),
                        $match
                );