diff options
author | Chris Hart | 2011-06-01 04:01:18 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-06-01 21:01:04 +0100 |
commit | 5fb0455e929d96efb41d23f67653b329792ab834 (patch) | |
tree | b28593f324ba685cd3c4d23036438a4890bb7bb8 /OpenSim/Data/MSSQL/MSSQLXInventoryData.cs | |
parent | a few minor formatting tweaks (diff) | |
download | opensim-SC_OLD-5fb0455e929d96efb41d23f67653b329792ab834.zip opensim-SC_OLD-5fb0455e929d96efb41d23f67653b329792ab834.tar.gz opensim-SC_OLD-5fb0455e929d96efb41d23f67653b329792ab834.tar.bz2 opensim-SC_OLD-5fb0455e929d96efb41d23f67653b329792ab834.tar.xz |
Updates to MSSQL to most recent compatibility, also included Windlight support. Needs plenty of testing but clean install and migration from 0.6.9 have been tested and work, a few indexes still need to be added for performance.
Diffstat (limited to 'OpenSim/Data/MSSQL/MSSQLXInventoryData.cs')
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLXInventoryData.cs | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLXInventoryData.cs b/OpenSim/Data/MSSQL/MSSQLXInventoryData.cs index 01689a4..10b0f29 100644 --- a/OpenSim/Data/MSSQL/MSSQLXInventoryData.cs +++ b/OpenSim/Data/MSSQL/MSSQLXInventoryData.cs | |||
@@ -66,11 +66,18 @@ namespace OpenSim.Data.MSSQL | |||
66 | 66 | ||
67 | public bool StoreFolder(XInventoryFolder folder) | 67 | public bool StoreFolder(XInventoryFolder folder) |
68 | { | 68 | { |
69 | if (folder.folderName.Length > 64) | ||
70 | folder.folderName = folder.folderName.Substring(0, 64); | ||
69 | return m_Folders.Store(folder); | 71 | return m_Folders.Store(folder); |
70 | } | 72 | } |
71 | 73 | ||
72 | public bool StoreItem(XInventoryItem item) | 74 | public bool StoreItem(XInventoryItem item) |
73 | { | 75 | { |
76 | if (item.inventoryName.Length > 64) | ||
77 | item.inventoryName = item.inventoryName.Substring(0, 64); | ||
78 | if (item.inventoryDescription.Length > 128) | ||
79 | item.inventoryDescription = item.inventoryDescription.Substring(0, 128); | ||
80 | |||
74 | return m_Items.Store(item); | 81 | return m_Items.Store(item); |
75 | } | 82 | } |
76 | 83 | ||
@@ -78,7 +85,6 @@ namespace OpenSim.Data.MSSQL | |||
78 | { | 85 | { |
79 | return m_Folders.Delete(field, val); | 86 | return m_Folders.Delete(field, val); |
80 | } | 87 | } |
81 | |||
82 | public bool DeleteFolders(string[] fields, string[] vals) | 88 | public bool DeleteFolders(string[] fields, string[] vals) |
83 | { | 89 | { |
84 | return m_Folders.Delete(fields, vals); | 90 | return m_Folders.Delete(fields, vals); |
@@ -88,12 +94,10 @@ namespace OpenSim.Data.MSSQL | |||
88 | { | 94 | { |
89 | return m_Items.Delete(field, val); | 95 | return m_Items.Delete(field, val); |
90 | } | 96 | } |
91 | |||
92 | public bool DeleteItems(string[] fields, string[] vals) | 97 | public bool DeleteItems(string[] fields, string[] vals) |
93 | { | 98 | { |
94 | return m_Items.Delete(fields, vals); | 99 | return m_Items.Delete(fields, vals); |
95 | } | 100 | } |
96 | |||
97 | public bool MoveItem(string id, string newParent) | 101 | public bool MoveItem(string id, string newParent) |
98 | { | 102 | { |
99 | return m_Items.MoveItem(id, newParent); | 103 | return m_Items.MoveItem(id, newParent); |
@@ -172,5 +176,27 @@ namespace OpenSim.Data.MSSQL | |||
172 | 176 | ||
173 | } | 177 | } |
174 | } | 178 | } |
179 | public override bool Store(XInventoryItem item) | ||
180 | { | ||
181 | if (!base.Store(item)) | ||
182 | return false; | ||
183 | string sql = "update inventoryfolders set version=version+1 where folderID = @folderID"; | ||
184 | using (SqlConnection conn = new SqlConnection(m_ConnectionString)) | ||
185 | using (SqlCommand cmd = new SqlCommand(sql, conn)) | ||
186 | { | ||
187 | conn.Open(); | ||
188 | |||
189 | cmd.Parameters.AddWithValue("@folderID", item.parentFolderID.ToString()); | ||
190 | try | ||
191 | { | ||
192 | cmd.ExecuteNonQuery(); | ||
193 | } | ||
194 | catch (Exception e) | ||
195 | { | ||
196 | return false; | ||
197 | } | ||
198 | } | ||
199 | return true; | ||
200 | } | ||
175 | } | 201 | } |
176 | } | 202 | } |