]> git.joonet.de Git - adminer.git/commitdiff
Fix datetime type parsing (bug #3418043)
authorJakub Vrana <jakub@vrana.cz>
Fri, 29 Jun 2012 23:41:12 +0000 (16:41 -0700)
committerJakub Vrana <jakub@vrana.cz>
Fri, 29 Jun 2012 23:41:12 +0000 (16:41 -0700)
adminer/drivers/mysql.inc.php

index eb9eeeacd45e9739dc98cd796d2380f2fd4ab6ef..d7ed85db9eac92353bb5242f3d732e24f69ac7e9 100644 (file)
@@ -749,7 +749,7 @@ if (!defined("DRIVER")) {
        function routine($name, $type) {
                global $connection, $enum_length, $inout, $types;
                $aliases = array("bool", "boolean", "integer", "double precision", "real", "dec", "numeric", "fixed", "national char", "national varchar");
-               $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]+)['\"]?)?";
+               $type_pattern = "((" . implode("|", array_merge(array_keys($types), $aliases)) . ")\\b(?:\\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*,?)*)\\)\\s*" . ($type == "FUNCTION" ? "RETURNS\\s+$type_pattern\\s+" : "") . "(.*)~is", $create, $match);