diff --git a/adminer/drivers/mysql.inc.php b/adminer/drivers/mysql.inc.php index a4336a19..1a3d765e 100644 --- a/adminer/drivers/mysql.inc.php +++ b/adminer/drivers/mysql.inc.php @@ -955,11 +955,11 @@ if (!defined("DRIVER")) { * @return array ["fields" => ["field" => , "type" => , "length" => , "unsigned" => , "inout" => , "collation" => ], "returns" => , "definition" => , "language" => ] */ function routine($name, $type) { - global $connection, $enum_length, $inout, $driver; + global $connection, $enum_length, $driver; $aliases = array("bool", "boolean", "integer", "double precision", "real", "dec", "numeric", "fixed", "national char", "national varchar"); $space = "(?:\\s|/\\*[\s\S]*?\\*/|(?:#|-- )[^\n]*\n?|--\r?\n)"; $type_pattern = "((" . implode("|", array_merge(array_keys($driver->types()), $aliases)) . ")\\b(?:\\s*\\(((?:[^'\")]|$enum_length)++)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s,]+)['\"]?)?"; - $pattern = "$space*(" . ($type == "FUNCTION" ? "" : $inout) . ")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$type_pattern"; + $pattern = "$space*(" . ($type == "FUNCTION" ? "" : $driver->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); $fields = array(); diff --git a/adminer/include/bootstrap.inc.php b/adminer/include/bootstrap.inc.php index 8a23fe73..f2a57fe5 100644 --- a/adminer/include/bootstrap.inc.php +++ b/adminer/include/bootstrap.inc.php @@ -35,7 +35,7 @@ if ($_GET["script"] == "version") { exit; } -global $adminer, $connection, $driver, $drivers, $enum_length, $error, $HTTPS, $inout, $jush, $LANG, $langs, $permanent, $has_token, $token, $translations, $VERSION; // allows including Adminer inside a function +global $adminer, $connection, $driver, $drivers, $enum_length, $error, $HTTPS, $jush, $LANG, $langs, $permanent, $has_token, $token, $translations, $VERSION; // allows including Adminer inside a function if (!$_SERVER["REQUEST_URI"]) { // IIS 5 compatibility $_SERVER["REQUEST_URI"] = $_SERVER["ORIG_PATH_INFO"]; diff --git a/adminer/include/driver.inc.php b/adminer/include/driver.inc.php index ad25c444..102f118d 100644 --- a/adminer/include/driver.inc.php +++ b/adminer/include/driver.inc.php @@ -34,6 +34,7 @@ abstract class SqlDriver { var $functions = array(); ///< @var array functions used in select var $grouping = array(); ///< @var array grouping functions used in select var $onActions = "RESTRICT|NO ACTION|CASCADE|SET NULL|SET DEFAULT"; ///< @var string used in foreign_keys() + var $inout = "IN|OUT|INOUT"; /** Create object for performing database operations * @param Db diff --git a/adminer/include/editing.inc.php b/adminer/include/editing.inc.php index f738d2da..d9686d4e 100644 --- a/adminer/include/editing.inc.php +++ b/adminer/include/editing.inc.php @@ -338,7 +338,7 @@ function type_class($type) { * @return null */ function edit_fields($fields, $collations, $type = "TABLE", $foreign_keys = array()) { - global $inout; + global $driver; $fields = array_values($fields); $default_class = (($_POST ? $_POST["defaults"] : adminer_setting("defaults")) ? "" : " class='hidden'"); $comment_class = (($_POST ? $_POST["comments"] : adminer_setting("comments")) ? "" : " class='hidden'"); @@ -372,7 +372,7 @@ function edit_fields($fields, $collations, $type = "TABLE", $foreign_keys = arra $display = (isset($_POST["add"][$i-1]) || (isset($field["field"]) && !$_POST["drop_col"][$i])) && (support("drop_col") || $orig == ""); ?>