From 9307f1304f551afa537549c1ea69f50f7a63c03d Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Wed, 26 May 2010 16:10:09 +0200 Subject: [PATCH] MS SQL type length --- adminer/drivers/mssql.inc.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/adminer/drivers/mssql.inc.php b/adminer/drivers/mssql.inc.php index 8a9885ea..e59df29d 100644 --- a/adminer/drivers/mssql.inc.php +++ b/adminer/drivers/mssql.inc.php @@ -319,11 +319,12 @@ LEFT JOIN sys.default_constraints d ON c.default_object_id = d.parent_column_id WHERE o.schema_id = SCHEMA_ID(" . $connection->quote(get_schema()) . ") AND o.type IN ('S', 'U', 'V') AND o.name = " . $connection->quote($table) ); while ($row = $result->fetch_assoc()) { - $length = $row["max_length"]; //! precision, scale + $type = $row["type"]; + $length = (ereg("char|binary", $type) ? $row["max_length"] : ($type == "decimal" ? "$row[precision],$row[scale]" : "")); $return[$row["name"]] = array( "field" => $row["name"], - "full_type" => $row["type"] . ($length ? "($length)" : ""), - "type" => $row["type"], + "full_type" => $type . ($length ? "($length)" : ""), + "type" => $type, "length" => $length, "default" => $row["default"], "null" => $row["is_nullable"],