]> git.joonet.de Git - adminer.git/commitdiff
Fix parsing of functions returning datetime (bug #3518425)
authorJakub Vrana <jakub@vrana.cz>
Mon, 14 May 2012 00:19:53 +0000 (17:19 -0700)
committerJakub Vrana <jakub@vrana.cz>
Mon, 14 May 2012 00:19:53 +0000 (17:19 -0700)
adminer/drivers/mysql.inc.php

index 681a4e139b6ad1218ebc6eedd2896d135ba66235..6274c997b98224a25878aaa0fc82254bcc17977f 100644 (file)
@@ -752,7 +752,7 @@ if (!defined("DRIVER")) {
                $type_pattern = "((" . implode("|", array_merge(array_keys($types), $aliases)) . ")(?:\\s*\\(((?:[^'\")]*|$enum_length)+)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s]+)['\"]?)?";
                $pattern = "\\s*(" . ($type == "FUNCTION" ? "" : $inout) . ")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$type_pattern";
                $create = $connection->result("SHOW CREATE $type " . idf_escape($name), 2);
-               preg_match("~\\(((?:$pattern\\s*,?)*)\\)" . ($type == "FUNCTION" ? "\\s*RETURNS\\s+$type_pattern" : "") . "\\s*(.*)~is", $create, $match);
+               preg_match("~\\(((?:$pattern\\s*,?)*)\\)\\s*" . ($type == "FUNCTION" ? "RETURNS\\s+$type_pattern\\s+" : "") . "(.*)~is", $create, $match);
                $fields = array();
                preg_match_all("~$pattern\\s*,?~is", $match[1], $matches, PREG_SET_ORDER);
                foreach ($matches as $param) {