]> git.joonet.de Git - adminer.git/commitdiff
Space in type (bug 1896054)
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Thu, 20 Mar 2008 16:38:21 +0000 (16:38 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Thu, 20 Mar 2008 16:38:21 +0000 (16:38 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@382 7c3ca157-0c34-0410-bff1-cbf682f78f5c

editing.inc.php
functions.inc.php
procedure.inc.php

index 97aee9d1452779934ae101833780d5aa1b6388a1..904212b2fdeb4e66a4b44b6d0daf90f51a315b87 100644 (file)
@@ -177,7 +177,7 @@ function normalize_enum($match) {
 function routine($name, $type) {
        global $mysql, $enum_length, $inout;
        $aliases = array("bit" => "tinyint", "bool" => "tinyint", "boolean" => "tinyint", "integer" => "int", "double precision" => "float", "real" => "float", "dec" => "decimal", "numeric" => "decimal", "fixed" => "decimal", "national char" => "char", "national varchar" => "varchar");
-       $type_pattern = "([ a-z]+)(?:\\s*\\(((?:[^'\")]*|$enum_length)+)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s]+)['\"]?)?";
+       $type_pattern = "([a-z]+)(?:\\s*\\(((?:[^'\")]*|$enum_length)+)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s]+)['\"]?)?";
        $pattern = "\\s*(" . ($type == "FUNCTION" ? "" : implode("|", $inout)) . ")?\\s*(?:`((?:[^`]+|``)*)`\\s*|\\b(\\S+)\\s+)$type_pattern";
        $create = $mysql->result($mysql->query("SHOW CREATE $type " . idf_escape($name)), 2);
        preg_match("~\\(((?:$pattern\\s*,?)*)\\)" . ($type == "FUNCTION" ? "\\s*RETURNS\\s+$type_pattern" : "") . "\\s*(.*)~is", $create, $match);
index 12c869c7b148b695919966fc84e5263c4aac8303..6319ea7442762c7b65d1ec4f3a9a40af336c364f 100644 (file)
@@ -18,7 +18,7 @@ function optionlist($options, $selected = array()) {
                if (is_array($v)) {
                        $return .= '<optgroup label="' . htmlspecialchars($k) . '">';
                }
-               foreach ((is_array($v) ? $v : array($k => $v)) as $key => $val) {
+               foreach ((is_array($v) ? $v : array($v)) as $val) {
                        $checked = in_array($val, (array) $selected, true);
                        $return .= '<option' . ($checked ? ' selected="selected"' : '') . '>' . htmlspecialchars($val) . '</option>';
                }
index e9629ce08b17bbf0d24b1af7f483c6121cc42df7..2d94abd100520787aa1bc8a6019a0182ae50755b 100644 (file)
@@ -56,7 +56,7 @@ if ($_POST) {
 
 <form action="" method="post" id="form">
 <table border="0" cellspacing="0" cellpadding="2">
-<?php edit_fields($row["fields"], get_vals("SHOW CHARACTER SET"), $routine); ?>
+<?php edit_fields($row["fields"], $collations, $routine); ?>
 <?php if (isset($_GET["function"])) { ?><tr><td><?php echo lang('Return type'); ?></td><?php echo edit_type("returns", $row["returns"], $collations); ?></tr><?php } ?>
 </table>
 <?php echo type_change(count($row["fields"])); ?>