From: jakubvrana Date: Fri, 24 Jul 2009 16:16:50 +0000 (+0000) Subject: Use field name in routine X-Git-Tag: v3.0.0~620 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=2184679bb934d3efd0ad9b5d31d98235a6735865;p=adminer.git Use field name in routine git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@907 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- diff --git a/adminer/include/editing.inc.php b/adminer/include/editing.inc.php index 8d139513..948461e2 100644 --- a/adminer/include/editing.inc.php +++ b/adminer/include/editing.inc.php @@ -146,10 +146,11 @@ function routine($name, $type) { preg_match("~\\(((?:$pattern\\s*,?)*)\\)" . ($type == "FUNCTION" ? "\\s*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 $i => $param) { + foreach ($matches as $param) { + $name = str_replace("``", "`", $param[2]) . $param[3]; $data_type = strtolower($param[4]); - $fields[$i] = array( - "field" => str_replace("``", "`", $param[2]) . $param[3], + $fields[$name] = array( + "field" => $name, "type" => (isset($aliases[$data_type]) ? $aliases[$data_type] : $data_type), "length" => preg_replace_callback("~$enum_length~s", 'normalize_enum', $param[5]), "unsigned" => strtolower(preg_replace('~\\s+~', ' ', trim("$param[7] $param[6]"))),