From: Jakub Vrana Date: Wed, 26 Feb 2025 21:43:03 +0000 (+0100) Subject: MS SQL: Do not update primary key in CSV import X-Git-Tag: v5.0.0~104 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=48a680658ceed43a499568e58591b385ae36e6f8;p=adminer.git MS SQL: Do not update primary key in CSV import --- diff --git a/adminer/drivers/mssql.inc.php b/adminer/drivers/mssql.inc.php index 8c5f84a5..3c92311d 100644 --- a/adminer/drivers/mssql.inc.php +++ b/adminer/drivers/mssql.inc.php @@ -194,12 +194,10 @@ if (isset($_GET["mssql"])) { $c = 0; foreach ($set as $key => $val) { $c++; - $name = idf_unescape($key); - if (!$fields[$name]["auto_increment"]) { - $update[] = "$key = c$c"; - } - if (isset($primary[$name])) { + if (isset($primary[idf_unescape($key)])) { $where[] = "$key = c$c"; + } else { + $update[] = "$key = c$c"; } } $values = array();