SQLite: Search trigger name only among triggers
This commit is contained in:
parent
8cd4f6e225
commit
f4d2794c9c
|
@ -629,7 +629,11 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
|
|||
if ($name == "") {
|
||||
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', $connection->result("SELECT sql FROM sqlite_master WHERE name = " . q($name)), $match);
|
||||
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',
|
||||
$connection->result("SELECT sql FROM sqlite_master WHERE type = 'trigger' AND name = " . q($name)),
|
||||
$match
|
||||
);
|
||||
return array("Timing" => strtoupper($match[1]), "Event" => strtoupper($match[2]), "Trigger" => $name, "Statement" => $match[3]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue