]> git.joonet.de Git - adminer.git/commitdiff
MS SQL: Do not update AI value
authorJakub Vrana <jakub@vrana.cz>
Sun, 28 Nov 2010 15:35:34 +0000 (16:35 +0100)
committerJakub Vrana <jakub@vrana.cz>
Mon, 29 Nov 2010 21:02:10 +0000 (22:02 +0100)
adminer/include/functions.inc.php
todo.txt

index 2e18be3732a070b00c38eb12f9fc739fbbde638f..86206a5071e1e72deb6dc62965bcb4101f4092fa 100644 (file)
@@ -618,7 +618,11 @@ function input($field, $value, $function) {
        global $types, $adminer, $jush;
        $name = h(bracket_escape($field["field"]));
        echo "<td class='function'>";
-       $functions = (isset($_GET["select"]) ? array("orig" => lang('original')) : array()) + $adminer->editFunctions($field);
+       $reset = ($jush == "mssql" && $field["auto_increment"]);
+       if ($reset && !$_POST["save"]) {
+               $function = null;
+       }
+       $functions = (isset($_GET["select"]) || $reset ? array("orig" => lang('original')) : array()) + $adminer->editFunctions($field);
        $attrs = " name='fields[$name]'";
        if ($field["type"] == "enum") {
                echo nbsp($functions[""]) . "<td>" . $adminer->editInput($_GET["edit"], $field, $attrs, $value);
index b5d554febea84fce50a1c88386b84366ee9833e2..46ad70bc111f3920d2a1ea4a6cc020e19cc9c113 100644 (file)
--- a/todo.txt
+++ b/todo.txt
@@ -42,7 +42,6 @@ Column rights - http://www.postgresql.org/docs/8.4/static/functions-info.html
 bool in Editor
 
 MS SQL:
-Edit of AI column
 Non UTF-8 character sets
 Detection of table collation
 PDO_MSSQL and PDO_SQLSRV driver with seek