aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Data/MSSQL/MSSQLInventoryData.cs21
1 files changed, 18 insertions, 3 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLInventoryData.cs b/OpenSim/Data/MSSQL/MSSQLInventoryData.cs
index d68ac39..3bf4d04 100644
--- a/OpenSim/Data/MSSQL/MSSQLInventoryData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLInventoryData.cs
@@ -227,13 +227,19 @@ namespace OpenSim.Data.MSSQL
227 string sql = @"INSERT INTO inventoryfolders ([folderID], [agentID], [parentFolderID], [folderName], [type], [version]) 227 string sql = @"INSERT INTO inventoryfolders ([folderID], [agentID], [parentFolderID], [folderName], [type], [version])
228 VALUES (@folderID, @agentID, @parentFolderID, @folderName, @type, @version);"; 228 VALUES (@folderID, @agentID, @parentFolderID, @folderName, @type, @version);";
229 229
230 230 string folderName = folder.Name;
231 if (folderName.Length > 64)
232 {
233 folderName = folderName.Substring(0, 64);
234 m_log.Warn("[INVENTORY DB]: Name field truncated from " + folder.Name.Length.ToString() + " to " + folderName.Length + " characters on add");
235 }
236
231 using (AutoClosingSqlCommand command = database.Query(sql)) 237 using (AutoClosingSqlCommand command = database.Query(sql))
232 { 238 {
233 command.Parameters.Add(database.CreateParameter("folderID", folder.ID)); 239 command.Parameters.Add(database.CreateParameter("folderID", folder.ID));
234 command.Parameters.Add(database.CreateParameter("agentID", folder.Owner)); 240 command.Parameters.Add(database.CreateParameter("agentID", folder.Owner));
235 command.Parameters.Add(database.CreateParameter("parentFolderID", folder.ParentID)); 241 command.Parameters.Add(database.CreateParameter("parentFolderID", folder.ParentID));
236 command.Parameters.Add(database.CreateParameter("folderName", folder.Name)); 242 command.Parameters.Add(database.CreateParameter("folderName", folderName));
237 command.Parameters.Add(database.CreateParameter("type", folder.Type)); 243 command.Parameters.Add(database.CreateParameter("type", folder.Type));
238 command.Parameters.Add(database.CreateParameter("version", folder.Version)); 244 command.Parameters.Add(database.CreateParameter("version", folder.Version));
239 245
@@ -262,15 +268,24 @@ namespace OpenSim.Data.MSSQL
262 type = @type, 268 type = @type,
263 version = @version 269 version = @version
264 WHERE folderID = @keyFolderID"; 270 WHERE folderID = @keyFolderID";
271
272 string folderName = folder.Name;
273 if (folderName.Length > 64)
274 {
275 folderName = folderName.Substring(0, 64);
276 m_log.Warn("[INVENTORY DB]: Name field truncated from " + folder.Name.Length.ToString() + " to " + folderName.Length + " characters on update");
277 }
278
265 using (AutoClosingSqlCommand command = database.Query(sql)) 279 using (AutoClosingSqlCommand command = database.Query(sql))
266 { 280 {
267 command.Parameters.Add(database.CreateParameter("folderID", folder.ID)); 281 command.Parameters.Add(database.CreateParameter("folderID", folder.ID));
268 command.Parameters.Add(database.CreateParameter("agentID", folder.Owner)); 282 command.Parameters.Add(database.CreateParameter("agentID", folder.Owner));
269 command.Parameters.Add(database.CreateParameter("parentFolderID", folder.ParentID)); 283 command.Parameters.Add(database.CreateParameter("parentFolderID", folder.ParentID));
270 command.Parameters.Add(database.CreateParameter("folderName", folder.Name)); 284 command.Parameters.Add(database.CreateParameter("folderName", folderName));
271 command.Parameters.Add(database.CreateParameter("type", folder.Type)); 285 command.Parameters.Add(database.CreateParameter("type", folder.Type));
272 command.Parameters.Add(database.CreateParameter("version", folder.Version)); 286 command.Parameters.Add(database.CreateParameter("version", folder.Version));
273 command.Parameters.Add(database.CreateParameter("@keyFolderID", folder.ID)); 287 command.Parameters.Add(database.CreateParameter("@keyFolderID", folder.ID));
288
274 try 289 try
275 { 290 {
276 command.ExecuteNonQuery(); 291 command.ExecuteNonQuery();