Permalink
Browse files

Use DELIMITER in history

  • Loading branch information...
1 parent 1420b6a commit d06de5512e0f8a9ceae4e3c78cc955410d20d625 @vrana committed Mar 8, 2011
Showing with 9 additions and 8 deletions.
  1. +3 −3 adminer/event.inc.php
  2. +3 −3 adminer/include/functions.inc.php
  3. +1 −1 adminer/procedure.inc.php
  4. +1 −1 adminer/trigger.inc.php
  5. +1 −0 changes.txt
View
@@ -14,13 +14,13 @@
: "AT " . q($_POST["STARTS"])
) . " ON COMPLETION" . ($_POST["ON_COMPLETION"] ? "" : " NOT") . " PRESERVE"
;
- query_redirect(($EVENT != ""
+ queries_redirect(substr(ME, 0, -1), ($EVENT != "" ? lang('Event has been altered.') : lang('Event has been created.')), queries(($EVENT != ""
? "ALTER EVENT " . idf_escape($EVENT) . $schedule
. ($EVENT != $_POST["EVENT_NAME"] ? "\nRENAME TO " . idf_escape($_POST["EVENT_NAME"]) : "")
: "CREATE EVENT " . idf_escape($_POST["EVENT_NAME"]) . $schedule
) . "\n" . $statuses[$_POST["STATUS"]] . " COMMENT " . q($_POST["EVENT_COMMENT"])
- . " DO\n$_POST[EVENT_DEFINITION]"
- , substr(ME, 0, -1), ($EVENT != "" ? lang('Event has been altered.') : lang('Event has been created.')));
+ . rtrim(" DO\n$_POST[EVENT_DEFINITION]", ";") . ";"
+ ));
}
}
@@ -424,17 +424,17 @@ function query_redirect($query, $location, $message, $redirect = true, $execute
}
/** Execute and remember query
-* @param string null to return remembered queries
+* @param string null to return remembered queries, end with ';' to use DELIMITER
* @return Min_Result
*/
function queries($query = null) {
global $connection;
static $queries = array();
if (!isset($query)) {
// return executed queries without parameter
- return implode(";\n", $queries);
+ return implode("\n", $queries);
}
- $queries[] = $query;
+ $queries[] = (ereg(';$', $query) ? "DELIMITER ;;\n$query;\nDELIMITER ;" : "$query;");
return $connection->query($query);
}
@@ -14,7 +14,7 @@
}
$dropped = drop_create(
"DROP $routine " . idf_escape($PROCEDURE),
- "CREATE $routine " . idf_escape($_POST["name"]) . " (" . implode(", ", $set) . ")" . (isset($_GET["function"]) ? " RETURNS" . process_type($_POST["returns"], "CHARACTER SET") : "") . "\n$_POST[definition]",
+ "CREATE $routine " . idf_escape($_POST["name"]) . " (" . implode(", ", $set) . ")" . (isset($_GET["function"]) ? " RETURNS" . process_type($_POST["returns"], "CHARACTER SET") : "") . rtrim("\n$_POST[definition]", ";") . ";",
substr(ME, 0, -1),
lang('Routine has been dropped.'),
lang('Routine has been altered.'),
View
@@ -9,7 +9,7 @@
$on = " ON " . table($TABLE);
$dropped = drop_create(
"DROP TRIGGER " . idf_escape($_GET["name"]) . ($jush == "pgsql" ? $on : ""),
- "CREATE TRIGGER " . idf_escape($_POST["Trigger"]) . ($jush == "mssql" ? $on . $timing_event : $timing_event . $on) . " $_POST[Type]\n$_POST[Statement]",
+ "CREATE TRIGGER " . idf_escape($_POST["Trigger"]) . ($jush == "mssql" ? $on . $timing_event : $timing_event . $on) . rtrim(" $_POST[Type]\n$_POST[Statement]", ";") . ";",
ME . "table=" . urlencode($TABLE),
lang('Trigger has been dropped.'),
lang('Trigger has been altered.'),
View
@@ -5,6 +5,7 @@ Esc to focus next field in Tab textarea (thanks to David Grudl)
Enum editor and textarea Ctrl+Enter working in IE
AJAX forms in Google Chrome
Parse UTF-16 and UTF-8 BOM in all text uploads
+Use DELIMITER in history
Adminer 3.2.0 (released 2011-02-24):
Get long texts and slow information by AJAX

0 comments on commit d06de55

Please sign in to comment.