aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/MySQL/MySQLAssetData.cs4
-rw-r--r--OpenSim/Data/MySQL/MySQLAuthenticationData.cs28
-rw-r--r--OpenSim/Data/MySQL/MySQLAvatarData.cs2
-rw-r--r--OpenSim/Data/MySQL/MySQLEstateData.cs14
-rw-r--r--OpenSim/Data/MySQL/MySQLFSAssetData.cs2
-rw-r--r--OpenSim/Data/MySQL/MySQLGenericTableHandler.cs20
-rw-r--r--OpenSim/Data/MySQL/MySQLGroupsData.cs20
-rw-r--r--OpenSim/Data/MySQL/MySQLInventoryData.cs12
-rw-r--r--OpenSim/Data/MySQL/MySQLMigrations.cs6
-rw-r--r--OpenSim/Data/MySQL/MySQLOfflineIMData.cs2
-rw-r--r--OpenSim/Data/MySQL/MySQLPresenceData.cs8
-rw-r--r--OpenSim/Data/MySQL/MySQLRegionData.cs2
-rw-r--r--OpenSim/Data/MySQL/MySQLSimulationData.cs30
-rw-r--r--OpenSim/Data/MySQL/MySQLUserProfilesData.cs176
-rw-r--r--OpenSim/Data/MySQL/MySQLXAssetData.cs6
-rw-r--r--OpenSim/Data/MySQL/MySQLXInventoryData.cs6
16 files changed, 169 insertions, 169 deletions
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs
index 1488e1a..f16cd91 100644
--- a/OpenSim/Data/MySQL/MySQLAssetData.cs
+++ b/OpenSim/Data/MySQL/MySQLAssetData.cs
@@ -329,8 +329,8 @@ namespace OpenSim.Data.MySQL
329 { 329 {
330 m_log.Error( 330 m_log.Error(
331 string.Format( 331 string.Format(
332 "[ASSETS DB]: MySql failure fetching asset set from {0}, count {1}. Exception ", 332 "[ASSETS DB]: MySql failure fetching asset set from {0}, count {1}. Exception ",
333 start, count), 333 start, count),
334 e); 334 e);
335 } 335 }
336 } 336 }
diff --git a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs
index 7627497..af6be75 100644
--- a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs
+++ b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs
@@ -77,21 +77,21 @@ namespace OpenSim.Data.MySQL
77 cmd.Parameters.AddWithValue("?principalID", principalID.ToString()); 77 cmd.Parameters.AddWithValue("?principalID", principalID.ToString());
78 78
79 IDataReader result = cmd.ExecuteReader(); 79 IDataReader result = cmd.ExecuteReader();
80 80
81 if (result.Read()) 81 if (result.Read())
82 { 82 {
83 ret.PrincipalID = principalID; 83 ret.PrincipalID = principalID;
84 84
85 CheckColumnNames(result); 85 CheckColumnNames(result);
86 86
87 foreach (string s in m_ColumnNames) 87 foreach (string s in m_ColumnNames)
88 { 88 {
89 if (s == "UUID") 89 if (s == "UUID")
90 continue; 90 continue;
91 91
92 ret.Data[s] = result[s].ToString(); 92 ret.Data[s] = result[s].ToString();
93 } 93 }
94 94
95 return ret; 95 return ret;
96 } 96 }
97 else 97 else
@@ -132,25 +132,25 @@ namespace OpenSim.Data.MySQL
132 if (!first) 132 if (!first)
133 update += ", "; 133 update += ", ";
134 update += "`" + field + "` = ?"+field; 134 update += "`" + field + "` = ?"+field;
135 135
136 first = false; 136 first = false;
137 137
138 cmd.Parameters.AddWithValue("?"+field, data.Data[field]); 138 cmd.Parameters.AddWithValue("?"+field, data.Data[field]);
139 } 139 }
140 140
141 update += " where UUID = ?principalID"; 141 update += " where UUID = ?principalID";
142 142
143 cmd.CommandText = update; 143 cmd.CommandText = update;
144 cmd.Parameters.AddWithValue("?principalID", data.PrincipalID.ToString()); 144 cmd.Parameters.AddWithValue("?principalID", data.PrincipalID.ToString());
145 145
146 if (ExecuteNonQuery(cmd) < 1) 146 if (ExecuteNonQuery(cmd) < 1)
147 { 147 {
148 string insert = "insert into `" + m_Realm + "` (`UUID`, `" + 148 string insert = "insert into `" + m_Realm + "` (`UUID`, `" +
149 String.Join("`, `", fields) + 149 String.Join("`, `", fields) +
150 "`) values (?principalID, ?" + String.Join(", ?", fields) + ")"; 150 "`) values (?principalID, ?" + String.Join(", ?", fields) + ")";
151 151
152 cmd.CommandText = insert; 152 cmd.CommandText = insert;
153 153
154 if (ExecuteNonQuery(cmd) < 1) 154 if (ExecuteNonQuery(cmd) < 1)
155 return false; 155 return false;
156 } 156 }
@@ -166,7 +166,7 @@ namespace OpenSim.Data.MySQL
166 { 166 {
167 cmd.Parameters.AddWithValue("?"+item, value); 167 cmd.Parameters.AddWithValue("?"+item, value);
168 cmd.Parameters.AddWithValue("?UUID", principalID.ToString()); 168 cmd.Parameters.AddWithValue("?UUID", principalID.ToString());
169 169
170 if (ExecuteNonQuery(cmd) > 0) 170 if (ExecuteNonQuery(cmd) > 0)
171 return true; 171 return true;
172 } 172 }
@@ -186,7 +186,7 @@ namespace OpenSim.Data.MySQL
186 cmd.Parameters.AddWithValue("?principalID", principalID.ToString()); 186 cmd.Parameters.AddWithValue("?principalID", principalID.ToString());
187 cmd.Parameters.AddWithValue("?token", token); 187 cmd.Parameters.AddWithValue("?token", token);
188 cmd.Parameters.AddWithValue("?lifetime", lifetime.ToString()); 188 cmd.Parameters.AddWithValue("?lifetime", lifetime.ToString());
189 189
190 if (ExecuteNonQuery(cmd) > 0) 190 if (ExecuteNonQuery(cmd) > 0)
191 return true; 191 return true;
192 } 192 }
diff --git a/OpenSim/Data/MySQL/MySQLAvatarData.cs b/OpenSim/Data/MySQL/MySQLAvatarData.cs
index 6a2f5d8..63e8020 100644
--- a/OpenSim/Data/MySQL/MySQLAvatarData.cs
+++ b/OpenSim/Data/MySQL/MySQLAvatarData.cs
@@ -57,7 +57,7 @@ namespace OpenSim.Data.MySQL
57 cmd.CommandText = String.Format("delete from {0} where `PrincipalID` = ?PrincipalID and `Name` = ?Name", m_Realm); 57 cmd.CommandText = String.Format("delete from {0} where `PrincipalID` = ?PrincipalID and `Name` = ?Name", m_Realm);
58 cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString()); 58 cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString());
59 cmd.Parameters.AddWithValue("?Name", name); 59 cmd.Parameters.AddWithValue("?Name", name);
60 60
61 if (ExecuteNonQuery(cmd) > 0) 61 if (ExecuteNonQuery(cmd) > 0)
62 return true; 62 return true;
63 } 63 }
diff --git a/OpenSim/Data/MySQL/MySQLEstateData.cs b/OpenSim/Data/MySQL/MySQLEstateData.cs
index fe1487b..a5c8d24 100644
--- a/OpenSim/Data/MySQL/MySQLEstateData.cs
+++ b/OpenSim/Data/MySQL/MySQLEstateData.cs
@@ -403,19 +403,19 @@ namespace OpenSim.Data.MySQL
403 return e; 403 return e;
404 } 404 }
405 } 405 }
406 406
407 public List<EstateSettings> LoadEstateSettingsAll() 407 public List<EstateSettings> LoadEstateSettingsAll()
408 { 408 {
409 List<EstateSettings> allEstateSettings = new List<EstateSettings>(); 409 List<EstateSettings> allEstateSettings = new List<EstateSettings>();
410 410
411 List<int> allEstateIds = GetEstatesAll(); 411 List<int> allEstateIds = GetEstatesAll();
412 412
413 foreach (int estateId in allEstateIds) 413 foreach (int estateId in allEstateIds)
414 allEstateSettings.Add(LoadEstateSettings(estateId)); 414 allEstateSettings.Add(LoadEstateSettings(estateId));
415 415
416 return allEstateSettings; 416 return allEstateSettings;
417 } 417 }
418 418
419 public List<int> GetEstatesAll() 419 public List<int> GetEstatesAll()
420 { 420 {
421 List<int> result = new List<int>(); 421 List<int> result = new List<int>();
@@ -441,7 +441,7 @@ namespace OpenSim.Data.MySQL
441 dbcon.Close(); 441 dbcon.Close();
442 } 442 }
443 443
444 return result; 444 return result;
445 } 445 }
446 446
447 public List<int> GetEstates(string search) 447 public List<int> GetEstates(string search)
diff --git a/OpenSim/Data/MySQL/MySQLFSAssetData.cs b/OpenSim/Data/MySQL/MySQLFSAssetData.cs
index 4ed2de6..2837ce3 100644
--- a/OpenSim/Data/MySQL/MySQLFSAssetData.cs
+++ b/OpenSim/Data/MySQL/MySQLFSAssetData.cs
@@ -54,7 +54,7 @@ namespace OpenSim.Data.MySQL
54 { 54 {
55 get { return GetType().Assembly; } 55 get { return GetType().Assembly; }
56 } 56 }
57 57
58 public MySQLFSAssetData() 58 public MySQLFSAssetData()
59 { 59 {
60 } 60 }
diff --git a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
index dc657c8..6aae9c6 100644
--- a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
+++ b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs
@@ -40,7 +40,7 @@ namespace OpenSim.Data.MySQL
40 public class MySQLGenericTableHandler<T> : MySqlFramework where T: class, new() 40 public class MySQLGenericTableHandler<T> : MySqlFramework where T: class, new()
41 { 41 {
42// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 42// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
43 43
44 protected Dictionary<string, FieldInfo> m_Fields = 44 protected Dictionary<string, FieldInfo> m_Fields =
45 new Dictionary<string, FieldInfo>(); 45 new Dictionary<string, FieldInfo>();
46 46
@@ -58,7 +58,7 @@ namespace OpenSim.Data.MySQL
58 { 58 {
59 m_Realm = realm; 59 m_Realm = realm;
60 m_connectionString = connectionString; 60 m_connectionString = connectionString;
61 61
62 if (storeName != String.Empty) 62 if (storeName != String.Empty)
63 { 63 {
64 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) 64 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
@@ -130,7 +130,7 @@ namespace OpenSim.Data.MySQL
130 m_Realm, where); 130 m_Realm, where);
131 131
132 cmd.CommandText = query; 132 cmd.CommandText = query;
133 133
134 return DoQuery(cmd); 134 return DoQuery(cmd);
135 } 135 }
136 } 136 }
@@ -185,7 +185,7 @@ namespace OpenSim.Data.MySQL
185 m_Fields[name].SetValue(row, reader[name]); 185 m_Fields[name].SetValue(row, reader[name]);
186 } 186 }
187 } 187 }
188 188
189 if (m_DataField != null) 189 if (m_DataField != null)
190 { 190 {
191 Dictionary<string, string> data = 191 Dictionary<string, string> data =
@@ -215,9 +215,9 @@ namespace OpenSim.Data.MySQL
215 { 215 {
216 string query = String.Format("select * from {0} where {1}", 216 string query = String.Format("select * from {0} where {1}",
217 m_Realm, where); 217 m_Realm, where);
218 218
219 cmd.CommandText = query; 219 cmd.CommandText = query;
220 220
221 return DoQuery(cmd); 221 return DoQuery(cmd);
222 } 222 }
223 } 223 }
@@ -236,16 +236,16 @@ namespace OpenSim.Data.MySQL
236 { 236 {
237 names.Add(fi.Name); 237 names.Add(fi.Name);
238 values.Add("?" + fi.Name); 238 values.Add("?" + fi.Name);
239 239
240 // Temporarily return more information about what field is unexpectedly null for 240 // Temporarily return more information about what field is unexpectedly null for
241 // http://opensimulator.org/mantis/view.php?id=5403. This might be due to a bug in the 241 // http://opensimulator.org/mantis/view.php?id=5403. This might be due to a bug in the
242 // InventoryTransferModule or we may be required to substitute a DBNull here. 242 // InventoryTransferModule or we may be required to substitute a DBNull here.
243 if (fi.GetValue(row) == null) 243 if (fi.GetValue(row) == null)
244 throw new NullReferenceException( 244 throw new NullReferenceException(
245 string.Format( 245 string.Format(
246 "[MYSQL GENERIC TABLE HANDLER]: Trying to store field {0} for {1} which is unexpectedly null", 246 "[MYSQL GENERIC TABLE HANDLER]: Trying to store field {0} for {1} which is unexpectedly null",
247 fi.Name, row)); 247 fi.Name, row));
248 248
249 cmd.Parameters.AddWithValue(fi.Name, fi.GetValue(row).ToString()); 249 cmd.Parameters.AddWithValue(fi.Name, fi.GetValue(row).ToString());
250 } 250 }
251 251
diff --git a/OpenSim/Data/MySQL/MySQLGroupsData.cs b/OpenSim/Data/MySQL/MySQLGroupsData.cs
index 5734d19..4e73ee7 100644
--- a/OpenSim/Data/MySQL/MySQLGroupsData.cs
+++ b/OpenSim/Data/MySQL/MySQLGroupsData.cs
@@ -133,10 +133,10 @@ namespace OpenSim.Data.MySQL
133 133
134 public bool DeleteMember(UUID groupID, string pricipalID) 134 public bool DeleteMember(UUID groupID, string pricipalID)
135 { 135 {
136 return m_Membership.Delete(new string[] { "GroupID", "PrincipalID" }, 136 return m_Membership.Delete(new string[] { "GroupID", "PrincipalID" },
137 new string[] { groupID.ToString(), pricipalID }); 137 new string[] { groupID.ToString(), pricipalID });
138 } 138 }
139 139
140 public int MemberCount(UUID groupID) 140 public int MemberCount(UUID groupID)
141 { 141 {
142 return (int)m_Membership.GetCount("GroupID", groupID.ToString()); 142 return (int)m_Membership.GetCount("GroupID", groupID.ToString());
@@ -168,7 +168,7 @@ namespace OpenSim.Data.MySQL
168 168
169 public bool DeleteRole(UUID groupID, UUID roleID) 169 public bool DeleteRole(UUID groupID, UUID roleID)
170 { 170 {
171 return m_Roles.Delete(new string[] { "GroupID", "RoleID" }, 171 return m_Roles.Delete(new string[] { "GroupID", "RoleID" },
172 new string[] { groupID.ToString(), roleID.ToString() }); 172 new string[] { groupID.ToString(), roleID.ToString() });
173 } 173 }
174 174
@@ -360,7 +360,7 @@ namespace OpenSim.Data.MySQL
360 get { return GetType().Assembly; } 360 get { return GetType().Assembly; }
361 } 361 }
362 362
363 public MySqlGroupsGroupsHandler(string connectionString, string realm, string store) 363 public MySqlGroupsGroupsHandler(string connectionString, string realm, string store)
364 : base(connectionString, realm, store) 364 : base(connectionString, realm, store)
365 { 365 {
366 } 366 }
@@ -375,7 +375,7 @@ namespace OpenSim.Data.MySQL
375 get { return GetType().Assembly; } 375 get { return GetType().Assembly; }
376 } 376 }
377 377
378 public MySqlGroupsMembershipHandler(string connectionString, string realm) 378 public MySqlGroupsMembershipHandler(string connectionString, string realm)
379 : base(connectionString, realm, string.Empty) 379 : base(connectionString, realm, string.Empty)
380 { 380 {
381 } 381 }
@@ -390,7 +390,7 @@ namespace OpenSim.Data.MySQL
390 get { return GetType().Assembly; } 390 get { return GetType().Assembly; }
391 } 391 }
392 392
393 public MySqlGroupsRolesHandler(string connectionString, string realm) 393 public MySqlGroupsRolesHandler(string connectionString, string realm)
394 : base(connectionString, realm, string.Empty) 394 : base(connectionString, realm, string.Empty)
395 { 395 {
396 } 396 }
@@ -405,7 +405,7 @@ namespace OpenSim.Data.MySQL
405 get { return GetType().Assembly; } 405 get { return GetType().Assembly; }
406 } 406 }
407 407
408 public MySqlGroupsRoleMembershipHandler(string connectionString, string realm) 408 public MySqlGroupsRoleMembershipHandler(string connectionString, string realm)
409 : base(connectionString, realm, string.Empty) 409 : base(connectionString, realm, string.Empty)
410 { 410 {
411 } 411 }
@@ -420,7 +420,7 @@ namespace OpenSim.Data.MySQL
420 get { return GetType().Assembly; } 420 get { return GetType().Assembly; }
421 } 421 }
422 422
423 public MySqlGroupsInvitesHandler(string connectionString, string realm) 423 public MySqlGroupsInvitesHandler(string connectionString, string realm)
424 : base(connectionString, realm, string.Empty) 424 : base(connectionString, realm, string.Empty)
425 { 425 {
426 } 426 }
@@ -447,7 +447,7 @@ namespace OpenSim.Data.MySQL
447 get { return GetType().Assembly; } 447 get { return GetType().Assembly; }
448 } 448 }
449 449
450 public MySqlGroupsNoticesHandler(string connectionString, string realm) 450 public MySqlGroupsNoticesHandler(string connectionString, string realm)
451 : base(connectionString, realm, string.Empty) 451 : base(connectionString, realm, string.Empty)
452 { 452 {
453 } 453 }
@@ -475,7 +475,7 @@ namespace OpenSim.Data.MySQL
475 get { return GetType().Assembly; } 475 get { return GetType().Assembly; }
476 } 476 }
477 477
478 public MySqlGroupsPrincipalsHandler(string connectionString, string realm) 478 public MySqlGroupsPrincipalsHandler(string connectionString, string realm)
479 : base(connectionString, realm, string.Empty) 479 : base(connectionString, realm, string.Empty)
480 { 480 {
481 } 481 }
diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs
index e9b10f3..382d4a5 100644
--- a/OpenSim/Data/MySQL/MySQLInventoryData.cs
+++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs
@@ -288,7 +288,7 @@ namespace OpenSim.Data.MySQL
288 // TODO: this is to handle a case where NULLs creep in there, which we are not sure is endemic to the system, or legacy. It would be nice to live fix these. 288 // TODO: this is to handle a case where NULLs creep in there, which we are not sure is endemic to the system, or legacy. It would be nice to live fix these.
289 // (DBGuid.FromDB() reads db NULLs as well, returns UUID.Zero) 289 // (DBGuid.FromDB() reads db NULLs as well, returns UUID.Zero)
290 item.CreatorId = reader["creatorID"].ToString(); 290 item.CreatorId = reader["creatorID"].ToString();
291 291
292 // Be a bit safer in parsing these because the 292 // Be a bit safer in parsing these because the
293 // database doesn't enforce them to be not null, and 293 // database doesn't enforce them to be not null, and
294 // the inventory still works if these are weird in the 294 // the inventory still works if these are weird in the
@@ -453,7 +453,7 @@ namespace OpenSim.Data.MySQL
453 itemName = item.Name.Substring(0, 64); 453 itemName = item.Name.Substring(0, 64);
454 m_log.Warn("[INVENTORY DB]: Name field truncated from " + item.Name.Length + " to " + itemName.Length + " characters on add item"); 454 m_log.Warn("[INVENTORY DB]: Name field truncated from " + item.Name.Length + " to " + itemName.Length + " characters on add item");
455 } 455 }
456 456
457 string itemDesc = item.Description; 457 string itemDesc = item.Description;
458 if (item.Description.Length > 128) 458 if (item.Description.Length > 128)
459 { 459 {
@@ -490,10 +490,10 @@ namespace OpenSim.Data.MySQL
490 result.Parameters.AddWithValue("?groupID", item.GroupID); 490 result.Parameters.AddWithValue("?groupID", item.GroupID);
491 result.Parameters.AddWithValue("?groupOwned", item.GroupOwned); 491 result.Parameters.AddWithValue("?groupOwned", item.GroupOwned);
492 result.Parameters.AddWithValue("?flags", item.Flags); 492 result.Parameters.AddWithValue("?flags", item.Flags);
493 493
494 lock (m_dbLock) 494 lock (m_dbLock)
495 result.ExecuteNonQuery(); 495 result.ExecuteNonQuery();
496 496
497 result.Dispose(); 497 result.Dispose();
498 } 498 }
499 499
@@ -630,7 +630,7 @@ namespace OpenSim.Data.MySQL
630 { 630 {
631 cmd.Parameters.AddWithValue("?folderID", folder.ID.ToString()); 631 cmd.Parameters.AddWithValue("?folderID", folder.ID.ToString());
632 cmd.Parameters.AddWithValue("?parentFolderID", folder.ParentID.ToString()); 632 cmd.Parameters.AddWithValue("?parentFolderID", folder.ParentID.ToString());
633 633
634 try 634 try
635 { 635 {
636 lock (m_dbLock) 636 lock (m_dbLock)
@@ -860,7 +860,7 @@ namespace OpenSim.Data.MySQL
860 deleteOneFolder(folderID); 860 deleteOneFolder(folderID);
861 deleteItemsInFolder(folderID); 861 deleteItemsInFolder(folderID);
862 } 862 }
863 863
864 public List<InventoryItemBase> fetchActiveGestures(UUID avatarID) 864 public List<InventoryItemBase> fetchActiveGestures(UUID avatarID)
865 { 865 {
866 lock (m_dbLock) 866 lock (m_dbLock)
diff --git a/OpenSim/Data/MySQL/MySQLMigrations.cs b/OpenSim/Data/MySQL/MySQLMigrations.cs
index 81a0e83..2043dae 100644
--- a/OpenSim/Data/MySQL/MySQLMigrations.cs
+++ b/OpenSim/Data/MySQL/MySQLMigrations.cs
@@ -39,16 +39,16 @@ namespace OpenSim.Data.MySQL
39{ 39{
40 /// <summary>This is a MySQL-customized migration processor. The only difference is in how 40 /// <summary>This is a MySQL-customized migration processor. The only difference is in how
41 /// it executes SQL scripts (using MySqlScript instead of MyCommand) 41 /// it executes SQL scripts (using MySqlScript instead of MyCommand)
42 /// 42 ///
43 /// </summary> 43 /// </summary>
44 public class MySqlMigration : Migration 44 public class MySqlMigration : Migration
45 { 45 {
46 public MySqlMigration() 46 public MySqlMigration()
47 : base() 47 : base()
48 { 48 {
49 } 49 }
50 50
51 public MySqlMigration(DbConnection conn, Assembly assem, string subtype, string type) : 51 public MySqlMigration(DbConnection conn, Assembly assem, string subtype, string type) :
52 base(conn, assem, subtype, type) 52 base(conn, assem, subtype, type)
53 { 53 {
54 } 54 }
diff --git a/OpenSim/Data/MySQL/MySQLOfflineIMData.cs b/OpenSim/Data/MySQL/MySQLOfflineIMData.cs
index bafd204..7608858 100644
--- a/OpenSim/Data/MySQL/MySQLOfflineIMData.cs
+++ b/OpenSim/Data/MySQL/MySQLOfflineIMData.cs
@@ -50,7 +50,7 @@ namespace OpenSim.Data.MySQL
50 using (MySqlCommand cmd = new MySqlCommand()) 50 using (MySqlCommand cmd = new MySqlCommand())
51 { 51 {
52 cmd.CommandText = String.Format("delete from {0} where TMStamp < NOW() - INTERVAL 2 WEEK", m_Realm); 52 cmd.CommandText = String.Format("delete from {0} where TMStamp < NOW() - INTERVAL 2 WEEK", m_Realm);
53 53
54 ExecuteNonQuery(cmd); 54 ExecuteNonQuery(cmd);
55 } 55 }
56 56
diff --git a/OpenSim/Data/MySQL/MySQLPresenceData.cs b/OpenSim/Data/MySQL/MySQLPresenceData.cs
index 3f90639..70aca5f 100644
--- a/OpenSim/Data/MySQL/MySQLPresenceData.cs
+++ b/OpenSim/Data/MySQL/MySQLPresenceData.cs
@@ -66,9 +66,9 @@ namespace OpenSim.Data.MySQL
66 using (MySqlCommand cmd = new MySqlCommand()) 66 using (MySqlCommand cmd = new MySqlCommand())
67 { 67 {
68 cmd.CommandText = String.Format("delete from {0} where `RegionID`=?RegionID", m_Realm); 68 cmd.CommandText = String.Format("delete from {0} where `RegionID`=?RegionID", m_Realm);
69 69
70 cmd.Parameters.AddWithValue("?RegionID", regionID.ToString()); 70 cmd.Parameters.AddWithValue("?RegionID", regionID.ToString());
71 71
72 ExecuteNonQuery(cmd); 72 ExecuteNonQuery(cmd);
73 } 73 }
74 } 74 }
@@ -85,10 +85,10 @@ namespace OpenSim.Data.MySQL
85 using (MySqlCommand cmd = new MySqlCommand()) 85 using (MySqlCommand cmd = new MySqlCommand())
86 { 86 {
87 cmd.CommandText = String.Format("update {0} set RegionID=?RegionID, LastSeen=NOW() where `SessionID`=?SessionID", m_Realm); 87 cmd.CommandText = String.Format("update {0} set RegionID=?RegionID, LastSeen=NOW() where `SessionID`=?SessionID", m_Realm);
88 88
89 cmd.Parameters.AddWithValue("?SessionID", sessionID.ToString()); 89 cmd.Parameters.AddWithValue("?SessionID", sessionID.ToString());
90 cmd.Parameters.AddWithValue("?RegionID", regionID.ToString()); 90 cmd.Parameters.AddWithValue("?RegionID", regionID.ToString());
91 91
92 if (ExecuteNonQuery(cmd) == 0) 92 if (ExecuteNonQuery(cmd) == 0)
93 return false; 93 return false;
94 } 94 }
diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs
index 99d4944..0e55285 100644
--- a/OpenSim/Data/MySQL/MySQLRegionData.cs
+++ b/OpenSim/Data/MySQL/MySQLRegionData.cs
@@ -410,7 +410,7 @@ namespace OpenSim.Data.MySQL
410 using (MySqlCommand cmd = new MySqlCommand(command)) 410 using (MySqlCommand cmd = new MySqlCommand(command))
411 { 411 {
412 cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); 412 cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString());
413 413
414 return RunCommand(cmd); 414 return RunCommand(cmd);
415 } 415 }
416 } 416 }
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs
index 2aaa2ff..8278c0e 100644
--- a/OpenSim/Data/MySQL/MySQLSimulationData.cs
+++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs
@@ -55,7 +55,7 @@ namespace OpenSim.Data.MySQL
55 /// <summary> 55 /// <summary>
56 /// This lock was being used to serialize database operations when the connection was shared, but this has 56 /// This lock was being used to serialize database operations when the connection was shared, but this has
57 /// been unnecessary for a long time after we switched to using MySQL's underlying connection pooling instead. 57 /// been unnecessary for a long time after we switched to using MySQL's underlying connection pooling instead.
58 /// FIXME: However, the locks remain in many places since they are effectively providing a level of 58 /// FIXME: However, the locks remain in many places since they are effectively providing a level of
59 /// transactionality. This should be replaced by more efficient database transactions which would not require 59 /// transactionality. This should be replaced by more efficient database transactions which would not require
60 /// unrelated operations to block each other or unrelated operations on the same tables from blocking each 60 /// unrelated operations to block each other or unrelated operations on the same tables from blocking each
61 /// other. 61 /// other.
@@ -268,7 +268,7 @@ namespace OpenSim.Data.MySQL
268 public virtual void RemoveObject(UUID obj, UUID regionUUID) 268 public virtual void RemoveObject(UUID obj, UUID regionUUID)
269 { 269 {
270// m_log.DebugFormat("[REGION DB]: Deleting scene object {0} from {1} in database", obj, regionUUID); 270// m_log.DebugFormat("[REGION DB]: Deleting scene object {0} from {1} in database", obj, regionUUID);
271 271
272 List<UUID> uuids = new List<UUID>(); 272 List<UUID> uuids = new List<UUID>();
273 273
274 // Formerly, this used to check the region UUID. 274 // Formerly, this used to check the region UUID.
@@ -509,7 +509,7 @@ namespace OpenSim.Data.MySQL
509 #region Prim Inventory Loading 509 #region Prim Inventory Loading
510 510
511 // Instead of attempting to LoadItems on every prim, 511 // Instead of attempting to LoadItems on every prim,
512 // most of which probably have no items... get a 512 // most of which probably have no items... get a
513 // list from DB of all prims which have items and 513 // list from DB of all prims which have items and
514 // LoadItems only on those 514 // LoadItems only on those
515 List<SceneObjectPart> primsWithInventory = new List<SceneObjectPart>(); 515 List<SceneObjectPart> primsWithInventory = new List<SceneObjectPart>();
@@ -807,7 +807,7 @@ namespace OpenSim.Data.MySQL
807 "UserLocationX, UserLocationY, UserLocationZ, " + 807 "UserLocationX, UserLocationY, UserLocationZ, " +
808 "UserLookAtX, UserLookAtY, UserLookAtZ, " + 808 "UserLookAtX, UserLookAtY, UserLookAtZ, " +
809 "AuthbuyerID, OtherCleanTime, Dwell, MediaType, MediaDescription, " + 809 "AuthbuyerID, OtherCleanTime, Dwell, MediaType, MediaDescription, " +
810 "MediaSize, MediaLoop, ObscureMusic, ObscureMedia, " + 810 "MediaSize, MediaLoop, ObscureMusic, ObscureMedia, " +
811 "SeeAVs, AnyAVSounds, GroupAVSounds) values (" + 811 "SeeAVs, AnyAVSounds, GroupAVSounds) values (" +
812 "?UUID, ?RegionUUID, " + 812 "?UUID, ?RegionUUID, " +
813 "?LocalLandID, ?Bitmap, ?Name, ?Description, " + 813 "?LocalLandID, ?Bitmap, ?Name, ?Description, " +
@@ -1081,7 +1081,7 @@ namespace OpenSim.Data.MySQL
1081 cmd.Parameters.AddWithValue("cloud_scroll_y", wl.cloudScrollY); 1081 cmd.Parameters.AddWithValue("cloud_scroll_y", wl.cloudScrollY);
1082 cmd.Parameters.AddWithValue("cloud_scroll_y_lock", wl.cloudScrollYLock); 1082 cmd.Parameters.AddWithValue("cloud_scroll_y_lock", wl.cloudScrollYLock);
1083 cmd.Parameters.AddWithValue("draw_classic_clouds", wl.drawClassicClouds); 1083 cmd.Parameters.AddWithValue("draw_classic_clouds", wl.drawClassicClouds);
1084 1084
1085 ExecuteNonQuery(cmd); 1085 ExecuteNonQuery(cmd);
1086 } 1086 }
1087 } 1087 }
@@ -1273,7 +1273,7 @@ namespace OpenSim.Data.MySQL
1273 { 1273 {
1274 SceneObjectPart prim = new SceneObjectPart(); 1274 SceneObjectPart prim = new SceneObjectPart();
1275 1275
1276 // depending on the MySQL connector version, CHAR(36) may be already converted to Guid! 1276 // depending on the MySQL connector version, CHAR(36) may be already converted to Guid!
1277 prim.UUID = DBGuid.FromDB(row["UUID"]); 1277 prim.UUID = DBGuid.FromDB(row["UUID"]);
1278 prim.CreatorIdentification = (string)row["CreatorID"]; 1278 prim.CreatorIdentification = (string)row["CreatorID"];
1279 prim.OwnerID = DBGuid.FromDB(row["OwnerID"]); 1279 prim.OwnerID = DBGuid.FromDB(row["OwnerID"]);
@@ -1401,11 +1401,11 @@ namespace OpenSim.Data.MySQL
1401 1401
1402 prim.CollisionSound = DBGuid.FromDB(row["CollisionSound"]); 1402 prim.CollisionSound = DBGuid.FromDB(row["CollisionSound"]);
1403 prim.CollisionSoundVolume = (float)(double)row["CollisionSoundVolume"]; 1403 prim.CollisionSoundVolume = (float)(double)row["CollisionSoundVolume"];
1404 1404
1405 prim.PassTouches = ((sbyte)row["PassTouches"] != 0); 1405 prim.PassTouches = ((sbyte)row["PassTouches"] != 0);
1406 prim.PassCollisions = ((sbyte)row["PassCollisions"] != 0); 1406 prim.PassCollisions = ((sbyte)row["PassCollisions"] != 0);
1407 prim.LinkNum = (int)row["LinkNumber"]; 1407 prim.LinkNum = (int)row["LinkNumber"];
1408 1408
1409 if (!(row["MediaURL"] is System.DBNull)) 1409 if (!(row["MediaURL"] is System.DBNull))
1410 prim.MediaUrl = (string)row["MediaURL"]; 1410 prim.MediaUrl = (string)row["MediaURL"];
1411 1411
@@ -1421,7 +1421,7 @@ namespace OpenSim.Data.MySQL
1421 if (!(row["DynAttrs"] is System.DBNull)) 1421 if (!(row["DynAttrs"] is System.DBNull))
1422 prim.DynAttrs = DAMap.FromXml((string)row["DynAttrs"]); 1422 prim.DynAttrs = DAMap.FromXml((string)row["DynAttrs"]);
1423 else 1423 else
1424 prim.DynAttrs = new DAMap(); 1424 prim.DynAttrs = new DAMap();
1425 1425
1426 if (!(row["KeyframeMotion"] is DBNull)) 1426 if (!(row["KeyframeMotion"] is DBNull))
1427 { 1427 {
@@ -1543,10 +1543,10 @@ namespace OpenSim.Data.MySQL
1543 newSettings.Covenant = DBGuid.FromDB(row["covenant"]); 1543 newSettings.Covenant = DBGuid.FromDB(row["covenant"]);
1544 newSettings.CovenantChangedDateTime = Convert.ToInt32(row["covenant_datetime"]); 1544 newSettings.CovenantChangedDateTime = Convert.ToInt32(row["covenant_datetime"]);
1545 newSettings.LoadedCreationDateTime = Convert.ToInt32(row["loaded_creation_datetime"]); 1545 newSettings.LoadedCreationDateTime = Convert.ToInt32(row["loaded_creation_datetime"]);
1546 1546
1547 if (row["loaded_creation_id"] is DBNull) 1547 if (row["loaded_creation_id"] is DBNull)
1548 newSettings.LoadedCreationID = ""; 1548 newSettings.LoadedCreationID = "";
1549 else 1549 else
1550 newSettings.LoadedCreationID = (String) row["loaded_creation_id"]; 1550 newSettings.LoadedCreationID = (String) row["loaded_creation_id"];
1551 1551
1552 newSettings.TerrainImageID = DBGuid.FromDB(row["map_tile_ID"]); 1552 newSettings.TerrainImageID = DBGuid.FromDB(row["map_tile_ID"]);
@@ -2023,7 +2023,7 @@ namespace OpenSim.Data.MySQL
2023 2023
2024 s.State = (byte)(int)row["State"]; 2024 s.State = (byte)(int)row["State"];
2025 s.LastAttachPoint = (byte)(int)row["LastAttachPoint"]; 2025 s.LastAttachPoint = (byte)(int)row["LastAttachPoint"];
2026 2026
2027 if (!(row["Media"] is System.DBNull)) 2027 if (!(row["Media"] is System.DBNull))
2028 s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]); 2028 s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]);
2029 2029
@@ -2103,13 +2103,13 @@ namespace OpenSim.Data.MySQL
2103 "?flags, ?itemID, ?primID, ?assetID, " + 2103 "?flags, ?itemID, ?primID, ?assetID, " +
2104 "?parentFolderID, ?creatorID, ?ownerID, " + 2104 "?parentFolderID, ?creatorID, ?ownerID, " +
2105 "?groupID, ?lastOwnerID)"; 2105 "?groupID, ?lastOwnerID)";
2106 2106
2107 foreach (TaskInventoryItem item in items) 2107 foreach (TaskInventoryItem item in items)
2108 { 2108 {
2109 cmd.Parameters.Clear(); 2109 cmd.Parameters.Clear();
2110 2110
2111 FillItemCommand(cmd, item); 2111 FillItemCommand(cmd, item);
2112 2112
2113 ExecuteNonQuery(cmd); 2113 ExecuteNonQuery(cmd);
2114 } 2114 }
2115 } 2115 }
diff --git a/OpenSim/Data/MySQL/MySQLUserProfilesData.cs b/OpenSim/Data/MySQL/MySQLUserProfilesData.cs
index c389ae4..8af2a3e 100644
--- a/OpenSim/Data/MySQL/MySQLUserProfilesData.cs
+++ b/OpenSim/Data/MySQL/MySQLUserProfilesData.cs
@@ -40,39 +40,39 @@ namespace OpenSim.Data.MySQL
40 public class UserProfilesData: IProfilesData 40 public class UserProfilesData: IProfilesData
41 { 41 {
42 static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 42 static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
43 43
44 #region Properites 44 #region Properites
45 string ConnectionString 45 string ConnectionString
46 { 46 {
47 get; set; 47 get; set;
48 } 48 }
49 49
50 protected virtual Assembly Assembly 50 protected virtual Assembly Assembly
51 { 51 {
52 get { return GetType().Assembly; } 52 get { return GetType().Assembly; }
53 } 53 }
54 54
55 #endregion Properties 55 #endregion Properties
56 56
57 #region class Member Functions 57 #region class Member Functions
58 public UserProfilesData(string connectionString) 58 public UserProfilesData(string connectionString)
59 { 59 {
60 ConnectionString = connectionString; 60 ConnectionString = connectionString;
61 Init(); 61 Init();
62 } 62 }
63 63
64 void Init() 64 void Init()
65 { 65 {
66 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) 66 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
67 { 67 {
68 dbcon.Open(); 68 dbcon.Open();
69 69
70 Migration m = new Migration(dbcon, Assembly, "UserProfiles"); 70 Migration m = new Migration(dbcon, Assembly, "UserProfiles");
71 m.Update(); 71 m.Update();
72 } 72 }
73 } 73 }
74 #endregion Member Functions 74 #endregion Member Functions
75 75
76 #region Classifieds Queries 76 #region Classifieds Queries
77 /// <summary> 77 /// <summary>
78 /// Gets the classified records. 78 /// Gets the classified records.
@@ -86,7 +86,7 @@ namespace OpenSim.Data.MySQL
86 public OSDArray GetClassifiedRecords(UUID creatorId) 86 public OSDArray GetClassifiedRecords(UUID creatorId)
87 { 87 {
88 OSDArray data = new OSDArray(); 88 OSDArray data = new OSDArray();
89 89
90 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) 90 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
91 { 91 {
92 string query = "SELECT classifieduuid, name FROM classifieds WHERE creatoruuid = ?Id"; 92 string query = "SELECT classifieduuid, name FROM classifieds WHERE creatoruuid = ?Id";
@@ -102,7 +102,7 @@ namespace OpenSim.Data.MySQL
102 { 102 {
103 OSDMap n = new OSDMap(); 103 OSDMap n = new OSDMap();
104 UUID Id = UUID.Zero; 104 UUID Id = UUID.Zero;
105 105
106 string Name = null; 106 string Name = null;
107 try 107 try
108 { 108 {
@@ -124,12 +124,12 @@ namespace OpenSim.Data.MySQL
124 } 124 }
125 return data; 125 return data;
126 } 126 }
127 127
128 public bool UpdateClassifiedRecord(UserClassifiedAdd ad, ref string result) 128 public bool UpdateClassifiedRecord(UserClassifiedAdd ad, ref string result)
129 { 129 {
130 string query = string.Empty; 130 string query = string.Empty;
131 131
132 132
133 query += "INSERT INTO classifieds ("; 133 query += "INSERT INTO classifieds (";
134 query += "`classifieduuid`,"; 134 query += "`classifieduuid`,";
135 query += "`creatoruuid`,"; 135 query += "`creatoruuid`,";
@@ -173,21 +173,21 @@ namespace OpenSim.Data.MySQL
173 query += "classifiedflags=?Flags, "; 173 query += "classifiedflags=?Flags, ";
174 query += "priceforlisting=?ListingPrice, "; 174 query += "priceforlisting=?ListingPrice, ";
175 query += "snapshotuuid=?SnapshotId"; 175 query += "snapshotuuid=?SnapshotId";
176 176
177 if(string.IsNullOrEmpty(ad.ParcelName)) 177 if(string.IsNullOrEmpty(ad.ParcelName))
178 ad.ParcelName = "Unknown"; 178 ad.ParcelName = "Unknown";
179 if(ad.ParcelId == null) 179 if(ad.ParcelId == null)
180 ad.ParcelId = UUID.Zero; 180 ad.ParcelId = UUID.Zero;
181 if(string.IsNullOrEmpty(ad.Description)) 181 if(string.IsNullOrEmpty(ad.Description))
182 ad.Description = "No Description"; 182 ad.Description = "No Description";
183 183
184 DateTime epoch = new DateTime(1970, 1, 1); 184 DateTime epoch = new DateTime(1970, 1, 1);
185 DateTime now = DateTime.Now; 185 DateTime now = DateTime.Now;
186 TimeSpan epochnow = now - epoch; 186 TimeSpan epochnow = now - epoch;
187 TimeSpan duration; 187 TimeSpan duration;
188 DateTime expiration; 188 DateTime expiration;
189 TimeSpan epochexp; 189 TimeSpan epochexp;
190 190
191 if(ad.Flags == 2) 191 if(ad.Flags == 2)
192 { 192 {
193 duration = new TimeSpan(7,0,0,0); 193 duration = new TimeSpan(7,0,0,0);
@@ -202,7 +202,7 @@ namespace OpenSim.Data.MySQL
202 } 202 }
203 ad.CreationDate = (int)epochnow.TotalSeconds; 203 ad.CreationDate = (int)epochnow.TotalSeconds;
204 ad.ExpirationDate = (int)epochexp.TotalSeconds; 204 ad.ExpirationDate = (int)epochexp.TotalSeconds;
205 205
206 try 206 try
207 { 207 {
208 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) 208 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
@@ -225,7 +225,7 @@ namespace OpenSim.Data.MySQL
225 cmd.Parameters.AddWithValue("?ParcelName", ad.ParcelName.ToString()); 225 cmd.Parameters.AddWithValue("?ParcelName", ad.ParcelName.ToString());
226 cmd.Parameters.AddWithValue("?Flags", ad.Flags.ToString()); 226 cmd.Parameters.AddWithValue("?Flags", ad.Flags.ToString());
227 cmd.Parameters.AddWithValue("?ListingPrice", ad.Price.ToString ()); 227 cmd.Parameters.AddWithValue("?ListingPrice", ad.Price.ToString ());
228 228
229 cmd.ExecuteNonQuery(); 229 cmd.ExecuteNonQuery();
230 } 230 }
231 } 231 }
@@ -239,20 +239,20 @@ namespace OpenSim.Data.MySQL
239 } 239 }
240 return true; 240 return true;
241 } 241 }
242 242
243 public bool DeleteClassifiedRecord(UUID recordId) 243 public bool DeleteClassifiedRecord(UUID recordId)
244 { 244 {
245 string query = string.Empty; 245 string query = string.Empty;
246 246
247 query += "DELETE FROM classifieds WHERE "; 247 query += "DELETE FROM classifieds WHERE ";
248 query += "classifieduuid = ?recordId"; 248 query += "classifieduuid = ?recordId";
249 249
250 try 250 try
251 { 251 {
252 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) 252 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
253 { 253 {
254 dbcon.Open(); 254 dbcon.Open();
255 255
256 using (MySqlCommand cmd = new MySqlCommand(query, dbcon)) 256 using (MySqlCommand cmd = new MySqlCommand(query, dbcon))
257 { 257 {
258 cmd.Parameters.AddWithValue("?recordId", recordId.ToString()); 258 cmd.Parameters.AddWithValue("?recordId", recordId.ToString());
@@ -268,14 +268,14 @@ namespace OpenSim.Data.MySQL
268 } 268 }
269 return true; 269 return true;
270 } 270 }
271 271
272 public bool GetClassifiedInfo(ref UserClassifiedAdd ad, ref string result) 272 public bool GetClassifiedInfo(ref UserClassifiedAdd ad, ref string result)
273 { 273 {
274 string query = string.Empty; 274 string query = string.Empty;
275 275
276 query += "SELECT * FROM classifieds WHERE "; 276 query += "SELECT * FROM classifieds WHERE ";
277 query += "classifieduuid = ?AdId"; 277 query += "classifieduuid = ?AdId";
278 278
279 try 279 try
280 { 280 {
281 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) 281 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
@@ -284,7 +284,7 @@ namespace OpenSim.Data.MySQL
284 using (MySqlCommand cmd = new MySqlCommand(query, dbcon)) 284 using (MySqlCommand cmd = new MySqlCommand(query, dbcon))
285 { 285 {
286 cmd.Parameters.AddWithValue("?AdId", ad.ClassifiedId.ToString()); 286 cmd.Parameters.AddWithValue("?AdId", ad.ClassifiedId.ToString());
287 287
288 using (MySqlDataReader reader = cmd.ExecuteReader()) 288 using (MySqlDataReader reader = cmd.ExecuteReader())
289 { 289 {
290 if(reader.Read ()) 290 if(reader.Read ())
@@ -303,7 +303,7 @@ namespace OpenSim.Data.MySQL
303 ad.SimName = reader.GetString("simname"); 303 ad.SimName = reader.GetString("simname");
304 ad.GlobalPos = reader.GetString("posglobal"); 304 ad.GlobalPos = reader.GetString("posglobal");
305 ad.ParcelName = reader.GetString("parcelname"); 305 ad.ParcelName = reader.GetString("parcelname");
306 306
307 } 307 }
308 } 308 }
309 } 309 }
@@ -318,16 +318,16 @@ namespace OpenSim.Data.MySQL
318 return true; 318 return true;
319 } 319 }
320 #endregion Classifieds Queries 320 #endregion Classifieds Queries
321 321
322 #region Picks Queries 322 #region Picks Queries
323 public OSDArray GetAvatarPicks(UUID avatarId) 323 public OSDArray GetAvatarPicks(UUID avatarId)
324 { 324 {
325 string query = string.Empty; 325 string query = string.Empty;
326 326
327 query += "SELECT `pickuuid`,`name` FROM userpicks WHERE "; 327 query += "SELECT `pickuuid`,`name` FROM userpicks WHERE ";
328 query += "creatoruuid = ?Id"; 328 query += "creatoruuid = ?Id";
329 OSDArray data = new OSDArray(); 329 OSDArray data = new OSDArray();
330 330
331 try 331 try
332 { 332 {
333 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) 333 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
@@ -336,7 +336,7 @@ namespace OpenSim.Data.MySQL
336 using (MySqlCommand cmd = new MySqlCommand(query, dbcon)) 336 using (MySqlCommand cmd = new MySqlCommand(query, dbcon))
337 { 337 {
338 cmd.Parameters.AddWithValue("?Id", avatarId.ToString()); 338 cmd.Parameters.AddWithValue("?Id", avatarId.ToString());
339 339
340 using (MySqlDataReader reader = cmd.ExecuteReader()) 340 using (MySqlDataReader reader = cmd.ExecuteReader())
341 { 341 {
342 if(reader.HasRows) 342 if(reader.HasRows)
@@ -344,7 +344,7 @@ namespace OpenSim.Data.MySQL
344 while (reader.Read()) 344 while (reader.Read())
345 { 345 {
346 OSDMap record = new OSDMap(); 346 OSDMap record = new OSDMap();
347 347
348 record.Add("pickuuid",OSD.FromString((string)reader["pickuuid"])); 348 record.Add("pickuuid",OSD.FromString((string)reader["pickuuid"]));
349 record.Add("name",OSD.FromString((string)reader["name"])); 349 record.Add("name",OSD.FromString((string)reader["name"]));
350 data.Add(record); 350 data.Add(record);
@@ -361,16 +361,16 @@ namespace OpenSim.Data.MySQL
361 } 361 }
362 return data; 362 return data;
363 } 363 }
364 364
365 public UserProfilePick GetPickInfo(UUID avatarId, UUID pickId) 365 public UserProfilePick GetPickInfo(UUID avatarId, UUID pickId)
366 { 366 {
367 string query = string.Empty; 367 string query = string.Empty;
368 UserProfilePick pick = new UserProfilePick(); 368 UserProfilePick pick = new UserProfilePick();
369 369
370 query += "SELECT * FROM userpicks WHERE "; 370 query += "SELECT * FROM userpicks WHERE ";
371 query += "creatoruuid = ?CreatorId AND "; 371 query += "creatoruuid = ?CreatorId AND ";
372 query += "pickuuid = ?PickId"; 372 query += "pickuuid = ?PickId";
373 373
374 try 374 try
375 { 375 {
376 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) 376 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
@@ -380,18 +380,18 @@ namespace OpenSim.Data.MySQL
380 { 380 {
381 cmd.Parameters.AddWithValue("?CreatorId", avatarId.ToString()); 381 cmd.Parameters.AddWithValue("?CreatorId", avatarId.ToString());
382 cmd.Parameters.AddWithValue("?PickId", pickId.ToString()); 382 cmd.Parameters.AddWithValue("?PickId", pickId.ToString());
383 383
384 using (MySqlDataReader reader = cmd.ExecuteReader()) 384 using (MySqlDataReader reader = cmd.ExecuteReader())
385 { 385 {
386 if(reader.HasRows) 386 if(reader.HasRows)
387 { 387 {
388 reader.Read(); 388 reader.Read();
389 389
390 string description = (string)reader["description"]; 390 string description = (string)reader["description"];
391 391
392 if (string.IsNullOrEmpty(description)) 392 if (string.IsNullOrEmpty(description))
393 description = "No description given."; 393 description = "No description given.";
394 394
395 UUID.TryParse((string)reader["pickuuid"], out pick.PickId); 395 UUID.TryParse((string)reader["pickuuid"], out pick.PickId);
396 UUID.TryParse((string)reader["creatoruuid"], out pick.CreatorId); 396 UUID.TryParse((string)reader["creatoruuid"], out pick.CreatorId);
397 UUID.TryParse((string)reader["parceluuid"], out pick.ParcelId); 397 UUID.TryParse((string)reader["parceluuid"], out pick.ParcelId);
@@ -419,11 +419,11 @@ namespace OpenSim.Data.MySQL
419 } 419 }
420 return pick; 420 return pick;
421 } 421 }
422 422
423 public bool UpdatePicksRecord(UserProfilePick pick) 423 public bool UpdatePicksRecord(UserProfilePick pick)
424 { 424 {
425 string query = string.Empty; 425 string query = string.Empty;
426 426
427 query += "INSERT INTO userpicks VALUES ("; 427 query += "INSERT INTO userpicks VALUES (";
428 query += "?PickId,"; 428 query += "?PickId,";
429 query += "?CreatorId,"; 429 query += "?CreatorId,";
@@ -449,7 +449,7 @@ namespace OpenSim.Data.MySQL
449 query += "pickuuid=?PickId,"; 449 query += "pickuuid=?PickId,";
450 query += "posglobal=?GlobalPos,"; 450 query += "posglobal=?GlobalPos,";
451 query += "gatekeeper=?Gatekeeper"; 451 query += "gatekeeper=?Gatekeeper";
452 452
453 try 453 try
454 { 454 {
455 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) 455 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
@@ -471,7 +471,7 @@ namespace OpenSim.Data.MySQL
471 cmd.Parameters.AddWithValue("?Gatekeeper",pick.Gatekeeper); 471 cmd.Parameters.AddWithValue("?Gatekeeper",pick.Gatekeeper);
472 cmd.Parameters.AddWithValue("?SortOrder", pick.SortOrder.ToString ()); 472 cmd.Parameters.AddWithValue("?SortOrder", pick.SortOrder.ToString ());
473 cmd.Parameters.AddWithValue("?Enabled", pick.Enabled.ToString()); 473 cmd.Parameters.AddWithValue("?Enabled", pick.Enabled.ToString());
474 474
475 cmd.ExecuteNonQuery(); 475 cmd.ExecuteNonQuery();
476 } 476 }
477 } 477 }
@@ -484,24 +484,24 @@ namespace OpenSim.Data.MySQL
484 } 484 }
485 return true; 485 return true;
486 } 486 }
487 487
488 public bool DeletePicksRecord(UUID pickId) 488 public bool DeletePicksRecord(UUID pickId)
489 { 489 {
490 string query = string.Empty; 490 string query = string.Empty;
491 491
492 query += "DELETE FROM userpicks WHERE "; 492 query += "DELETE FROM userpicks WHERE ";
493 query += "pickuuid = ?PickId"; 493 query += "pickuuid = ?PickId";
494 494
495 try 495 try
496 { 496 {
497 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) 497 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
498 { 498 {
499 dbcon.Open(); 499 dbcon.Open();
500 500
501 using (MySqlCommand cmd = new MySqlCommand(query, dbcon)) 501 using (MySqlCommand cmd = new MySqlCommand(query, dbcon))
502 { 502 {
503 cmd.Parameters.AddWithValue("?PickId", pickId.ToString()); 503 cmd.Parameters.AddWithValue("?PickId", pickId.ToString());
504 504
505 cmd.ExecuteNonQuery(); 505 cmd.ExecuteNonQuery();
506 } 506 }
507 } 507 }
@@ -515,12 +515,12 @@ namespace OpenSim.Data.MySQL
515 return true; 515 return true;
516 } 516 }
517 #endregion Picks Queries 517 #endregion Picks Queries
518 518
519 #region Avatar Notes Queries 519 #region Avatar Notes Queries
520 public bool GetAvatarNotes(ref UserProfileNotes notes) 520 public bool GetAvatarNotes(ref UserProfileNotes notes)
521 { // WIP 521 { // WIP
522 string query = string.Empty; 522 string query = string.Empty;
523 523
524 query += "SELECT `notes` FROM usernotes WHERE "; 524 query += "SELECT `notes` FROM usernotes WHERE ";
525 query += "useruuid = ?Id AND "; 525 query += "useruuid = ?Id AND ";
526 query += "targetuuid = ?TargetId"; 526 query += "targetuuid = ?TargetId";
@@ -534,7 +534,7 @@ namespace OpenSim.Data.MySQL
534 { 534 {
535 cmd.Parameters.AddWithValue("?Id", notes.UserId.ToString()); 535 cmd.Parameters.AddWithValue("?Id", notes.UserId.ToString());
536 cmd.Parameters.AddWithValue("?TargetId", notes.TargetId.ToString()); 536 cmd.Parameters.AddWithValue("?TargetId", notes.TargetId.ToString());
537 537
538 using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) 538 using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
539 { 539 {
540 if(reader.HasRows) 540 if(reader.HasRows)
@@ -557,12 +557,12 @@ namespace OpenSim.Data.MySQL
557 } 557 }
558 return true; 558 return true;
559 } 559 }
560 560
561 public bool UpdateAvatarNotes(ref UserProfileNotes note, ref string result) 561 public bool UpdateAvatarNotes(ref UserProfileNotes note, ref string result)
562 { 562 {
563 string query = string.Empty; 563 string query = string.Empty;
564 bool remove; 564 bool remove;
565 565
566 if(string.IsNullOrEmpty(note.Notes)) 566 if(string.IsNullOrEmpty(note.Notes))
567 { 567 {
568 remove = true; 568 remove = true;
@@ -581,7 +581,7 @@ namespace OpenSim.Data.MySQL
581 query += "UPDATE "; 581 query += "UPDATE ";
582 query += "notes=?Notes"; 582 query += "notes=?Notes";
583 } 583 }
584 584
585 try 585 try
586 { 586 {
587 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) 587 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
@@ -593,7 +593,7 @@ namespace OpenSim.Data.MySQL
593 cmd.Parameters.AddWithValue("?Notes", note.Notes); 593 cmd.Parameters.AddWithValue("?Notes", note.Notes);
594 cmd.Parameters.AddWithValue("?TargetId", note.TargetId.ToString ()); 594 cmd.Parameters.AddWithValue("?TargetId", note.TargetId.ToString ());
595 cmd.Parameters.AddWithValue("?UserId", note.UserId.ToString()); 595 cmd.Parameters.AddWithValue("?UserId", note.UserId.ToString());
596 596
597 cmd.ExecuteNonQuery(); 597 cmd.ExecuteNonQuery();
598 } 598 }
599 } 599 }
@@ -605,18 +605,18 @@ namespace OpenSim.Data.MySQL
605 return false; 605 return false;
606 } 606 }
607 return true; 607 return true;
608 608
609 } 609 }
610 #endregion Avatar Notes Queries 610 #endregion Avatar Notes Queries
611 611
612 #region Avatar Properties 612 #region Avatar Properties
613 public bool GetAvatarProperties(ref UserProfileProperties props, ref string result) 613 public bool GetAvatarProperties(ref UserProfileProperties props, ref string result)
614 { 614 {
615 string query = string.Empty; 615 string query = string.Empty;
616 616
617 query += "SELECT * FROM userprofile WHERE "; 617 query += "SELECT * FROM userprofile WHERE ";
618 query += "useruuid = ?Id"; 618 query += "useruuid = ?Id";
619 619
620 try 620 try
621 { 621 {
622 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) 622 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
@@ -625,7 +625,7 @@ namespace OpenSim.Data.MySQL
625 using (MySqlCommand cmd = new MySqlCommand(query, dbcon)) 625 using (MySqlCommand cmd = new MySqlCommand(query, dbcon))
626 { 626 {
627 cmd.Parameters.AddWithValue("?Id", props.UserId.ToString()); 627 cmd.Parameters.AddWithValue("?Id", props.UserId.ToString());
628 628
629 using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) 629 using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
630 { 630 {
631 if(reader.HasRows) 631 if(reader.HasRows)
@@ -649,7 +649,7 @@ namespace OpenSim.Data.MySQL
649 { 649 {
650 m_log.DebugFormat("[PROFILES_DATA]" + 650 m_log.DebugFormat("[PROFILES_DATA]" +
651 ": No data for {0}", props.UserId); 651 ": No data for {0}", props.UserId);
652 652
653 props.WebUrl = string.Empty; 653 props.WebUrl = string.Empty;
654 props.ImageId = UUID.Zero; 654 props.ImageId = UUID.Zero;
655 props.AboutText = string.Empty; 655 props.AboutText = string.Empty;
@@ -730,11 +730,11 @@ namespace OpenSim.Data.MySQL
730 } 730 }
731 return true; 731 return true;
732 } 732 }
733 733
734 public bool UpdateAvatarProperties(ref UserProfileProperties props, ref string result) 734 public bool UpdateAvatarProperties(ref UserProfileProperties props, ref string result)
735 { 735 {
736 string query = string.Empty; 736 string query = string.Empty;
737 737
738 query += "UPDATE userprofile SET "; 738 query += "UPDATE userprofile SET ";
739 query += "profileURL=?profileURL, "; 739 query += "profileURL=?profileURL, ";
740 query += "profileImage=?image, "; 740 query += "profileImage=?image, ";
@@ -742,7 +742,7 @@ namespace OpenSim.Data.MySQL
742 query += "profileFirstImage=?firstlifeimage,"; 742 query += "profileFirstImage=?firstlifeimage,";
743 query += "profileFirstText=?firstlifetext "; 743 query += "profileFirstText=?firstlifetext ";
744 query += "WHERE useruuid=?uuid"; 744 query += "WHERE useruuid=?uuid";
745 745
746 try 746 try
747 { 747 {
748 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) 748 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
@@ -756,7 +756,7 @@ namespace OpenSim.Data.MySQL
756 cmd.Parameters.AddWithValue("?firstlifeimage", props.FirstLifeImageId.ToString()); 756 cmd.Parameters.AddWithValue("?firstlifeimage", props.FirstLifeImageId.ToString());
757 cmd.Parameters.AddWithValue("?firstlifetext", props.FirstLifeText); 757 cmd.Parameters.AddWithValue("?firstlifetext", props.FirstLifeText);
758 cmd.Parameters.AddWithValue("?uuid", props.UserId.ToString()); 758 cmd.Parameters.AddWithValue("?uuid", props.UserId.ToString());
759 759
760 cmd.ExecuteNonQuery(); 760 cmd.ExecuteNonQuery();
761 } 761 }
762 } 762 }
@@ -765,18 +765,18 @@ namespace OpenSim.Data.MySQL
765 { 765 {
766 m_log.ErrorFormat("[PROFILES_DATA]" + 766 m_log.ErrorFormat("[PROFILES_DATA]" +
767 ": AgentPropertiesUpdate exception {0}", e.Message); 767 ": AgentPropertiesUpdate exception {0}", e.Message);
768 768
769 return false; 769 return false;
770 } 770 }
771 return true; 771 return true;
772 } 772 }
773 #endregion Avatar Properties 773 #endregion Avatar Properties
774 774
775 #region Avatar Interests 775 #region Avatar Interests
776 public bool UpdateAvatarInterests(UserProfileProperties up, ref string result) 776 public bool UpdateAvatarInterests(UserProfileProperties up, ref string result)
777 { 777 {
778 string query = string.Empty; 778 string query = string.Empty;
779 779
780 query += "UPDATE userprofile SET "; 780 query += "UPDATE userprofile SET ";
781 query += "profileWantToMask=?WantMask, "; 781 query += "profileWantToMask=?WantMask, ";
782 query += "profileWantToText=?WantText,"; 782 query += "profileWantToText=?WantText,";
@@ -784,7 +784,7 @@ namespace OpenSim.Data.MySQL
784 query += "profileSkillsText=?SkillsText, "; 784 query += "profileSkillsText=?SkillsText, ";
785 query += "profileLanguages=?Languages "; 785 query += "profileLanguages=?Languages ";
786 query += "WHERE useruuid=?uuid"; 786 query += "WHERE useruuid=?uuid";
787 787
788 try 788 try
789 { 789 {
790 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) 790 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
@@ -798,7 +798,7 @@ namespace OpenSim.Data.MySQL
798 cmd.Parameters.AddWithValue("?SkillsText", up.SkillsText); 798 cmd.Parameters.AddWithValue("?SkillsText", up.SkillsText);
799 cmd.Parameters.AddWithValue("?Languages", up.Language); 799 cmd.Parameters.AddWithValue("?Languages", up.Language);
800 cmd.Parameters.AddWithValue("?uuid", up.UserId.ToString()); 800 cmd.Parameters.AddWithValue("?uuid", up.UserId.ToString());
801 801
802 cmd.ExecuteNonQuery(); 802 cmd.ExecuteNonQuery();
803 } 803 }
804 } 804 }
@@ -820,8 +820,8 @@ namespace OpenSim.Data.MySQL
820 string query = "SELECT `snapshotuuid` FROM {0} WHERE `creatoruuid` = ?Id"; 820 string query = "SELECT `snapshotuuid` FROM {0} WHERE `creatoruuid` = ?Id";
821 821
822 // Get classified image assets 822 // Get classified image assets
823 823
824 824
825 try 825 try
826 { 826 {
827 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) 827 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
@@ -831,7 +831,7 @@ namespace OpenSim.Data.MySQL
831 using (MySqlCommand cmd = new MySqlCommand(string.Format (query,"`classifieds`"), dbcon)) 831 using (MySqlCommand cmd = new MySqlCommand(string.Format (query,"`classifieds`"), dbcon))
832 { 832 {
833 cmd.Parameters.AddWithValue("?Id", avatarId.ToString()); 833 cmd.Parameters.AddWithValue("?Id", avatarId.ToString());
834 834
835 using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) 835 using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
836 { 836 {
837 if(reader.HasRows) 837 if(reader.HasRows)
@@ -850,7 +850,7 @@ namespace OpenSim.Data.MySQL
850 using (MySqlCommand cmd = new MySqlCommand(string.Format (query,"`userpicks`"), dbcon)) 850 using (MySqlCommand cmd = new MySqlCommand(string.Format (query,"`userpicks`"), dbcon))
851 { 851 {
852 cmd.Parameters.AddWithValue("?Id", avatarId.ToString()); 852 cmd.Parameters.AddWithValue("?Id", avatarId.ToString());
853 853
854 using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) 854 using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
855 { 855 {
856 if(reader.HasRows) 856 if(reader.HasRows)
@@ -862,7 +862,7 @@ namespace OpenSim.Data.MySQL
862 } 862 }
863 } 863 }
864 } 864 }
865 865
866 dbcon.Close(); 866 dbcon.Close();
867 dbcon.Open(); 867 dbcon.Open();
868 868
@@ -871,7 +871,7 @@ namespace OpenSim.Data.MySQL
871 using (MySqlCommand cmd = new MySqlCommand(string.Format (query,"`userpicks`"), dbcon)) 871 using (MySqlCommand cmd = new MySqlCommand(string.Format (query,"`userpicks`"), dbcon))
872 { 872 {
873 cmd.Parameters.AddWithValue("?Id", avatarId.ToString()); 873 cmd.Parameters.AddWithValue("?Id", avatarId.ToString());
874 874
875 using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) 875 using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
876 { 876 {
877 if(reader.HasRows) 877 if(reader.HasRows)
@@ -893,7 +893,7 @@ namespace OpenSim.Data.MySQL
893 } 893 }
894 return data; 894 return data;
895 } 895 }
896 896
897 #region User Preferences 897 #region User Preferences
898 public bool GetUserPreferences(ref UserPreferences pref, ref string result) 898 public bool GetUserPreferences(ref UserPreferences pref, ref string result)
899 { 899 {
@@ -987,16 +987,16 @@ namespace OpenSim.Data.MySQL
987 return true; 987 return true;
988 } 988 }
989 #endregion User Preferences 989 #endregion User Preferences
990 990
991 #region Integration 991 #region Integration
992 public bool GetUserAppData(ref UserAppData props, ref string result) 992 public bool GetUserAppData(ref UserAppData props, ref string result)
993 { 993 {
994 string query = string.Empty; 994 string query = string.Empty;
995 995
996 query += "SELECT * FROM `userdata` WHERE "; 996 query += "SELECT * FROM `userdata` WHERE ";
997 query += "UserId = ?Id AND "; 997 query += "UserId = ?Id AND ";
998 query += "TagId = ?TagId"; 998 query += "TagId = ?TagId";
999 999
1000 try 1000 try
1001 { 1001 {
1002 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) 1002 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
@@ -1006,7 +1006,7 @@ namespace OpenSim.Data.MySQL
1006 { 1006 {
1007 cmd.Parameters.AddWithValue("?Id", props.UserId.ToString()); 1007 cmd.Parameters.AddWithValue("?Id", props.UserId.ToString());
1008 cmd.Parameters.AddWithValue ("?TagId", props.TagId.ToString()); 1008 cmd.Parameters.AddWithValue ("?TagId", props.TagId.ToString());
1009 1009
1010 using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) 1010 using (MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
1011 { 1011 {
1012 if(reader.HasRows) 1012 if(reader.HasRows)
@@ -1022,7 +1022,7 @@ namespace OpenSim.Data.MySQL
1022 query += "?TagId,"; 1022 query += "?TagId,";
1023 query += "?DataKey,"; 1023 query += "?DataKey,";
1024 query += "?DataVal) "; 1024 query += "?DataVal) ";
1025 1025
1026 using (MySqlCommand put = new MySqlCommand(query, dbcon)) 1026 using (MySqlCommand put = new MySqlCommand(query, dbcon))
1027 { 1027 {
1028 put.Parameters.AddWithValue("?UserId", props.UserId.ToString()); 1028 put.Parameters.AddWithValue("?UserId", props.UserId.ToString());
@@ -1048,16 +1048,16 @@ namespace OpenSim.Data.MySQL
1048 } 1048 }
1049 1049
1050 public bool SetUserAppData(UserAppData props, ref string result) 1050 public bool SetUserAppData(UserAppData props, ref string result)
1051 { 1051 {
1052 string query = string.Empty; 1052 string query = string.Empty;
1053 1053
1054 query += "UPDATE userdata SET "; 1054 query += "UPDATE userdata SET ";
1055 query += "TagId = ?TagId, "; 1055 query += "TagId = ?TagId, ";
1056 query += "DataKey = ?DataKey, "; 1056 query += "DataKey = ?DataKey, ";
1057 query += "DataVal = ?DataVal WHERE "; 1057 query += "DataVal = ?DataVal WHERE ";
1058 query += "UserId = ?UserId AND "; 1058 query += "UserId = ?UserId AND ";
1059 query += "TagId = ?TagId"; 1059 query += "TagId = ?TagId";
1060 1060
1061 try 1061 try
1062 { 1062 {
1063 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString)) 1063 using (MySqlConnection dbcon = new MySqlConnection(ConnectionString))
diff --git a/OpenSim/Data/MySQL/MySQLXAssetData.cs b/OpenSim/Data/MySQL/MySQLXAssetData.cs
index ec2bcc6..2c6acde 100644
--- a/OpenSim/Data/MySQL/MySQLXAssetData.cs
+++ b/OpenSim/Data/MySQL/MySQLXAssetData.cs
@@ -209,7 +209,7 @@ namespace OpenSim.Data.MySQL
209 { 209 {
210 assetName = asset.Name.Substring(0, AssetBase.MAX_ASSET_NAME); 210 assetName = asset.Name.Substring(0, AssetBase.MAX_ASSET_NAME);
211 m_log.WarnFormat( 211 m_log.WarnFormat(
212 "[XASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add", 212 "[XASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add",
213 asset.Name, asset.ID, asset.Name.Length, assetName.Length); 213 asset.Name, asset.ID, asset.Name.Length, assetName.Length);
214 } 214 }
215 215
@@ -218,7 +218,7 @@ namespace OpenSim.Data.MySQL
218 { 218 {
219 assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC); 219 assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC);
220 m_log.WarnFormat( 220 m_log.WarnFormat(
221 "[XASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add", 221 "[XASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add",
222 asset.Description, asset.ID, asset.Description.Length, assetDescription.Length); 222 asset.Description, asset.ID, asset.Description.Length, assetDescription.Length);
223 } 223 }
224 224
@@ -341,7 +341,7 @@ namespace OpenSim.Data.MySQL
341 catch (Exception) 341 catch (Exception)
342 { 342 {
343 m_log.ErrorFormat( 343 m_log.ErrorFormat(
344 "[XASSET MYSQL DB]: Failure updating access_time for asset {0} with name {1}", 344 "[XASSET MYSQL DB]: Failure updating access_time for asset {0} with name {1}",
345 assetMetadata.ID, assetMetadata.Name); 345 assetMetadata.ID, assetMetadata.Name);
346 } 346 }
347 } 347 }
diff --git a/OpenSim/Data/MySQL/MySQLXInventoryData.cs b/OpenSim/Data/MySQL/MySQLXInventoryData.cs
index 9a0044e..4e41fec 100644
--- a/OpenSim/Data/MySQL/MySQLXInventoryData.cs
+++ b/OpenSim/Data/MySQL/MySQLXInventoryData.cs
@@ -80,7 +80,7 @@ namespace OpenSim.Data.MySQL
80 80
81 return m_Items.Store(item); 81 return m_Items.Store(item);
82 } 82 }
83 83
84 public bool DeleteFolders(string field, string val) 84 public bool DeleteFolders(string field, string val)
85 { 85 {
86 return m_Folders.Delete(field, val); 86 return m_Folders.Delete(field, val);
@@ -220,12 +220,12 @@ namespace OpenSim.Data.MySQL
220 220
221 cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString()); 221 cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString());
222 cmd.Parameters.AddWithValue("?AssetID", assetID.ToString()); 222 cmd.Parameters.AddWithValue("?AssetID", assetID.ToString());
223 223
224 using (IDataReader reader = cmd.ExecuteReader()) 224 using (IDataReader reader = cmd.ExecuteReader())
225 { 225 {
226 226
227 int perms = 0; 227 int perms = 0;
228 228
229 if (reader.Read()) 229 if (reader.Read())
230 { 230 {
231 perms = Convert.ToInt32(reader["inventoryCurrentPermissions"]); 231 perms = Convert.ToInt32(reader["inventoryCurrentPermissions"]);