From e1b4d92ccee32470897e094554f14434907decea Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Wed, 11 Aug 2010 16:55:40 +0200 Subject: [PATCH] Ignore routines errors (bug #3040573) Report export errors --- adminer/dump.inc.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/adminer/dump.inc.php b/adminer/dump.inc.php index 53acc091..49ec2203 100644 --- a/adminer/dump.inc.php +++ b/adminer/dump.inc.php @@ -46,9 +46,13 @@ SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; if ($_POST["routines"]) { foreach (array("FUNCTION", "PROCEDURE") as $routine) { $result = $connection->query("SHOW $routine STATUS WHERE Db = " . $connection->quote($db)); - while ($row = $result->fetch_assoc()) { - $out .= ($style != 'DROP+CREATE' ? "DROP $routine IF EXISTS " . idf_escape($row["Name"]) . ";;\n" : "") - . $connection->result("SHOW CREATE $routine " . idf_escape($row["Name"]), 2) . ";;\n\n"; + if ($result) { + while ($row = $result->fetch_assoc()) { + $out .= ($style != 'DROP+CREATE' ? "DROP $routine IF EXISTS " . idf_escape($row["Name"]) . ";;\n" : "") + . $connection->result("SHOW CREATE $routine " . idf_escape($row["Name"]), 2) . ";;\n\n"; + } + } else { + echo "-- $connection->error\n\n"; } } } @@ -59,6 +63,8 @@ SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; $out .= ($style != 'DROP+CREATE' ? "DROP EVENT IF EXISTS " . idf_escape($row["Name"]) . ";;\n" : "") . $connection->result("SHOW CREATE EVENT " . idf_escape($row["Name"]), 3) . ";;\n\n"; } + } else { + echo "-- $connection->error\n\n"; } } if ($out) {