Copy triggers when copying table

This commit is contained in:
Jakub Vrana 2018-05-06 17:36:52 +02:00
parent 84c65fcca6
commit 7b60b03e6a
2 changed files with 7 additions and 0 deletions

View file

@ -811,6 +811,12 @@ if (!defined("DRIVER")) {
) {
return false;
}
foreach (get_rows("SHOW TRIGGERS LIKE " . q(addcslashes($table, "%_\\"))) as $row) {
$trigger = $row["Trigger"];
if (!queries("CREATE TRIGGER " . ($target == DB ? idf_escape("copy_$trigger") : idf_escape($target) . "." . idf_escape($trigger)) . " $row[Timing] $row[Event] ON $name FOR EACH ROW\n$row[Statement];")) {
return false;
}
}
}
foreach ($views as $table) {
$name = ($target == DB ? table("copy_$table") : idf_escape($target) . "." . table($table));

View file

@ -1,5 +1,6 @@
Adminer 4.6.3-dev:
Disallow using password-less databases
Copy triggers when copying table
Stop session before connecting
Simplify running slow queries
Decrease timeout for running slow queries from 5 seconds to 2 seconds