1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-18 12:21:24 +02:00

Driver specific trigger export

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1519 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2010-05-05 16:28:37 +00:00
parent da8a1b66b9
commit cc04be2eb2
5 changed files with 30 additions and 19 deletions

View File

@@ -9,21 +9,6 @@ function tar_file($filename, $contents) {
return $return . str_repeat("\0", 512 - strlen($return)) . $contents . str_repeat("\0", 511 - (strlen($contents) + 511) % 512);
}
function dump_triggers($table, $style) {
global $connection;
if ($_POST["format"] == "sql" && $style && support("trigger")) {
$result = $connection->query("SHOW TRIGGERS LIKE " . $connection->quote(addcslashes($table, "%_")));
if ($result->num_rows) {
$s = "\nDELIMITER ;;\n";
while ($row = $result->fetch_assoc()) {
$s .= "\n" . ($style == 'CREATE+ALTER' ? "DROP TRIGGER IF EXISTS " . idf_escape($row["Trigger"]) . ";;\n" : "")
. "CREATE TRIGGER " . idf_escape($row["Trigger"]) . " $row[Timing] $row[Event] ON " . idf_escape($row["Table"]) . " FOR EACH ROW\n$row[Statement];;\n";
}
echo "$s\nDELIMITER ;\n";
}
}
}
function dump_table($table, $style, $is_view = false) {
global $connection;
if ($_POST["format"] != "sql") {