Space in type (bug 1896054)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@382 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
f2813b5741
commit
a9eab4cad1
|
@ -177,7 +177,7 @@ function normalize_enum($match) {
|
||||||
function routine($name, $type) {
|
function routine($name, $type) {
|
||||||
global $mysql, $enum_length, $inout;
|
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");
|
$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";
|
$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);
|
$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);
|
preg_match("~\\(((?:$pattern\\s*,?)*)\\)" . ($type == "FUNCTION" ? "\\s*RETURNS\\s+$type_pattern" : "") . "\\s*(.*)~is", $create, $match);
|
||||||
|
|
|
@ -18,7 +18,7 @@ function optionlist($options, $selected = array()) {
|
||||||
if (is_array($v)) {
|
if (is_array($v)) {
|
||||||
$return .= '<optgroup label="' . htmlspecialchars($k) . '">';
|
$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);
|
$checked = in_array($val, (array) $selected, true);
|
||||||
$return .= '<option' . ($checked ? ' selected="selected"' : '') . '>' . htmlspecialchars($val) . '</option>';
|
$return .= '<option' . ($checked ? ' selected="selected"' : '') . '>' . htmlspecialchars($val) . '</option>';
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ if ($_POST) {
|
||||||
|
|
||||||
<form action="" method="post" id="form">
|
<form action="" method="post" id="form">
|
||||||
<table border="0" cellspacing="0" cellpadding="2">
|
<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 } ?>
|
<?php if (isset($_GET["function"])) { ?><tr><td><?php echo lang('Return type'); ?></td><?php echo edit_type("returns", $row["returns"], $collations); ?></tr><?php } ?>
|
||||||
</table>
|
</table>
|
||||||
<?php echo type_change(count($row["fields"])); ?>
|
<?php echo type_change(count($row["fields"])); ?>
|
||||||
|
|
Loading…
Reference in a new issue