From 88a14c9a761d0b7d488990b9c9ab4555b99a949f Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Fri, 28 Mar 2008 14:19:17 +0000 Subject: [PATCH] * fixed pk_violation on rename for MSSQLInventoryData MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ("le fix le plus ugly for le problem trés dumb") --- OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs b/OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs index 1e732146f3..03bde7e635 100644 --- a/OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs +++ b/OpenSim/Framework/Data.MSSQL/MSSQLInventoryData.cs @@ -424,6 +424,12 @@ namespace OpenSim.Framework.Data.MSSQL /// The inventory item public void addInventoryItem(InventoryItemBase item) { + if (getInventoryItem(item.inventoryID) != null) + { + updateInventoryItem(item); + return; + } + string sql = "INSERT INTO inventoryitems"; sql += "([inventoryID], [assetID], [assetType], [parentFolderID], [avatarID], [inventoryName], [inventoryDescription], [inventoryNextPermissions], [inventoryCurrentPermissions], [invType], [creatorID], [inventoryBasePermissions], [inventoryEveryOnePermissions]) VALUES ";