]> git.joonet.de Git - adminer.git/commitdiff
Separate $inout
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Mon, 16 Jul 2007 13:56:34 +0000 (13:56 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Mon, 16 Jul 2007 13:56:34 +0000 (13:56 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@192 7c3ca157-0c34-0410-bff1-cbf682f78f5c

call.inc.php
functions.inc.php
index.php

index 7a450b9fdaa521ce050a9335da3da193d5bc673b..b805e5bc426688d1d497167f23c97ece30e8d0ca 100644 (file)
@@ -5,10 +5,10 @@ $routine = routine($_GET["call"], (isset($_GET["callf"]) ? "FUNCTION" : "PROCEDU
 $in = array();
 $out = array();
 foreach ($routine["fields"] as $i => $field) {
-       if (strcasecmp("out", substr($field["inout"], -3)) == 0) {
+       if (substr($field["inout"], -3) == "OUT") {
                $out[$i] = "@" . idf_escape($field["field"]) . " AS " . idf_escape($field["field"]);
        }
-       if (!$match[1] || strcasecmp("in", substr($field["inout"], 0, 2)) == 0) {
+       if (!$field["inout"] || substr($field["inout"], 0, 2) == "IN") {
                $in[] = $i;
        }
 }
index 5361570048797c56f4521c47cd872dd8afb6d850..4f2b7b80f149468807e7623e2b9b6595c881b504 100644 (file)
@@ -122,7 +122,7 @@ function normalize_enum($match) {
 
 function routine($name, $type) {
        global $mysql, $enum_length;
-       $pattern = "\\s*(IN|OUT|INOUT)?\\s*(?:`((?:[^`]+|``)*)`\\s*|\\b(\\S+)\\s+)([a-z]+)(?:\\s*\\(((?:[^'\")]*|$enum_length)+)\\))?\\s*(zerofill\\s+)?(unsigned(?:\\s+zerofill)?)?";
+       $pattern = "\\s*(" . implode("|", $inout) . ")?\\s*(?:`((?:[^`]+|``)*)`\\s*|\\b(\\S+)\\s+)([a-z]+)(?:\\s*\\(((?:[^'\")]*|$enum_length)+)\\))?\\s*(zerofill\\s+)?(unsigned(?:\\s+zerofill)?)?";
        $create = $mysql->result($mysql->query("SHOW CREATE $type " . idf_escape($name)), 2);
        preg_match("~\\($pattern(?:\\s*,$pattern)*~is", $create, $match);
        $params = array();
@@ -134,7 +134,7 @@ function routine($name, $type) {
                        "length" => preg_replace_callback("~$enum_length~s", 'normalize_enum', $match[5]),
                        "unsigned" => strtolower(preg_replace('~\\s+~', ' ', trim("$match[7] $match[6]"))),
                        "null" => true,
-                       "inout" => $match[1],
+                       "inout" => strtoupper($match[1]),
                );
                $params[$i] = $field;
        }
index 752a3518defa7f5f0c798e3aec078f58ff6a7406..2e38fcc1101dac62228e66c03bb1735661f1085a 100644 (file)
--- a/index.php
+++ b/index.php
@@ -30,6 +30,7 @@ if (isset($_GET["dump"])) {
        );
        $unsigned = array("", "unsigned", "zerofill", "unsigned zerofill");
        $enum_length = '\'(?:\'\'|[^\'\\\\]+|\\\\.)*\'|"(?:""|[^"\\\\]+|\\\\.)*"';
+       $inout = array("IN", "OUT", "INOUT");
        
        if (isset($_GET["table"])) {
                include "./table.inc.php";