1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-08 23:57:29 +02:00

PostgreSQL: Support UPDATE OF triggers (bug #789) and triggers with more events (OR)

This commit is contained in:
Jakub Vrana
2021-03-03 11:07:44 +01:00
parent 42de1051a6
commit 72beecc0ab
5 changed files with 26 additions and 11 deletions

View File

@@ -430,7 +430,7 @@ function drop_create($drop, $create, $drop_created, $test, $drop_test, $location
*/
function create_trigger($on, $row) {
global $jush;
$timing_event = " $row[Timing] $row[Event]" . ($row["Event"] == "UPDATE OF" ? " " . idf_escape($row["Of"]) : "");
$timing_event = " $row[Timing] $row[Event]" . (preg_match('~ OF~', $row["Event"]) ? " $row[Of]" : ""); // SQL injection
return "CREATE TRIGGER "
. idf_escape($row["Trigger"])
. ($jush == "mssql" ? $on . $timing_event : $timing_event . $on)