aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data')
-rw-r--r--OpenSim/Data/DBGuids.cs2
-rw-r--r--OpenSim/Data/IAvatarData.cs2
-rw-r--r--OpenSim/Data/IEstateDataStore.cs16
-rw-r--r--OpenSim/Data/IGridUserData.cs2
-rw-r--r--OpenSim/Data/IGroupsData.cs2
-rw-r--r--OpenSim/Data/IHGTravelingData.cs2
-rw-r--r--OpenSim/Data/IOfflineIMData.cs2
-rw-r--r--OpenSim/Data/IPresenceData.cs2
-rw-r--r--OpenSim/Data/IRegionData.cs2
-rw-r--r--OpenSim/Data/IXGroupData.cs6
-rw-r--r--OpenSim/Data/Migration.cs26
-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
-rwxr-xr-xOpenSim/Data/Null/NullEstateData.cs6
-rw-r--r--OpenSim/Data/Null/NullFriendsData.cs10
-rw-r--r--OpenSim/Data/Null/NullPresenceData.cs8
-rw-r--r--OpenSim/Data/Null/NullUserAccountData.cs32
-rw-r--r--OpenSim/Data/PGSQL/PGSQLAssetData.cs18
-rw-r--r--OpenSim/Data/PGSQL/PGSQLAuthenticationData.cs6
-rw-r--r--OpenSim/Data/PGSQL/PGSQLAvatarData.cs2
-rw-r--r--OpenSim/Data/PGSQL/PGSQLEstateData.cs2
-rw-r--r--OpenSim/Data/PGSQL/PGSQLFriendsData.cs6
-rw-r--r--OpenSim/Data/PGSQL/PGSQLGenericTableHandler.cs14
-rwxr-xr-xOpenSim/Data/PGSQL/PGSQLGroupsData.cs36
-rw-r--r--OpenSim/Data/PGSQL/PGSQLInventoryData.cs58
-rw-r--r--OpenSim/Data/PGSQL/PGSQLManager.cs2
-rw-r--r--OpenSim/Data/PGSQL/PGSQLMigration.cs4
-rw-r--r--OpenSim/Data/PGSQL/PGSQLOfflineIMData.cs2
-rwxr-xr-xOpenSim/Data/PGSQL/PGSQLPresenceData.cs4
-rw-r--r--OpenSim/Data/PGSQL/PGSQLRegionData.cs14
-rwxr-xr-xOpenSim/Data/PGSQL/PGSQLSimulationData.cs156
-rw-r--r--OpenSim/Data/PGSQL/PGSQLUserAccountData.cs20
-rw-r--r--OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs12
-rw-r--r--OpenSim/Data/PGSQL/PGSQLXAssetData.cs24
-rw-r--r--OpenSim/Data/PGSQL/PGSQLXInventoryData.cs14
-rw-r--r--OpenSim/Data/SQLite/SQLiteAssetData.cs4
-rw-r--r--OpenSim/Data/SQLite/SQLiteAuthenticationData.cs6
-rw-r--r--OpenSim/Data/SQLite/SQLiteEstateData.cs12
-rw-r--r--OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs4
-rw-r--r--OpenSim/Data/SQLite/SQLiteGridUserData.cs2
-rw-r--r--OpenSim/Data/SQLite/SQLiteHGTravelData.cs2
-rw-r--r--OpenSim/Data/SQLite/SQLiteSimulationData.cs16
-rw-r--r--OpenSim/Data/SQLite/SQLiteUserAccountData.cs2
-rw-r--r--OpenSim/Data/SQLite/SQLiteUserProfilesData.cs166
-rw-r--r--OpenSim/Data/SQLite/SQLiteUtils.cs6
-rw-r--r--OpenSim/Data/SQLite/SQLiteXInventoryData.cs4
-rw-r--r--OpenSim/Data/Tests/AssetTests.cs6
-rw-r--r--OpenSim/Data/Tests/BasicDataServiceTest.cs12
-rw-r--r--OpenSim/Data/Tests/DefaultTestConns.cs10
-rw-r--r--OpenSim/Data/Tests/EstateTests.cs18
-rw-r--r--OpenSim/Data/Tests/InventoryTests.cs28
-rw-r--r--OpenSim/Data/Tests/PropertyScrambler.cs2
-rw-r--r--OpenSim/Data/Tests/RegionTests.cs152
67 files changed, 652 insertions, 652 deletions
diff --git a/OpenSim/Data/DBGuids.cs b/OpenSim/Data/DBGuids.cs
index ad1c19c..1a2bf41 100644
--- a/OpenSim/Data/DBGuids.cs
+++ b/OpenSim/Data/DBGuids.cs
@@ -38,7 +38,7 @@ namespace OpenSim.Data
38 /// <summary>This function converts a value returned from the database in one of the 38 /// <summary>This function converts a value returned from the database in one of the
39 /// supported formats into a UUID. This function is not actually DBMS-specific right 39 /// supported formats into a UUID. This function is not actually DBMS-specific right
40 /// now 40 /// now
41 /// 41 ///
42 /// </summary> 42 /// </summary>
43 /// <param name="id"></param> 43 /// <param name="id"></param>
44 /// <returns></returns> 44 /// <returns></returns>
diff --git a/OpenSim/Data/IAvatarData.cs b/OpenSim/Data/IAvatarData.cs
index 0a18e21..b3f12c1 100644
--- a/OpenSim/Data/IAvatarData.cs
+++ b/OpenSim/Data/IAvatarData.cs
@@ -39,7 +39,7 @@ namespace OpenSim.Data
39 public Dictionary<string, string> Data; 39 public Dictionary<string, string> Data;
40 } 40 }
41 41
42 public interface IAvatarData 42 public interface IAvatarData
43 { 43 {
44 AvatarBaseData[] Get(string field, string val); 44 AvatarBaseData[] Get(string field, string val);
45 bool Store(AvatarBaseData data); 45 bool Store(AvatarBaseData data);
diff --git a/OpenSim/Data/IEstateDataStore.cs b/OpenSim/Data/IEstateDataStore.cs
index f9070ea..6b30db2 100644
--- a/OpenSim/Data/IEstateDataStore.cs
+++ b/OpenSim/Data/IEstateDataStore.cs
@@ -46,14 +46,14 @@ namespace OpenSim.Data
46 /// <param name="create">If true, then an estate is created if one is not found.</param> 46 /// <param name="create">If true, then an estate is created if one is not found.</param>
47 /// <returns></returns> 47 /// <returns></returns>
48 EstateSettings LoadEstateSettings(UUID regionID, bool create); 48 EstateSettings LoadEstateSettings(UUID regionID, bool create);
49 49
50 /// <summary> 50 /// <summary>
51 /// Load estate settings for an estate ID. 51 /// Load estate settings for an estate ID.
52 /// </summary> 52 /// </summary>
53 /// <param name="estateID"></param> 53 /// <param name="estateID"></param>
54 /// <returns></returns> 54 /// <returns></returns>
55 EstateSettings LoadEstateSettings(int estateID); 55 EstateSettings LoadEstateSettings(int estateID);
56 56
57 /// <summary> 57 /// <summary>
58 /// Create a new estate. 58 /// Create a new estate.
59 /// </summary> 59 /// </summary>
@@ -67,7 +67,7 @@ namespace OpenSim.Data
67 /// </summary> 67 /// </summary>
68 /// <returns>An empty list if no estates were found.</returns> 68 /// <returns>An empty list if no estates were found.</returns>
69 List<EstateSettings> LoadEstateSettingsAll(); 69 List<EstateSettings> LoadEstateSettingsAll();
70 70
71 /// <summary> 71 /// <summary>
72 /// Store estate settings. 72 /// Store estate settings.
73 /// </summary> 73 /// </summary>
@@ -75,7 +75,7 @@ namespace OpenSim.Data
75 /// This is also called by EstateSettings.Save()</remarks> 75 /// This is also called by EstateSettings.Save()</remarks>
76 /// <param name="es"></param> 76 /// <param name="es"></param>
77 void StoreEstateSettings(EstateSettings es); 77 void StoreEstateSettings(EstateSettings es);
78 78
79 /// <summary> 79 /// <summary>
80 /// Get estate IDs. 80 /// Get estate IDs.
81 /// </summary> 81 /// </summary>
@@ -88,13 +88,13 @@ namespace OpenSim.Data
88 /// </summary> 88 /// </summary>
89 /// <returns>An empty list if no estates were found.</returns> 89 /// <returns>An empty list if no estates were found.</returns>
90 List<int> GetEstatesByOwner(UUID ownerID); 90 List<int> GetEstatesByOwner(UUID ownerID);
91 91
92 /// <summary> 92 /// <summary>
93 /// Get the IDs of all estates. 93 /// Get the IDs of all estates.
94 /// </summary> 94 /// </summary>
95 /// <returns>An empty list if no estates were found.</returns> 95 /// <returns>An empty list if no estates were found.</returns>
96 List<int> GetEstatesAll(); 96 List<int> GetEstatesAll();
97 97
98 /// <summary> 98 /// <summary>
99 /// Link a region to an estate. 99 /// Link a region to an estate.
100 /// </summary> 100 /// </summary>
@@ -102,14 +102,14 @@ namespace OpenSim.Data
102 /// <param name="estateID"></param> 102 /// <param name="estateID"></param>
103 /// <returns>true if the link succeeded, false otherwise</returns> 103 /// <returns>true if the link succeeded, false otherwise</returns>
104 bool LinkRegion(UUID regionID, int estateID); 104 bool LinkRegion(UUID regionID, int estateID);
105 105
106 /// <summary> 106 /// <summary>
107 /// Get the UUIDs of all the regions in an estate. 107 /// Get the UUIDs of all the regions in an estate.
108 /// </summary> 108 /// </summary>
109 /// <param name="estateID"></param> 109 /// <param name="estateID"></param>
110 /// <returns></returns> 110 /// <returns></returns>
111 List<UUID> GetRegions(int estateID); 111 List<UUID> GetRegions(int estateID);
112 112
113 /// <summary> 113 /// <summary>
114 /// Delete an estate 114 /// Delete an estate
115 /// </summary> 115 /// </summary>
diff --git a/OpenSim/Data/IGridUserData.cs b/OpenSim/Data/IGridUserData.cs
index 9afa477..1b2ea87 100644
--- a/OpenSim/Data/IGridUserData.cs
+++ b/OpenSim/Data/IGridUserData.cs
@@ -47,7 +47,7 @@ namespace OpenSim.Data
47 /// <summary> 47 /// <summary>
48 /// An interface for connecting to the user grid datastore 48 /// An interface for connecting to the user grid datastore
49 /// </summary> 49 /// </summary>
50 public interface IGridUserData 50 public interface IGridUserData
51 { 51 {
52 GridUserData Get(string userID); 52 GridUserData Get(string userID);
53 GridUserData[] GetAll(string query); 53 GridUserData[] GetAll(string query);
diff --git a/OpenSim/Data/IGroupsData.cs b/OpenSim/Data/IGroupsData.cs
index c11e649..bd059e0 100644
--- a/OpenSim/Data/IGroupsData.cs
+++ b/OpenSim/Data/IGroupsData.cs
@@ -81,7 +81,7 @@ namespace OpenSim.Data
81 } 81 }
82 82
83 83
84 public interface IGroupsData 84 public interface IGroupsData
85 { 85 {
86 // groups table 86 // groups table
87 bool StoreGroup(GroupData data); 87 bool StoreGroup(GroupData data);
diff --git a/OpenSim/Data/IHGTravelingData.cs b/OpenSim/Data/IHGTravelingData.cs
index 452af7b..5e4894e 100644
--- a/OpenSim/Data/IHGTravelingData.cs
+++ b/OpenSim/Data/IHGTravelingData.cs
@@ -48,7 +48,7 @@ namespace OpenSim.Data
48 /// <summary> 48 /// <summary>
49 /// An interface for connecting to the user grid datastore 49 /// An interface for connecting to the user grid datastore
50 /// </summary> 50 /// </summary>
51 public interface IHGTravelingData 51 public interface IHGTravelingData
52 { 52 {
53 HGTravelingData Get(UUID sessionID); 53 HGTravelingData Get(UUID sessionID);
54 HGTravelingData[] GetSessions(UUID userID); 54 HGTravelingData[] GetSessions(UUID userID);
diff --git a/OpenSim/Data/IOfflineIMData.cs b/OpenSim/Data/IOfflineIMData.cs
index 58501a3..a0f4d69 100644
--- a/OpenSim/Data/IOfflineIMData.cs
+++ b/OpenSim/Data/IOfflineIMData.cs
@@ -39,7 +39,7 @@ namespace OpenSim.Data
39 } 39 }
40 40
41 41
42 public interface IOfflineIMData 42 public interface IOfflineIMData
43 { 43 {
44 OfflineIMData[] Get(string field, string val); 44 OfflineIMData[] Get(string field, string val);
45 long GetCount(string field, string key); 45 long GetCount(string field, string key);
diff --git a/OpenSim/Data/IPresenceData.cs b/OpenSim/Data/IPresenceData.cs
index 9ec48b0..4086245 100644
--- a/OpenSim/Data/IPresenceData.cs
+++ b/OpenSim/Data/IPresenceData.cs
@@ -44,7 +44,7 @@ namespace OpenSim.Data
44 /// <summary> 44 /// <summary>
45 /// An interface for connecting to the presence datastore 45 /// An interface for connecting to the presence datastore
46 /// </summary> 46 /// </summary>
47 public interface IPresenceData 47 public interface IPresenceData
48 { 48 {
49 bool Store(PresenceData data); 49 bool Store(PresenceData data);
50 50
diff --git a/OpenSim/Data/IRegionData.cs b/OpenSim/Data/IRegionData.cs
index ca9b327..c8e38a4 100644
--- a/OpenSim/Data/IRegionData.cs
+++ b/OpenSim/Data/IRegionData.cs
@@ -67,7 +67,7 @@ namespace OpenSim.Data
67 /// <summary> 67 /// <summary>
68 /// An interface for connecting to the authentication datastore 68 /// An interface for connecting to the authentication datastore
69 /// </summary> 69 /// </summary>
70 public interface IRegionData 70 public interface IRegionData
71 { 71 {
72 RegionData Get(UUID regionID, UUID ScopeID); 72 RegionData Get(UUID regionID, UUID ScopeID);
73 List<RegionData> Get(string regionName, UUID ScopeID); 73 List<RegionData> Get(string regionName, UUID ScopeID);
diff --git a/OpenSim/Data/IXGroupData.cs b/OpenSim/Data/IXGroupData.cs
index e5821ef..82073fe 100644
--- a/OpenSim/Data/IXGroupData.cs
+++ b/OpenSim/Data/IXGroupData.cs
@@ -38,12 +38,12 @@ namespace OpenSim.Data
38 public UUID ownerRoleID; 38 public UUID ownerRoleID;
39 public string name; 39 public string name;
40 public string charter; 40 public string charter;
41 public bool showInList; 41 public bool showInList;
42 public UUID insigniaID; 42 public UUID insigniaID;
43 public int membershipFee; 43 public int membershipFee;
44 public bool openEnrollment; 44 public bool openEnrollment;
45 public bool allowPublish; 45 public bool allowPublish;
46 public bool maturePublish; 46 public bool maturePublish;
47 public UUID founderID; 47 public UUID founderID;
48 public ulong everyonePowers; 48 public ulong everyonePowers;
49 public ulong ownersPowers; 49 public ulong ownersPowers;
diff --git a/OpenSim/Data/Migration.cs b/OpenSim/Data/Migration.cs
index d606470..e54bf55 100644
--- a/OpenSim/Data/Migration.cs
+++ b/OpenSim/Data/Migration.cs
@@ -80,10 +80,10 @@ namespace OpenSim.Data
80 80
81 /// <summary>Have the parameterless constructor just so we can specify it as a generic parameter with the new() constraint. 81 /// <summary>Have the parameterless constructor just so we can specify it as a generic parameter with the new() constraint.
82 /// Currently this is only used in the tests. A Migration instance created this way must be then 82 /// Currently this is only used in the tests. A Migration instance created this way must be then
83 /// initialized with Initialize(). Regular creation should be through the parameterized constructors. 83 /// initialized with Initialize(). Regular creation should be through the parameterized constructors.
84 /// </summary> 84 /// </summary>
85 public Migration() 85 public Migration()
86 { 86 {
87 } 87 }
88 88
89 public Migration(DbConnection conn, Assembly assem, string subtype, string type) 89 public Migration(DbConnection conn, Assembly assem, string subtype, string type)
@@ -91,7 +91,7 @@ namespace OpenSim.Data
91 Initialize(conn, assem, type, subtype); 91 Initialize(conn, assem, type, subtype);
92 } 92 }
93 93
94 public Migration(DbConnection conn, Assembly assem, string type) 94 public Migration(DbConnection conn, Assembly assem, string type)
95 { 95 {
96 Initialize(conn, assem, type, ""); 96 Initialize(conn, assem, type, "");
97 } 97 }
@@ -191,7 +191,7 @@ namespace OpenSim.Data
191 int newversion = kvp.Key; 191 int newversion = kvp.Key;
192 // we need to up the command timeout to infinite as we might be doing long migrations. 192 // we need to up the command timeout to infinite as we might be doing long migrations.
193 193
194 /* [AlexRa 01-May-10]: We can't always just run any SQL in a single batch (= ExecuteNonQuery()). Things like 194 /* [AlexRa 01-May-10]: We can't always just run any SQL in a single batch (= ExecuteNonQuery()). Things like
195 * stored proc definitions might have to be sent to the server each in a separate batch. 195 * stored proc definitions might have to be sent to the server each in a separate batch.
196 * This is certainly so for MS SQL; not sure how the MySQL connector sorts out the mess 196 * This is certainly so for MS SQL; not sure how the MySQL connector sorts out the mess
197 * with 'delimiter @@'/'delimiter ;' around procs. So each "script" this code executes now is not 197 * with 'delimiter @@'/'delimiter ;' around procs. So each "script" this code executes now is not
@@ -276,7 +276,7 @@ namespace OpenSim.Data
276 private delegate void FlushProc(); 276 private delegate void FlushProc();
277 277
278 /// <summary>Scans for migration resources in either old-style "scattered" (one file per version) 278 /// <summary>Scans for migration resources in either old-style "scattered" (one file per version)
279 /// or new-style "integrated" format (single file with ":VERSION nnn" sections). 279 /// or new-style "integrated" format (single file with ":VERSION nnn" sections).
280 /// In the new-style migrations it also recognizes ':GO' separators for parts of the SQL script 280 /// In the new-style migrations it also recognizes ':GO' separators for parts of the SQL script
281 /// that must be sent to the server separately. The old-style migrations are loaded each in one piece 281 /// that must be sent to the server separately. The old-style migrations are loaded each in one piece
282 /// and don't support the ':GO' feature. 282 /// and don't support the ':GO' feature.
@@ -301,12 +301,12 @@ namespace OpenSim.Data
301 { 301 {
302 /* The filename should be '<StoreName>.migrations[.NNN]' where NNN 302 /* The filename should be '<StoreName>.migrations[.NNN]' where NNN
303 * is the last version number defined in the file. If the '.NNN' part is recognized, the code can skip 303 * is the last version number defined in the file. If the '.NNN' part is recognized, the code can skip
304 * the file without looking inside if we have a higher version already. Without the suffix we read 304 * the file without looking inside if we have a higher version already. Without the suffix we read
305 * the file anyway and use the version numbers inside. Any unrecognized suffix (such as '.sql') 305 * the file anyway and use the version numbers inside. Any unrecognized suffix (such as '.sql')
306 * is valid but ignored. 306 * is valid but ignored.
307 * 307 *
308 * NOTE that we expect only one 'merged' migration file. If there are several, we take the last one. 308 * NOTE that we expect only one 'merged' migration file. If there are several, we take the last one.
309 * If you are numbering them, leave only the latest one in the project or at least make sure they numbered 309 * If you are numbering them, leave only the latest one in the project or at least make sure they numbered
310 * to come up in the correct order (e.g. 'SomeStore.migrations.001' rather than 'SomeStore.migrations.1') 310 * to come up in the correct order (e.g. 'SomeStore.migrations.001' rather than 'SomeStore.migrations.1')
311 */ 311 */
312 312
@@ -351,7 +351,7 @@ namespace OpenSim.Data
351 if (sLine.Trim().Equals(":GO", StringComparison.InvariantCultureIgnoreCase)) 351 if (sLine.Trim().Equals(":GO", StringComparison.InvariantCultureIgnoreCase))
352 { 352 {
353 if (sb.Length == 0) continue; 353 if (sb.Length == 0) continue;
354 if (nVersion > after) 354 if (nVersion > after)
355 script.Add(sb.ToString()); 355 script.Add(sb.ToString());
356 sb.Length = 0; 356 sb.Length = 0;
357 continue; 357 continue;
@@ -405,10 +405,10 @@ scan_old_style:
405 } 405 }
406 } 406 }
407 } 407 }
408 408
409 if (migrations.Count < 1) 409 if (migrations.Count < 1)
410 m_log.DebugFormat("[MIGRATIONS]: {0} data tables already up to date at revision {1}", _type, after); 410 m_log.DebugFormat("[MIGRATIONS]: {0} data tables already up to date at revision {1}", _type, after);
411 411
412 return migrations; 412 return migrations;
413 } 413 }
414 } 414 }
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"]);
diff --git a/OpenSim/Data/Null/NullEstateData.cs b/OpenSim/Data/Null/NullEstateData.cs
index 57592f1..9f22896 100755
--- a/OpenSim/Data/Null/NullEstateData.cs
+++ b/OpenSim/Data/Null/NullEstateData.cs
@@ -102,19 +102,19 @@ namespace OpenSim.Data.Null
102 { 102 {
103 return new EstateSettings(); 103 return new EstateSettings();
104 } 104 }
105 105
106 public List<EstateSettings> LoadEstateSettingsAll() 106 public List<EstateSettings> LoadEstateSettingsAll()
107 { 107 {
108 List<EstateSettings> allEstateSettings = new List<EstateSettings>(); 108 List<EstateSettings> allEstateSettings = new List<EstateSettings>();
109 allEstateSettings.Add(GetEstate()); 109 allEstateSettings.Add(GetEstate());
110 return allEstateSettings; 110 return allEstateSettings;
111 } 111 }
112 112
113 public List<int> GetEstatesAll() 113 public List<int> GetEstatesAll()
114 { 114 {
115 List<int> result = new List<int>(); 115 List<int> result = new List<int>();
116 result.Add((int)GetEstate().EstateID); 116 result.Add((int)GetEstate().EstateID);
117 return result; 117 return result;
118 } 118 }
119 119
120 public List<int> GetEstates(string search) 120 public List<int> GetEstates(string search)
diff --git a/OpenSim/Data/Null/NullFriendsData.cs b/OpenSim/Data/Null/NullFriendsData.cs
index 473999f..dc9cd38 100644
--- a/OpenSim/Data/Null/NullFriendsData.cs
+++ b/OpenSim/Data/Null/NullFriendsData.cs
@@ -79,7 +79,7 @@ namespace OpenSim.Data.Null
79 { 79 {
80 return fdata.PrincipalID == userID.ToString(); 80 return fdata.PrincipalID == userID.ToString();
81 }); 81 });
82 82
83 if (lst != null) 83 if (lst != null)
84 { 84 {
85 lst.ForEach(f => 85 lst.ForEach(f =>
@@ -87,14 +87,14 @@ namespace OpenSim.Data.Null
87 FriendsData f2 = m_Data.Find(candidateF2 => f.Friend == candidateF2.PrincipalID); 87 FriendsData f2 = m_Data.Find(candidateF2 => f.Friend == candidateF2.PrincipalID);
88 if (f2 != null) 88 if (f2 != null)
89 f.Data["TheirFlags"] = f2.Data["Flags"]; 89 f.Data["TheirFlags"] = f2.Data["Flags"];
90 90
91 // m_log.DebugFormat( 91 // m_log.DebugFormat(
92 // "[NULL FRIENDS DATA]: Got {0} {1} {2} for {3}", 92 // "[NULL FRIENDS DATA]: Got {0} {1} {2} for {3}",
93 // f.Friend, f.Data["Flags"], f2 != null ? f.Data["TheirFlags"] : "not found!", f.PrincipalID); 93 // f.Friend, f.Data["Flags"], f2 != null ? f.Data["TheirFlags"] : "not found!", f.PrincipalID);
94 }); 94 });
95 95
96 // m_log.DebugFormat("[NULL FRIENDS DATA]: Got {0} friends for {1}", lst.Count, userID); 96 // m_log.DebugFormat("[NULL FRIENDS DATA]: Got {0} friends for {1}", lst.Count, userID);
97 97
98 return lst.ToArray(); 98 return lst.ToArray();
99 } 99 }
100 } 100 }
@@ -134,7 +134,7 @@ namespace OpenSim.Data.Null
134 // m_log.DebugFormat( 134 // m_log.DebugFormat(
135 // "[NULL FRIENDS DATA]: Deleting friend {0} {1} for {2}", 135 // "[NULL FRIENDS DATA]: Deleting friend {0} {1} for {2}",
136 // friend.Friend, friend.Data["Flags"], friend.PrincipalID); 136 // friend.Friend, friend.Data["Flags"], friend.PrincipalID);
137 137
138 m_Data.Remove(friend); 138 m_Data.Remove(friend);
139 return true; 139 return true;
140 } 140 }
diff --git a/OpenSim/Data/Null/NullPresenceData.cs b/OpenSim/Data/Null/NullPresenceData.cs
index aff0b0b..8c442c9 100644
--- a/OpenSim/Data/Null/NullPresenceData.cs
+++ b/OpenSim/Data/Null/NullPresenceData.cs
@@ -39,7 +39,7 @@ namespace OpenSim.Data.Null
39 public class NullPresenceData : IPresenceData 39 public class NullPresenceData : IPresenceData
40 { 40 {
41// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 41// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
42 42
43 public static NullPresenceData Instance; 43 public static NullPresenceData Instance;
44 44
45 Dictionary<UUID, PresenceData> m_presenceData = new Dictionary<UUID, PresenceData>(); 45 Dictionary<UUID, PresenceData> m_presenceData = new Dictionary<UUID, PresenceData>();
@@ -100,7 +100,7 @@ namespace OpenSim.Data.Null
100 { 100 {
101 if (Instance != this) 101 if (Instance != this)
102 return Instance.ReportAgent(sessionID, regionID); 102 return Instance.ReportAgent(sessionID, regionID);
103 103
104 if (m_presenceData.ContainsKey(sessionID)) 104 if (m_presenceData.ContainsKey(sessionID))
105 { 105 {
106 m_presenceData[sessionID].RegionID = regionID; 106 m_presenceData[sessionID].RegionID = regionID;
@@ -129,7 +129,7 @@ namespace OpenSim.Data.Null
129// Console.WriteLine("HOME for " + p.UserID + " is " + (p.Data.ContainsKey("HomeRegionID") ? p.Data["HomeRegionID"] : "Not found")); 129// Console.WriteLine("HOME for " + p.UserID + " is " + (p.Data.ContainsKey("HomeRegionID") ? p.Data["HomeRegionID"] : "Not found"));
130 } 130 }
131 } 131 }
132 132
133 return presences.ToArray(); 133 return presences.ToArray();
134 } 134 }
135 else if (field == "SessionID") 135 else if (field == "SessionID")
@@ -172,7 +172,7 @@ namespace OpenSim.Data.Null
172 { 172 {
173// m_log.DebugFormat( 173// m_log.DebugFormat(
174// "[NULL PRESENCE DATA]: Deleting presence data for field {0} with parameter {1}", field, data); 174// "[NULL PRESENCE DATA]: Deleting presence data for field {0} with parameter {1}", field, data);
175 175
176 if (Instance != this) 176 if (Instance != this)
177 return Instance.Delete(field, data); 177 return Instance.Delete(field, data);
178 178
diff --git a/OpenSim/Data/Null/NullUserAccountData.cs b/OpenSim/Data/Null/NullUserAccountData.cs
index 241616b..6d2e05a 100644
--- a/OpenSim/Data/Null/NullUserAccountData.cs
+++ b/OpenSim/Data/Null/NullUserAccountData.cs
@@ -40,7 +40,7 @@ namespace OpenSim.Data.Null
40 public class NullUserAccountData : IUserAccountData 40 public class NullUserAccountData : IUserAccountData
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 private Dictionary<UUID, UserAccountData> m_DataByUUID = new Dictionary<UUID, UserAccountData>(); 44 private Dictionary<UUID, UserAccountData> m_DataByUUID = new Dictionary<UUID, UserAccountData>();
45 private Dictionary<string, UserAccountData> m_DataByName = new Dictionary<string, UserAccountData>(); 45 private Dictionary<string, UserAccountData> m_DataByName = new Dictionary<string, UserAccountData>();
46 private Dictionary<string, UserAccountData> m_DataByEmail = new Dictionary<string, UserAccountData>(); 46 private Dictionary<string, UserAccountData> m_DataByEmail = new Dictionary<string, UserAccountData>();
@@ -48,7 +48,7 @@ namespace OpenSim.Data.Null
48 public NullUserAccountData(string connectionString, string realm) 48 public NullUserAccountData(string connectionString, string realm)
49 { 49 {
50// m_log.DebugFormat( 50// m_log.DebugFormat(
51// "[NULL USER ACCOUNT DATA]: Initializing new NullUserAccountData with connectionString [{0}], realm [{1}]", 51// "[NULL USER ACCOUNT DATA]: Initializing new NullUserAccountData with connectionString [{0}], realm [{1}]",
52// connectionString, realm); 52// connectionString, realm);
53 } 53 }
54 54
@@ -65,12 +65,12 @@ namespace OpenSim.Data.Null
65// if (m_log.IsDebugEnabled) 65// if (m_log.IsDebugEnabled)
66// { 66// {
67// m_log.DebugFormat( 67// m_log.DebugFormat(
68// "[NULL USER ACCOUNT DATA]: Called Get with fields [{0}], values [{1}]", 68// "[NULL USER ACCOUNT DATA]: Called Get with fields [{0}], values [{1}]",
69// string.Join(", ", fields), string.Join(", ", values)); 69// string.Join(", ", fields), string.Join(", ", values));
70// } 70// }
71 71
72 UserAccountData[] userAccounts = new UserAccountData[0]; 72 UserAccountData[] userAccounts = new UserAccountData[0];
73 73
74 List<string> fieldsLst = new List<string>(fields); 74 List<string> fieldsLst = new List<string>(fields);
75 if (fieldsLst.Contains("PrincipalID")) 75 if (fieldsLst.Contains("PrincipalID"))
76 { 76 {
@@ -79,33 +79,33 @@ namespace OpenSim.Data.Null
79 if (UUID.TryParse(values[i], out id)) 79 if (UUID.TryParse(values[i], out id))
80 if (m_DataByUUID.ContainsKey(id)) 80 if (m_DataByUUID.ContainsKey(id))
81 userAccounts = new UserAccountData[] { m_DataByUUID[id] }; 81 userAccounts = new UserAccountData[] { m_DataByUUID[id] };
82 } 82 }
83 else if (fieldsLst.Contains("FirstName") && fieldsLst.Contains("LastName")) 83 else if (fieldsLst.Contains("FirstName") && fieldsLst.Contains("LastName"))
84 { 84 {
85 int findex = fieldsLst.IndexOf("FirstName"); 85 int findex = fieldsLst.IndexOf("FirstName");
86 int lindex = fieldsLst.IndexOf("LastName"); 86 int lindex = fieldsLst.IndexOf("LastName");
87 if (m_DataByName.ContainsKey(values[findex] + " " + values[lindex])) 87 if (m_DataByName.ContainsKey(values[findex] + " " + values[lindex]))
88 { 88 {
89 userAccounts = new UserAccountData[] { m_DataByName[values[findex] + " " + values[lindex]] }; 89 userAccounts = new UserAccountData[] { m_DataByName[values[findex] + " " + values[lindex]] };
90 } 90 }
91 } 91 }
92 else if (fieldsLst.Contains("Email")) 92 else if (fieldsLst.Contains("Email"))
93 { 93 {
94 int i = fieldsLst.IndexOf("Email"); 94 int i = fieldsLst.IndexOf("Email");
95 if (m_DataByEmail.ContainsKey(values[i])) 95 if (m_DataByEmail.ContainsKey(values[i]))
96 userAccounts = new UserAccountData[] { m_DataByEmail[values[i]] }; 96 userAccounts = new UserAccountData[] { m_DataByEmail[values[i]] };
97 } 97 }
98 98
99// if (m_log.IsDebugEnabled) 99// if (m_log.IsDebugEnabled)
100// { 100// {
101// StringBuilder sb = new StringBuilder(); 101// StringBuilder sb = new StringBuilder();
102// foreach (UserAccountData uad in userAccounts) 102// foreach (UserAccountData uad in userAccounts)
103// sb.AppendFormat("({0} {1} {2}) ", uad.FirstName, uad.LastName, uad.PrincipalID); 103// sb.AppendFormat("({0} {1} {2}) ", uad.FirstName, uad.LastName, uad.PrincipalID);
104// 104//
105// m_log.DebugFormat( 105// m_log.DebugFormat(
106// "[NULL USER ACCOUNT DATA]: Returning {0} user accounts out of {1}: [{2}]", userAccounts.Length, m_DataByName.Count, sb); 106// "[NULL USER ACCOUNT DATA]: Returning {0} user accounts out of {1}: [{2}]", userAccounts.Length, m_DataByName.Count, sb);
107// } 107// }
108 108
109 return userAccounts; 109 return userAccounts;
110 } 110 }
111 111
@@ -113,16 +113,16 @@ namespace OpenSim.Data.Null
113 { 113 {
114 if (data == null) 114 if (data == null)
115 return false; 115 return false;
116 116
117 m_log.DebugFormat( 117 m_log.DebugFormat(
118 "[NULL USER ACCOUNT DATA]: Storing user account {0} {1} {2} {3}", 118 "[NULL USER ACCOUNT DATA]: Storing user account {0} {1} {2} {3}",
119 data.FirstName, data.LastName, data.PrincipalID, this.GetHashCode()); 119 data.FirstName, data.LastName, data.PrincipalID, this.GetHashCode());
120 120
121 m_DataByUUID[data.PrincipalID] = data; 121 m_DataByUUID[data.PrincipalID] = data;
122 m_DataByName[data.FirstName + " " + data.LastName] = data; 122 m_DataByName[data.FirstName + " " + data.LastName] = data;
123 if (data.Data.ContainsKey("Email") && data.Data["Email"] != null && data.Data["Email"] != string.Empty) 123 if (data.Data.ContainsKey("Email") && data.Data["Email"] != null && data.Data["Email"] != string.Empty)
124 m_DataByEmail[data.Data["Email"]] = data; 124 m_DataByEmail[data.Data["Email"]] = data;
125 125
126// m_log.DebugFormat("m_DataByUUID count is {0}, m_DataByName count is {1}", m_DataByUUID.Count, m_DataByName.Count); 126// m_log.DebugFormat("m_DataByUUID count is {0}, m_DataByName count is {1}", m_DataByUUID.Count, m_DataByName.Count);
127 127
128 return true; 128 return true;
@@ -132,7 +132,7 @@ namespace OpenSim.Data.Null
132 { 132 {
133// m_log.DebugFormat( 133// m_log.DebugFormat(
134// "[NULL USER ACCOUNT DATA]: Called GetUsers with scope [{0}], query [{1}]", scopeID, query); 134// "[NULL USER ACCOUNT DATA]: Called GetUsers with scope [{0}], query [{1}]", scopeID, query);
135 135
136 string[] words = query.Split(new char[] { ' ' }); 136 string[] words = query.Split(new char[] { ' ' });
137 137
138 for (int i = 0; i < words.Length; i++) 138 for (int i = 0; i < words.Length; i++)
diff --git a/OpenSim/Data/PGSQL/PGSQLAssetData.cs b/OpenSim/Data/PGSQL/PGSQLAssetData.cs
index 81adb03..7b79521 100644
--- a/OpenSim/Data/PGSQL/PGSQLAssetData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLAssetData.cs
@@ -151,35 +151,35 @@ namespace OpenSim.Data.PGSQL
151 /// <param name="asset">the asset</param> 151 /// <param name="asset">the asset</param>
152 override public bool StoreAsset(AssetBase asset) 152 override public bool StoreAsset(AssetBase asset)
153 { 153 {
154 154
155 string sql = 155 string sql =
156 @"UPDATE assets set name = :name, description = :description, " + "\"assetType\" " + @" = :assetType, 156 @"UPDATE assets set name = :name, description = :description, " + "\"assetType\" " + @" = :assetType,
157 local = :local, temporary = :temporary, creatorid = :creatorid, data = :data 157 local = :local, temporary = :temporary, creatorid = :creatorid, data = :data
158 WHERE id=:id; 158 WHERE id=:id;
159 159
160 INSERT INTO assets 160 INSERT INTO assets
161 (id, name, description, " + "\"assetType\" " + @", local, 161 (id, name, description, " + "\"assetType\" " + @", local,
162 temporary, create_time, access_time, creatorid, asset_flags, data) 162 temporary, create_time, access_time, creatorid, asset_flags, data)
163 Select :id, :name, :description, :assetType, :local, 163 Select :id, :name, :description, :assetType, :local,
164 :temporary, :create_time, :access_time, :creatorid, :asset_flags, :data 164 :temporary, :create_time, :access_time, :creatorid, :asset_flags, :data
165 Where not EXISTS(SELECT * FROM assets WHERE id=:id) 165 Where not EXISTS(SELECT * FROM assets WHERE id=:id)
166 "; 166 ";
167 167
168 string assetName = asset.Name; 168 string assetName = asset.Name;
169 if (asset.Name.Length > AssetBase.MAX_ASSET_NAME) 169 if (asset.Name.Length > AssetBase.MAX_ASSET_NAME)
170 { 170 {
171 assetName = asset.Name.Substring(0, AssetBase.MAX_ASSET_NAME); 171 assetName = asset.Name.Substring(0, AssetBase.MAX_ASSET_NAME);
172 m_log.WarnFormat( 172 m_log.WarnFormat(
173 "[ASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add", 173 "[ASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add",
174 asset.Name, asset.ID, asset.Name.Length, assetName.Length); 174 asset.Name, asset.ID, asset.Name.Length, assetName.Length);
175 } 175 }
176 176
177 string assetDescription = asset.Description; 177 string assetDescription = asset.Description;
178 if (asset.Description.Length > AssetBase.MAX_ASSET_DESC) 178 if (asset.Description.Length > AssetBase.MAX_ASSET_DESC)
179 { 179 {
180 assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC); 180 assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC);
181 m_log.WarnFormat( 181 m_log.WarnFormat(
182 "[ASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add", 182 "[ASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add",
183 asset.Description, asset.ID, asset.Description.Length, assetDescription.Length); 183 asset.Description, asset.ID, asset.Description.Length, assetDescription.Length);
184 } 184 }
185 185
@@ -278,7 +278,7 @@ namespace OpenSim.Data.PGSQL
278 { 278 {
279 List<AssetMetadata> retList = new List<AssetMetadata>(count); 279 List<AssetMetadata> retList = new List<AssetMetadata>(count);
280 string sql = @" SELECT id, name, description, " + "\"assetType\"" + @", temporary, creatorid 280 string sql = @" SELECT id, name, description, " + "\"assetType\"" + @", temporary, creatorid
281 FROM assets 281 FROM assets
282 order by id 282 order by id
283 limit :stop 283 limit :stop
284 offset :start;"; 284 offset :start;";
diff --git a/OpenSim/Data/PGSQL/PGSQLAuthenticationData.cs b/OpenSim/Data/PGSQL/PGSQLAuthenticationData.cs
index d174112..8f83309 100644
--- a/OpenSim/Data/PGSQL/PGSQLAuthenticationData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLAuthenticationData.cs
@@ -145,7 +145,7 @@ namespace OpenSim.Data.PGSQL
145 updateBuilder.AppendFormat("\"{0}\" = :{0}",field); 145 updateBuilder.AppendFormat("\"{0}\" = :{0}",field);
146 146
147 first = false; 147 first = false;
148 148
149 cmd.Parameters.Add(m_database.CreateParameter("" + field, data.Data[field])); 149 cmd.Parameters.Add(m_database.CreateParameter("" + field, data.Data[field]));
150 } 150 }
151 151
@@ -154,7 +154,7 @@ namespace OpenSim.Data.PGSQL
154 cmd.CommandText = updateBuilder.ToString(); 154 cmd.CommandText = updateBuilder.ToString();
155 cmd.Connection = conn; 155 cmd.Connection = conn;
156 cmd.Parameters.Add(m_database.CreateParameter("principalID", data.PrincipalID)); 156 cmd.Parameters.Add(m_database.CreateParameter("principalID", data.PrincipalID));
157 157
158 conn.Open(); 158 conn.Open();
159 if (cmd.ExecuteNonQuery() < 1) 159 if (cmd.ExecuteNonQuery() < 1)
160 { 160 {
@@ -195,7 +195,7 @@ namespace OpenSim.Data.PGSQL
195 { 195 {
196 if (System.Environment.TickCount - m_LastExpire > 30000) 196 if (System.Environment.TickCount - m_LastExpire > 30000)
197 DoExpire(); 197 DoExpire();
198 198
199 string sql = "insert into tokens (uuid, token, validity) values (:principalID, :token, :lifetime)"; 199 string sql = "insert into tokens (uuid, token, validity) values (:principalID, :token, :lifetime)";
200 using (NpgsqlConnection conn = new NpgsqlConnection(m_ConnectionString)) 200 using (NpgsqlConnection conn = new NpgsqlConnection(m_ConnectionString))
201 using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn)) 201 using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
diff --git a/OpenSim/Data/PGSQL/PGSQLAvatarData.cs b/OpenSim/Data/PGSQL/PGSQLAvatarData.cs
index d9c4905..3d56d4d 100644
--- a/OpenSim/Data/PGSQL/PGSQLAvatarData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLAvatarData.cs
@@ -45,7 +45,7 @@ namespace OpenSim.Data.PGSQL
45 IAvatarData 45 IAvatarData
46 { 46 {
47// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 47// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 48
49 public PGSQLAvatarData(string connectionString, string realm) : 49 public PGSQLAvatarData(string connectionString, string realm) :
50 base(connectionString, realm, "Avatar") 50 base(connectionString, realm, "Avatar")
51 { 51 {
diff --git a/OpenSim/Data/PGSQL/PGSQLEstateData.cs b/OpenSim/Data/PGSQL/PGSQLEstateData.cs
index b5ca235..9489d6c 100644
--- a/OpenSim/Data/PGSQL/PGSQLEstateData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLEstateData.cs
@@ -594,7 +594,7 @@ namespace OpenSim.Data.PGSQL
594 594
595 public bool DeleteEstate(int estateID) 595 public bool DeleteEstate(int estateID)
596 { 596 {
597 // TODO: Implementation! 597 // TODO: Implementation!
598 return false; 598 return false;
599 } 599 }
600 #endregion 600 #endregion
diff --git a/OpenSim/Data/PGSQL/PGSQLFriendsData.cs b/OpenSim/Data/PGSQL/PGSQLFriendsData.cs
index a841353..58dffed 100644
--- a/OpenSim/Data/PGSQL/PGSQLFriendsData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLFriendsData.cs
@@ -50,7 +50,7 @@ namespace OpenSim.Data.PGSQL
50 } 50 }
51 } 51 }
52 52
53 53
54 public override bool Delete(string principalID, string friend) 54 public override bool Delete(string principalID, string friend)
55 { 55 {
56 UUID princUUID = UUID.Zero; 56 UUID princUUID = UUID.Zero;
@@ -97,7 +97,7 @@ namespace OpenSim.Data.PGSQL
97 using (NpgsqlCommand cmd = new NpgsqlCommand()) 97 using (NpgsqlCommand cmd = new NpgsqlCommand())
98 { 98 {
99 99
100 cmd.CommandText = String.Format("select a.*,case when b.\"Flags\" is null then '-1' else b.\"Flags\" end as \"TheirFlags\" from {0} as a " + 100 cmd.CommandText = String.Format("select a.*,case when b.\"Flags\" is null then '-1' else b.\"Flags\" end as \"TheirFlags\" from {0} as a " +
101 " left join {0} as b on a.\"PrincipalID\" = b.\"Friend\" and a.\"Friend\" = b.\"PrincipalID\" " + 101 " left join {0} as b on a.\"PrincipalID\" = b.\"Friend\" and a.\"Friend\" = b.\"PrincipalID\" " +
102 " where a.\"PrincipalID\" = :PrincipalID", m_Realm); 102 " where a.\"PrincipalID\" = :PrincipalID", m_Realm);
103 cmd.Parameters.Add(m_database.CreateParameter("PrincipalID", principalID.ToString())); 103 cmd.Parameters.Add(m_database.CreateParameter("PrincipalID", principalID.ToString()));
@@ -111,6 +111,6 @@ namespace OpenSim.Data.PGSQL
111 { 111 {
112 return GetFriends(principalID); 112 return GetFriends(principalID);
113 } 113 }
114 114
115 } 115 }
116} 116}
diff --git a/OpenSim/Data/PGSQL/PGSQLGenericTableHandler.cs b/OpenSim/Data/PGSQL/PGSQLGenericTableHandler.cs
index 061de22..5b24720 100644
--- a/OpenSim/Data/PGSQL/PGSQLGenericTableHandler.cs
+++ b/OpenSim/Data/PGSQL/PGSQLGenericTableHandler.cs
@@ -64,7 +64,7 @@ namespace OpenSim.Data.PGSQL
64 : base(connectionString) 64 : base(connectionString)
65 { 65 {
66 m_Realm = realm; 66 m_Realm = realm;
67 67
68 m_ConnectionString = connectionString; 68 m_ConnectionString = connectionString;
69 69
70 if (storeName != String.Empty) 70 if (storeName != String.Empty)
@@ -104,7 +104,7 @@ namespace OpenSim.Data.PGSQL
104 m_FieldTypes = new Dictionary<string, string>(); 104 m_FieldTypes = new Dictionary<string, string>();
105 105
106 string query = string.Format(@"select column_name,data_type 106 string query = string.Format(@"select column_name,data_type
107 from INFORMATION_SCHEMA.COLUMNS 107 from INFORMATION_SCHEMA.COLUMNS
108 where table_name = lower('{0}'); 108 where table_name = lower('{0}');
109 109
110 ", m_Realm); 110 ", m_Realm);
@@ -232,7 +232,7 @@ namespace OpenSim.Data.PGSQL
232 if (reader == null) 232 if (reader == null)
233 return new T[0]; 233 return new T[0];
234 234
235 CheckColumnNames(reader); 235 CheckColumnNames(reader);
236 236
237 while (reader.Read()) 237 while (reader.Read())
238 { 238 {
@@ -339,7 +339,7 @@ namespace OpenSim.Data.PGSQL
339 names.Add(fi.Name); 339 names.Add(fi.Name);
340 values.Add(":" + fi.Name); 340 values.Add(":" + fi.Name);
341 // Temporarily return more information about what field is unexpectedly null for 341 // Temporarily return more information about what field is unexpectedly null for
342 // http://opensimulator.org/mantis/view.php?id=5403. This might be due to a bug in the 342 // http://opensimulator.org/mantis/view.php?id=5403. This might be due to a bug in the
343 // InventoryTransferModule or we may be required to substitute a DBNull here. 343 // InventoryTransferModule or we may be required to substitute a DBNull here.
344 if (fi.GetValue(row) == null) 344 if (fi.GetValue(row) == null)
345 throw new NullReferenceException( 345 throw new NullReferenceException(
@@ -395,11 +395,11 @@ namespace OpenSim.Data.PGSQL
395 } 395 }
396 string where = String.Join(" AND ", terms.ToArray()); 396 string where = String.Join(" AND ", terms.ToArray());
397 query.AppendFormat(" WHERE {0} ", where); 397 query.AppendFormat(" WHERE {0} ", where);
398 398
399 } 399 }
400 cmd.Connection = conn; 400 cmd.Connection = conn;
401 cmd.CommandText = query.ToString(); 401 cmd.CommandText = query.ToString();
402 402
403 conn.Open(); 403 conn.Open();
404 if (cmd.ExecuteNonQuery() > 0) 404 if (cmd.ExecuteNonQuery() > 0)
405 { 405 {
@@ -416,7 +416,7 @@ namespace OpenSim.Data.PGSQL
416 query.Append("\") values (" + String.Join(",", values.ToArray()) + ")"); 416 query.Append("\") values (" + String.Join(",", values.ToArray()) + ")");
417 cmd.Connection = conn; 417 cmd.Connection = conn;
418 cmd.CommandText = query.ToString(); 418 cmd.CommandText = query.ToString();
419 419
420 // m_log.WarnFormat("[PGSQLGenericTable]: Inserting into {0} sql {1}", m_Realm, cmd.CommandText); 420 // m_log.WarnFormat("[PGSQLGenericTable]: Inserting into {0} sql {1}", m_Realm, cmd.CommandText);
421 421
422 if (conn.State != ConnectionState.Open) 422 if (conn.State != ConnectionState.Open)
diff --git a/OpenSim/Data/PGSQL/PGSQLGroupsData.cs b/OpenSim/Data/PGSQL/PGSQLGroupsData.cs
index e257e7c..6ef576b 100755
--- a/OpenSim/Data/PGSQL/PGSQLGroupsData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLGroupsData.cs
@@ -37,7 +37,7 @@ using Npgsql;
37namespace OpenSim.Data.PGSQL 37namespace OpenSim.Data.PGSQL
38{ 38{
39 public class PGSQLGroupsData : IGroupsData 39 public class PGSQLGroupsData : IGroupsData
40 { 40 {
41 private PGSqlGroupsGroupsHandler m_Groups; 41 private PGSqlGroupsGroupsHandler m_Groups;
42 private PGSqlGroupsMembershipHandler m_Membership; 42 private PGSqlGroupsMembershipHandler m_Membership;
43 private PGSqlGroupsRolesHandler m_Roles; 43 private PGSqlGroupsRolesHandler m_Roles;
@@ -83,17 +83,17 @@ namespace OpenSim.Data.PGSQL
83 83
84 public GroupData[] RetrieveGroups(string pattern) 84 public GroupData[] RetrieveGroups(string pattern)
85 { 85 {
86 86
87 if (string.IsNullOrEmpty(pattern)) // True for where clause 87 if (string.IsNullOrEmpty(pattern)) // True for where clause
88 { 88 {
89 pattern = " 1 ORDER BY lower(\"Name\") LIMIT 100"; 89 pattern = " 1 ORDER BY lower(\"Name\") LIMIT 100";
90 90
91 return m_Groups.Get(pattern); 91 return m_Groups.Get(pattern);
92 } 92 }
93 else 93 else
94 { 94 {
95 pattern = " \"ShowInList\" = 1 AND lower(\"Name\") LIKE lower('%" + pattern + "%') ORDER BY lower(\"Name\") LIMIT 100"; 95 pattern = " \"ShowInList\" = 1 AND lower(\"Name\") LIKE lower('%" + pattern + "%') ORDER BY lower(\"Name\") LIMIT 100";
96 96
97 return m_Groups.Get(pattern, new NpgsqlParameter("pattern", pattern)); 97 return m_Groups.Get(pattern, new NpgsqlParameter("pattern", pattern));
98 } 98 }
99 } 99 }
@@ -138,10 +138,10 @@ namespace OpenSim.Data.PGSQL
138 138
139 public bool DeleteMember(UUID groupID, string pricipalID) 139 public bool DeleteMember(UUID groupID, string pricipalID)
140 { 140 {
141 return m_Membership.Delete(new string[] { "GroupID", "PrincipalID" }, 141 return m_Membership.Delete(new string[] { "GroupID", "PrincipalID" },
142 new string[] { groupID.ToString(), pricipalID }); 142 new string[] { groupID.ToString(), pricipalID });
143 } 143 }
144 144
145 public int MemberCount(UUID groupID) 145 public int MemberCount(UUID groupID)
146 { 146 {
147 return (int)m_Membership.GetCount("GroupID", groupID.ToString()); 147 return (int)m_Membership.GetCount("GroupID", groupID.ToString());
@@ -173,7 +173,7 @@ namespace OpenSim.Data.PGSQL
173 173
174 public bool DeleteRole(UUID groupID, UUID roleID) 174 public bool DeleteRole(UUID groupID, UUID roleID)
175 { 175 {
176 return m_Roles.Delete(new string[] { "GroupID", "RoleID" }, 176 return m_Roles.Delete(new string[] { "GroupID", "RoleID" },
177 new string[] { groupID.ToString(), roleID.ToString() }); 177 new string[] { groupID.ToString(), roleID.ToString() });
178 } 178 }
179 179
@@ -365,7 +365,7 @@ namespace OpenSim.Data.PGSQL
365 get { return GetType().Assembly; } 365 get { return GetType().Assembly; }
366 } 366 }
367 367
368 public PGSqlGroupsGroupsHandler(string connectionString, string realm, string store) 368 public PGSqlGroupsGroupsHandler(string connectionString, string realm, string store)
369 : base(connectionString, realm, store) 369 : base(connectionString, realm, store)
370 { 370 {
371 } 371 }
@@ -380,7 +380,7 @@ namespace OpenSim.Data.PGSQL
380 get { return GetType().Assembly; } 380 get { return GetType().Assembly; }
381 } 381 }
382 382
383 public PGSqlGroupsMembershipHandler(string connectionString, string realm) 383 public PGSqlGroupsMembershipHandler(string connectionString, string realm)
384 : base(connectionString, realm, string.Empty) 384 : base(connectionString, realm, string.Empty)
385 { 385 {
386 } 386 }
@@ -395,7 +395,7 @@ namespace OpenSim.Data.PGSQL
395 get { return GetType().Assembly; } 395 get { return GetType().Assembly; }
396 } 396 }
397 397
398 public PGSqlGroupsRolesHandler(string connectionString, string realm) 398 public PGSqlGroupsRolesHandler(string connectionString, string realm)
399 : base(connectionString, realm, string.Empty) 399 : base(connectionString, realm, string.Empty)
400 { 400 {
401 } 401 }
@@ -410,7 +410,7 @@ namespace OpenSim.Data.PGSQL
410 get { return GetType().Assembly; } 410 get { return GetType().Assembly; }
411 } 411 }
412 412
413 public PGSqlGroupsRoleMembershipHandler(string connectionString, string realm) 413 public PGSqlGroupsRoleMembershipHandler(string connectionString, string realm)
414 : base(connectionString, realm, string.Empty) 414 : base(connectionString, realm, string.Empty)
415 { 415 {
416 } 416 }
@@ -425,7 +425,7 @@ namespace OpenSim.Data.PGSQL
425 get { return GetType().Assembly; } 425 get { return GetType().Assembly; }
426 } 426 }
427 427
428 public PGSqlGroupsInvitesHandler(string connectionString, string realm) 428 public PGSqlGroupsInvitesHandler(string connectionString, string realm)
429 : base(connectionString, realm, string.Empty) 429 : base(connectionString, realm, string.Empty)
430 { 430 {
431 } 431 }
@@ -436,7 +436,7 @@ namespace OpenSim.Data.PGSQL
436 using (NpgsqlCommand cmd = new NpgsqlCommand()) 436 using (NpgsqlCommand cmd = new NpgsqlCommand())
437 { 437 {
438 cmd.CommandText = String.Format("delete from {0} where \"TMStamp\" < CURRENT_DATE - INTERVAL '2 week'", m_Realm); 438 cmd.CommandText = String.Format("delete from {0} where \"TMStamp\" < CURRENT_DATE - INTERVAL '2 week'", m_Realm);
439 439
440 ExecuteNonQuery(cmd); 440 ExecuteNonQuery(cmd);
441 } 441 }
442 442
@@ -451,7 +451,7 @@ namespace OpenSim.Data.PGSQL
451 get { return GetType().Assembly; } 451 get { return GetType().Assembly; }
452 } 452 }
453 453
454 public PGSqlGroupsNoticesHandler(string connectionString, string realm) 454 public PGSqlGroupsNoticesHandler(string connectionString, string realm)
455 : base(connectionString, realm, string.Empty) 455 : base(connectionString, realm, string.Empty)
456 { 456 {
457 } 457 }
@@ -462,7 +462,7 @@ namespace OpenSim.Data.PGSQL
462 using (NpgsqlCommand cmd = new NpgsqlCommand()) 462 using (NpgsqlCommand cmd = new NpgsqlCommand())
463 { 463 {
464 cmd.CommandText = String.Format("delete from {0} where \"TMStamp\" < CURRENT_DATE - INTERVAL '2 week'", m_Realm); 464 cmd.CommandText = String.Format("delete from {0} where \"TMStamp\" < CURRENT_DATE - INTERVAL '2 week'", m_Realm);
465 465
466 ExecuteNonQuery(cmd); 466 ExecuteNonQuery(cmd);
467 } 467 }
468 468
@@ -477,7 +477,7 @@ namespace OpenSim.Data.PGSQL
477 get { return GetType().Assembly; } 477 get { return GetType().Assembly; }
478 } 478 }
479 479
480 public PGSqlGroupsPrincipalsHandler(string connectionString, string realm) 480 public PGSqlGroupsPrincipalsHandler(string connectionString, string realm)
481 : base(connectionString, realm, string.Empty) 481 : base(connectionString, realm, string.Empty)
482 { 482 {
483 } 483 }
diff --git a/OpenSim/Data/PGSQL/PGSQLInventoryData.cs b/OpenSim/Data/PGSQL/PGSQLInventoryData.cs
index c999433..30fc5ea 100644
--- a/OpenSim/Data/PGSQL/PGSQLInventoryData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLInventoryData.cs
@@ -69,7 +69,7 @@ namespace OpenSim.Data.PGSQL
69 { 69 {
70 m_connectionString = connectionString; 70 m_connectionString = connectionString;
71 database = new PGSQLManager(connectionString); 71 database = new PGSQLManager(connectionString);
72 72
73 //New migrations check of store 73 //New migrations check of store
74 database.CheckMigration(_migrationStore); 74 database.CheckMigration(_migrationStore);
75 } 75 }
@@ -190,8 +190,8 @@ namespace OpenSim.Data.PGSQL
190 /* NOTE: the implementation below is very inefficient (makes a separate request to get subfolders for 190 /* NOTE: the implementation below is very inefficient (makes a separate request to get subfolders for
191 * every found folder, recursively). Inventory code for other DBs has been already rewritten to get ALL 191 * every found folder, recursively). Inventory code for other DBs has been already rewritten to get ALL
192 * inventory for a specific user at once. 192 * inventory for a specific user at once.
193 * 193 *
194 * Meanwhile, one little thing is corrected: getFolderHierarchy(UUID.Zero) doesn't make sense and should never 194 * Meanwhile, one little thing is corrected: getFolderHierarchy(UUID.Zero) doesn't make sense and should never
195 * be used, so check for that and return an empty list. 195 * be used, so check for that and return an empty list.
196 */ 196 */
197 197
@@ -264,11 +264,11 @@ namespace OpenSim.Data.PGSQL
264 /// <param name="folder">Folder to update</param> 264 /// <param name="folder">Folder to update</param>
265 public void updateInventoryFolder(InventoryFolderBase folder) 265 public void updateInventoryFolder(InventoryFolderBase folder)
266 { 266 {
267 string sql = @"UPDATE inventoryfolders SET ""agentID"" = :agentID, 267 string sql = @"UPDATE inventoryfolders SET ""agentID"" = :agentID,
268 ""parentFolderID"" = :parentFolderID, 268 ""parentFolderID"" = :parentFolderID,
269 ""folderName"" = :folderName, 269 ""folderName"" = :folderName,
270 type = :type, 270 type = :type,
271 version = :version 271 version = :version
272 WHERE folderID = :folderID"; 272 WHERE folderID = :folderID";
273 273
274 string folderName = folder.Name; 274 string folderName = folder.Name;
@@ -337,7 +337,7 @@ namespace OpenSim.Data.PGSQL
337 cmd.Parameters.Add(database.CreateParameter("parentID", UUID.Zero)); 337 cmd.Parameters.Add(database.CreateParameter("parentID", UUID.Zero));
338 conn.Open(); 338 conn.Open();
339 subFolders = getFolderHierarchy(folderID, cmd); 339 subFolders = getFolderHierarchy(folderID, cmd);
340 340
341 341
342 //Delete all sub-folders 342 //Delete all sub-folders
343 foreach (InventoryFolderBase f in subFolders) 343 foreach (InventoryFolderBase f in subFolders)
@@ -403,7 +403,7 @@ namespace OpenSim.Data.PGSQL
403 } 403 }
404 } 404 }
405 } 405 }
406 406
407 m_log.InfoFormat("[INVENTORY DB]: Found no inventory item with ID : {0}", itemID); 407 m_log.InfoFormat("[INVENTORY DB]: Found no inventory item with ID : {0}", itemID);
408 return null; 408 return null;
409 } 409 }
@@ -420,24 +420,24 @@ namespace OpenSim.Data.PGSQL
420 return; 420 return;
421 } 421 }
422 422
423 string sql = @"INSERT INTO inventoryitems 423 string sql = @"INSERT INTO inventoryitems
424 (""inventoryID"", ""assetID"", ""assetType"", ""parentFolderID"", ""avatarID"", ""inventoryName"", 424 (""inventoryID"", ""assetID"", ""assetType"", ""parentFolderID"", ""avatarID"", ""inventoryName"",
425 ""inventoryDescription"", ""inventoryNextPermissions"", ""inventoryCurrentPermissions"", 425 ""inventoryDescription"", ""inventoryNextPermissions"", ""inventoryCurrentPermissions"",
426 ""invType"", ""creatorID"", ""inventoryBasePermissions"", ""inventoryEveryOnePermissions"", ""inventoryGroupPermissions"", 426 ""invType"", ""creatorID"", ""inventoryBasePermissions"", ""inventoryEveryOnePermissions"", ""inventoryGroupPermissions"",
427 ""salePrice"", ""SaleType"", ""creationDate"", ""groupID"", ""groupOwned"", flags) 427 ""salePrice"", ""SaleType"", ""creationDate"", ""groupID"", ""groupOwned"", flags)
428 VALUES 428 VALUES
429 (:inventoryID, :assetID, :assetType, :parentFolderID, :avatarID, :inventoryName, :inventoryDescription, 429 (:inventoryID, :assetID, :assetType, :parentFolderID, :avatarID, :inventoryName, :inventoryDescription,
430 :inventoryNextPermissions, :inventoryCurrentPermissions, :invType, :creatorID, 430 :inventoryNextPermissions, :inventoryCurrentPermissions, :invType, :creatorID,
431 :inventoryBasePermissions, :inventoryEveryOnePermissions, :inventoryGroupPermissions, :SalePrice, :SaleType, 431 :inventoryBasePermissions, :inventoryEveryOnePermissions, :inventoryGroupPermissions, :SalePrice, :SaleType,
432 :creationDate, :groupID, :groupOwned, :flags)"; 432 :creationDate, :groupID, :groupOwned, :flags)";
433 433
434 string itemName = item.Name; 434 string itemName = item.Name;
435 if (item.Name.Length > 64) 435 if (item.Name.Length > 64)
436 { 436 {
437 itemName = item.Name.Substring(0, 64); 437 itemName = item.Name.Substring(0, 64);
438 m_log.Warn("[INVENTORY DB]: Name field truncated from " + item.Name.Length.ToString() + " to " + itemName.Length.ToString() + " characters"); 438 m_log.Warn("[INVENTORY DB]: Name field truncated from " + item.Name.Length.ToString() + " to " + itemName.Length.ToString() + " characters");
439 } 439 }
440 440
441 string itemDesc = item.Description; 441 string itemDesc = item.Description;
442 if (item.Description.Length > 128) 442 if (item.Description.Length > 128)
443 { 443 {
@@ -502,25 +502,25 @@ namespace OpenSim.Data.PGSQL
502 /// <param name="item">Inventory item to update</param> 502 /// <param name="item">Inventory item to update</param>
503 public void updateInventoryItem(InventoryItemBase item) 503 public void updateInventoryItem(InventoryItemBase item)
504 { 504 {
505 string sql = @"UPDATE inventoryitems SET ""assetID"" = :assetID, 505 string sql = @"UPDATE inventoryitems SET ""assetID"" = :assetID,
506 ""assetType"" = :assetType, 506 ""assetType"" = :assetType,
507 ""parentFolderID"" = :parentFolderID, 507 ""parentFolderID"" = :parentFolderID,
508 ""avatarID"" = :avatarID, 508 ""avatarID"" = :avatarID,
509 ""inventoryName"" = :inventoryName, 509 ""inventoryName"" = :inventoryName,
510 ""inventoryDescription"" = :inventoryDescription, 510 ""inventoryDescription"" = :inventoryDescription,
511 ""inventoryNextPermissions"" = :inventoryNextPermissions, 511 ""inventoryNextPermissions"" = :inventoryNextPermissions,
512 ""inventoryCurrentPermissions"" = :inventoryCurrentPermissions, 512 ""inventoryCurrentPermissions"" = :inventoryCurrentPermissions,
513 ""invType"" = :invType, 513 ""invType"" = :invType,
514 ""creatorID"" = :creatorID, 514 ""creatorID"" = :creatorID,
515 ""inventoryBasePermissions"" = :inventoryBasePermissions, 515 ""inventoryBasePermissions"" = :inventoryBasePermissions,
516 ""inventoryEveryOnePermissions"" = :inventoryEveryOnePermissions, 516 ""inventoryEveryOnePermissions"" = :inventoryEveryOnePermissions,
517 ""inventoryGroupPermissions"" = :inventoryGroupPermissions, 517 ""inventoryGroupPermissions"" = :inventoryGroupPermissions,
518 ""salePrice"" = :SalePrice, 518 ""salePrice"" = :SalePrice,
519 ""saleType"" = :SaleType, 519 ""saleType"" = :SaleType,
520 ""creationDate"" = :creationDate, 520 ""creationDate"" = :creationDate,
521 ""groupID"" = :groupID, 521 ""groupID"" = :groupID,
522 ""groupOwned"" = :groupOwned, 522 ""groupOwned"" = :groupOwned,
523 flags = :flags 523 flags = :flags
524 WHERE ""inventoryID"" = :inventoryID"; 524 WHERE ""inventoryID"" = :inventoryID";
525 525
526 string itemName = item.Name; 526 string itemName = item.Name;
@@ -529,7 +529,7 @@ namespace OpenSim.Data.PGSQL
529 itemName = item.Name.Substring(0, 64); 529 itemName = item.Name.Substring(0, 64);
530 m_log.Warn("[INVENTORY DB]: Name field truncated from " + item.Name.Length.ToString() + " to " + itemName.Length.ToString() + " characters on update"); 530 m_log.Warn("[INVENTORY DB]: Name field truncated from " + item.Name.Length.ToString() + " to " + itemName.Length.ToString() + " characters on update");
531 } 531 }
532 532
533 string itemDesc = item.Description; 533 string itemDesc = item.Description;
534 if (item.Description.Length > 128) 534 if (item.Description.Length > 128)
535 { 535 {
diff --git a/OpenSim/Data/PGSQL/PGSQLManager.cs b/OpenSim/Data/PGSQL/PGSQLManager.cs
index af5a7cd..276a37c 100644
--- a/OpenSim/Data/PGSQL/PGSQLManager.cs
+++ b/OpenSim/Data/PGSQL/PGSQLManager.cs
@@ -326,7 +326,7 @@ namespace OpenSim.Data.PGSQL
326 /// <param name="migrationStore">migrationStore.</param> 326 /// <param name="migrationStore">migrationStore.</param>
327 public void CheckMigration(string migrationStore) 327 public void CheckMigration(string migrationStore)
328 { 328 {
329 using (NpgsqlConnection connection = new NpgsqlConnection(connectionString)) 329 using (NpgsqlConnection connection = new NpgsqlConnection(connectionString))
330 { 330 {
331 connection.Open(); 331 connection.Open();
332 Assembly assem = GetType().Assembly; 332 Assembly assem = GetType().Assembly;
diff --git a/OpenSim/Data/PGSQL/PGSQLMigration.cs b/OpenSim/Data/PGSQL/PGSQLMigration.cs
index 709fde0..749a3f2 100644
--- a/OpenSim/Data/PGSQL/PGSQLMigration.cs
+++ b/OpenSim/Data/PGSQL/PGSQLMigration.cs
@@ -54,8 +54,8 @@ namespace OpenSim.Data.PGSQL
54 { 54 {
55 try 55 try
56 { 56 {
57 cmd.CommandText = "select version from migrations where name = '" + type + "' " + 57 cmd.CommandText = "select version from migrations where name = '" + type + "' " +
58 " order by version desc limit 1"; //Must be 58 " order by version desc limit 1"; //Must be
59 using (NpgsqlDataReader reader = cmd.ExecuteReader()) 59 using (NpgsqlDataReader reader = cmd.ExecuteReader())
60 { 60 {
61 if (reader.Read()) 61 if (reader.Read())
diff --git a/OpenSim/Data/PGSQL/PGSQLOfflineIMData.cs b/OpenSim/Data/PGSQL/PGSQLOfflineIMData.cs
index 82e5ed8..a0c3542 100644
--- a/OpenSim/Data/PGSQL/PGSQLOfflineIMData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLOfflineIMData.cs
@@ -47,7 +47,7 @@ namespace OpenSim.Data.PGSQL
47 using (NpgsqlCommand cmd = new NpgsqlCommand()) 47 using (NpgsqlCommand cmd = new NpgsqlCommand())
48 { 48 {
49 cmd.CommandText = String.Format("delete from {0} where \"TMStamp\" < CURRENT_DATE - INTERVAL '2 week'", m_Realm); 49 cmd.CommandText = String.Format("delete from {0} where \"TMStamp\" < CURRENT_DATE - INTERVAL '2 week'", m_Realm);
50 50
51 ExecuteNonQuery(cmd); 51 ExecuteNonQuery(cmd);
52 } 52 }
53 53
diff --git a/OpenSim/Data/PGSQL/PGSQLPresenceData.cs b/OpenSim/Data/PGSQL/PGSQLPresenceData.cs
index 0376585..ebbe8d3 100755
--- a/OpenSim/Data/PGSQL/PGSQLPresenceData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLPresenceData.cs
@@ -80,7 +80,7 @@ namespace OpenSim.Data.PGSQL
80 PresenceData[] pd = Get("SessionID", sessionID.ToString()); 80 PresenceData[] pd = Get("SessionID", sessionID.ToString());
81 if (pd.Length == 0) 81 if (pd.Length == 0)
82 return false; 82 return false;
83 83
84 if (regionID == UUID.Zero) 84 if (regionID == UUID.Zero)
85 return false; 85 return false;
86 86
@@ -103,7 +103,7 @@ namespace OpenSim.Data.PGSQL
103 public bool VerifyAgent(UUID agentId, UUID secureSessionID) 103 public bool VerifyAgent(UUID agentId, UUID secureSessionID)
104 { 104 {
105 PresenceData[] ret = Get("SecureSessionID", secureSessionID.ToString()); 105 PresenceData[] ret = Get("SecureSessionID", secureSessionID.ToString());
106 106
107 if (ret.Length == 0) 107 if (ret.Length == 0)
108 return false; 108 return false;
109 109
diff --git a/OpenSim/Data/PGSQL/PGSQLRegionData.cs b/OpenSim/Data/PGSQL/PGSQLRegionData.cs
index fc352c3..1272e37 100644
--- a/OpenSim/Data/PGSQL/PGSQLRegionData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLRegionData.cs
@@ -57,7 +57,7 @@ namespace OpenSim.Data.PGSQL
57 get { return GetType().Assembly; } 57 get { return GetType().Assembly; }
58 } 58 }
59 59
60 public PGSQLRegionData(string connectionString, string realm) 60 public PGSQLRegionData(string connectionString, string realm)
61 { 61 {
62 m_Realm = realm; 62 m_Realm = realm;
63 m_ConnectionString = connectionString; 63 m_ConnectionString = connectionString;
@@ -77,7 +77,7 @@ namespace OpenSim.Data.PGSQL
77 m_FieldTypes = new Dictionary<string, string>(); 77 m_FieldTypes = new Dictionary<string, string>();
78 78
79 string query = string.Format(@"select column_name,data_type 79 string query = string.Format(@"select column_name,data_type
80 from INFORMATION_SCHEMA.COLUMNS 80 from INFORMATION_SCHEMA.COLUMNS
81 where table_name = lower('{0}'); 81 where table_name = lower('{0}');
82 82
83 ", m_Realm); 83 ", m_Realm);
@@ -107,7 +107,7 @@ namespace OpenSim.Data.PGSQL
107 using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn)) 107 using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
108 { 108 {
109 cmd.Parameters.Add(m_database.CreateParameter("regionName", regionName)); 109 cmd.Parameters.Add(m_database.CreateParameter("regionName", regionName));
110 if (scopeID != UUID.Zero) 110 if (scopeID != UUID.Zero)
111 cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID)); 111 cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID));
112 conn.Open(); 112 conn.Open();
113 return RunCommand(cmd); 113 return RunCommand(cmd);
@@ -134,7 +134,7 @@ namespace OpenSim.Data.PGSQL
134 cmd.Parameters.Add(m_database.CreateParameter("startY", startY)); 134 cmd.Parameters.Add(m_database.CreateParameter("startY", startY));
135 cmd.Parameters.Add(m_database.CreateParameter("endX", endX)); 135 cmd.Parameters.Add(m_database.CreateParameter("endX", endX));
136 cmd.Parameters.Add(m_database.CreateParameter("endY", endY)); 136 cmd.Parameters.Add(m_database.CreateParameter("endY", endY));
137 if (scopeID != UUID.Zero) 137 if (scopeID != UUID.Zero)
138 cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID)); 138 cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID));
139 conn.Open(); 139 conn.Open();
140 ret = RunCommand(cmd); 140 ret = RunCommand(cmd);
@@ -167,7 +167,7 @@ namespace OpenSim.Data.PGSQL
167 using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn)) 167 using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
168 { 168 {
169 cmd.Parameters.Add(m_database.CreateParameter("regionID", regionID)); 169 cmd.Parameters.Add(m_database.CreateParameter("regionID", regionID));
170 if (scopeID != UUID.Zero) 170 if (scopeID != UUID.Zero)
171 cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID)); 171 cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID));
172 conn.Open(); 172 conn.Open();
173 List<RegionData> ret = RunCommand(cmd); 173 List<RegionData> ret = RunCommand(cmd);
@@ -196,7 +196,7 @@ namespace OpenSim.Data.PGSQL
196 cmd.Parameters.Add(m_database.CreateParameter("startY", qstartY)); 196 cmd.Parameters.Add(m_database.CreateParameter("startY", qstartY));
197 cmd.Parameters.Add(m_database.CreateParameter("endX", endX)); 197 cmd.Parameters.Add(m_database.CreateParameter("endX", endX));
198 cmd.Parameters.Add(m_database.CreateParameter("endY", endY)); 198 cmd.Parameters.Add(m_database.CreateParameter("endY", endY));
199 if (scopeID != UUID.Zero) 199 if (scopeID != UUID.Zero)
200 cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID)); 200 cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID));
201 conn.Open(); 201 conn.Open();
202 202
@@ -298,7 +298,7 @@ namespace OpenSim.Data.PGSQL
298 { 298 {
299 299
300 string update = "update " + m_Realm + " set \"locX\"=:posX, \"locY\"=:posY, \"sizeX\"=:sizeX, \"sizeY\"=:sizeY "; 300 string update = "update " + m_Realm + " set \"locX\"=:posX, \"locY\"=:posY, \"sizeX\"=:sizeX, \"sizeY\"=:sizeY ";
301 301
302 foreach (string field in fields) 302 foreach (string field in fields)
303 { 303 {
304 304
diff --git a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs
index 902aae0..33d12bd 100755
--- a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs
@@ -110,11 +110,11 @@ namespace OpenSim.Data.PGSQL
110 Dictionary<UUID, SceneObjectGroup> objects = new Dictionary<UUID, SceneObjectGroup>(); 110 Dictionary<UUID, SceneObjectGroup> objects = new Dictionary<UUID, SceneObjectGroup>();
111 SceneObjectGroup grp = null; 111 SceneObjectGroup grp = null;
112 112
113 string sql = @"SELECT *, 113 string sql = @"SELECT *,
114 CASE WHEN prims.""UUID"" = prims.""SceneGroupID"" THEN 0 ELSE 1 END as sort 114 CASE WHEN prims.""UUID"" = prims.""SceneGroupID"" THEN 0 ELSE 1 END as sort
115 FROM prims 115 FROM prims
116 LEFT JOIN primshapes ON prims.""UUID"" = primshapes.""UUID"" 116 LEFT JOIN primshapes ON prims.""UUID"" = primshapes.""UUID""
117 WHERE ""RegionUUID"" = :RegionUUID 117 WHERE ""RegionUUID"" = :RegionUUID
118 ORDER BY ""SceneGroupID"" asc, sort asc, ""LinkNumber"" asc"; 118 ORDER BY ""SceneGroupID"" asc, sort asc, ""LinkNumber"" asc";
119 119
120 using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString)) 120 using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
@@ -146,7 +146,7 @@ namespace OpenSim.Data.PGSQL
146 // There sometimes exist OpenSim bugs that 'orphan groups' so that none of the prims are 146 // There sometimes exist OpenSim bugs that 'orphan groups' so that none of the prims are
147 // recorded as the root prim (for which the UUID must equal the persisted group UUID). In 147 // recorded as the root prim (for which the UUID must equal the persisted group UUID). In
148 // this case, force the UUID to be the same as the group UUID so that at least these can be 148 // this case, force the UUID to be the same as the group UUID so that at least these can be
149 // deleted (we need to change the UUID so that any other prims in the linkset can also be 149 // deleted (we need to change the UUID so that any other prims in the linkset can also be
150 // deleted). 150 // deleted).
151 if (sceneObjectPart.UUID != groupID && groupID != UUID.Zero) 151 if (sceneObjectPart.UUID != groupID && groupID != UUID.Zero)
152 { 152 {
@@ -178,7 +178,7 @@ namespace OpenSim.Data.PGSQL
178 objects[grp.UUID] = grp; 178 objects[grp.UUID] = grp;
179 179
180 // Instead of attempting to LoadItems on every prim, 180 // Instead of attempting to LoadItems on every prim,
181 // most of which probably have no items... get a 181 // most of which probably have no items... get a
182 // list from DB of all prims which have items and 182 // list from DB of all prims which have items and
183 // LoadItems only on those 183 // LoadItems only on those
184 List<SceneObjectPart> primsWithInventory = new List<SceneObjectPart>(); 184 List<SceneObjectPart> primsWithInventory = new List<SceneObjectPart>();
@@ -331,52 +331,52 @@ namespace OpenSim.Data.PGSQL
331 private void StoreSceneObjectPrim(SceneObjectPart sceneObjectPart, NpgsqlCommand sqlCommand, UUID sceneGroupID, UUID regionUUID) 331 private void StoreSceneObjectPrim(SceneObjectPart sceneObjectPart, NpgsqlCommand sqlCommand, UUID sceneGroupID, UUID regionUUID)
332 { 332 {
333 //Big query to update or insert a new prim. 333 //Big query to update or insert a new prim.
334 334
335 string queryPrims = @" 335 string queryPrims = @"
336 UPDATE prims SET 336 UPDATE prims SET
337 ""CreationDate"" = :CreationDate, ""Name"" = :Name, ""Text"" = :Text, ""Description"" = :Description, ""SitName"" = :SitName, 337 ""CreationDate"" = :CreationDate, ""Name"" = :Name, ""Text"" = :Text, ""Description"" = :Description, ""SitName"" = :SitName,
338 ""TouchName"" = :TouchName, ""ObjectFlags"" = :ObjectFlags, ""OwnerMask"" = :OwnerMask, ""NextOwnerMask"" = :NextOwnerMask, ""GroupMask"" = :GroupMask, 338 ""TouchName"" = :TouchName, ""ObjectFlags"" = :ObjectFlags, ""OwnerMask"" = :OwnerMask, ""NextOwnerMask"" = :NextOwnerMask, ""GroupMask"" = :GroupMask,
339 ""EveryoneMask"" = :EveryoneMask, ""BaseMask"" = :BaseMask, ""PositionX"" = :PositionX, ""PositionY"" = :PositionY, ""PositionZ"" = :PositionZ, 339 ""EveryoneMask"" = :EveryoneMask, ""BaseMask"" = :BaseMask, ""PositionX"" = :PositionX, ""PositionY"" = :PositionY, ""PositionZ"" = :PositionZ,
340 ""GroupPositionX"" = :GroupPositionX, ""GroupPositionY"" = :GroupPositionY, ""GroupPositionZ"" = :GroupPositionZ, ""VelocityX"" = :VelocityX, 340 ""GroupPositionX"" = :GroupPositionX, ""GroupPositionY"" = :GroupPositionY, ""GroupPositionZ"" = :GroupPositionZ, ""VelocityX"" = :VelocityX,
341 ""VelocityY"" = :VelocityY, ""VelocityZ"" = :VelocityZ, ""AngularVelocityX"" = :AngularVelocityX, ""AngularVelocityY"" = :AngularVelocityY, 341 ""VelocityY"" = :VelocityY, ""VelocityZ"" = :VelocityZ, ""AngularVelocityX"" = :AngularVelocityX, ""AngularVelocityY"" = :AngularVelocityY,
342 ""AngularVelocityZ"" = :AngularVelocityZ, ""AccelerationX"" = :AccelerationX, ""AccelerationY"" = :AccelerationY, 342 ""AngularVelocityZ"" = :AngularVelocityZ, ""AccelerationX"" = :AccelerationX, ""AccelerationY"" = :AccelerationY,
343 ""AccelerationZ"" = :AccelerationZ, ""RotationX"" = :RotationX, ""RotationY"" = :RotationY, ""RotationZ"" = :RotationZ, ""RotationW"" = :RotationW, 343 ""AccelerationZ"" = :AccelerationZ, ""RotationX"" = :RotationX, ""RotationY"" = :RotationY, ""RotationZ"" = :RotationZ, ""RotationW"" = :RotationW,
344 ""SitTargetOffsetX"" = :SitTargetOffsetX, ""SitTargetOffsetY"" = :SitTargetOffsetY, ""SitTargetOffsetZ"" = :SitTargetOffsetZ, 344 ""SitTargetOffsetX"" = :SitTargetOffsetX, ""SitTargetOffsetY"" = :SitTargetOffsetY, ""SitTargetOffsetZ"" = :SitTargetOffsetZ,
345 ""SitTargetOrientW"" = :SitTargetOrientW, ""SitTargetOrientX"" = :SitTargetOrientX, ""SitTargetOrientY"" = :SitTargetOrientY, 345 ""SitTargetOrientW"" = :SitTargetOrientW, ""SitTargetOrientX"" = :SitTargetOrientX, ""SitTargetOrientY"" = :SitTargetOrientY,
346 ""SitTargetOrientZ"" = :SitTargetOrientZ, ""RegionUUID"" = :RegionUUID, ""CreatorID"" = :CreatorID, ""OwnerID"" = :OwnerID, ""GroupID"" = :GroupID, 346 ""SitTargetOrientZ"" = :SitTargetOrientZ, ""RegionUUID"" = :RegionUUID, ""CreatorID"" = :CreatorID, ""OwnerID"" = :OwnerID, ""GroupID"" = :GroupID,
347 ""LastOwnerID"" = :LastOwnerID, ""SceneGroupID"" = :SceneGroupID, ""PayPrice"" = :PayPrice, ""PayButton1"" = :PayButton1, ""PayButton2"" = :PayButton2, 347 ""LastOwnerID"" = :LastOwnerID, ""SceneGroupID"" = :SceneGroupID, ""PayPrice"" = :PayPrice, ""PayButton1"" = :PayButton1, ""PayButton2"" = :PayButton2,
348 ""PayButton3"" = :PayButton3, ""PayButton4"" = :PayButton4, ""LoopedSound"" = :LoopedSound, ""LoopedSoundGain"" = :LoopedSoundGain, 348 ""PayButton3"" = :PayButton3, ""PayButton4"" = :PayButton4, ""LoopedSound"" = :LoopedSound, ""LoopedSoundGain"" = :LoopedSoundGain,
349 ""TextureAnimation"" = :TextureAnimation, ""OmegaX"" = :OmegaX, ""OmegaY"" = :OmegaY, ""OmegaZ"" = :OmegaZ, ""CameraEyeOffsetX"" = :CameraEyeOffsetX, 349 ""TextureAnimation"" = :TextureAnimation, ""OmegaX"" = :OmegaX, ""OmegaY"" = :OmegaY, ""OmegaZ"" = :OmegaZ, ""CameraEyeOffsetX"" = :CameraEyeOffsetX,
350 ""CameraEyeOffsetY"" = :CameraEyeOffsetY, ""CameraEyeOffsetZ"" = :CameraEyeOffsetZ, ""CameraAtOffsetX"" = :CameraAtOffsetX, 350 ""CameraEyeOffsetY"" = :CameraEyeOffsetY, ""CameraEyeOffsetZ"" = :CameraEyeOffsetZ, ""CameraAtOffsetX"" = :CameraAtOffsetX,
351 ""CameraAtOffsetY"" = :CameraAtOffsetY, ""CameraAtOffsetZ"" = :CameraAtOffsetZ, ""ForceMouselook"" = :ForceMouselook, 351 ""CameraAtOffsetY"" = :CameraAtOffsetY, ""CameraAtOffsetZ"" = :CameraAtOffsetZ, ""ForceMouselook"" = :ForceMouselook,
352 ""ScriptAccessPin"" = :ScriptAccessPin, ""AllowedDrop"" = :AllowedDrop, ""DieAtEdge"" = :DieAtEdge, ""SalePrice"" = :SalePrice, 352 ""ScriptAccessPin"" = :ScriptAccessPin, ""AllowedDrop"" = :AllowedDrop, ""DieAtEdge"" = :DieAtEdge, ""SalePrice"" = :SalePrice,
353 ""SaleType"" = :SaleType, ""ColorR"" = :ColorR, ""ColorG"" = :ColorG, ""ColorB"" = :ColorB, ""ColorA"" = :ColorA, ""ParticleSystem"" = :ParticleSystem, 353 ""SaleType"" = :SaleType, ""ColorR"" = :ColorR, ""ColorG"" = :ColorG, ""ColorB"" = :ColorB, ""ColorA"" = :ColorA, ""ParticleSystem"" = :ParticleSystem,
354 ""ClickAction"" = :ClickAction, ""Material"" = :Material, ""CollisionSound"" = :CollisionSound, ""CollisionSoundVolume"" = :CollisionSoundVolume, ""PassTouches"" = :PassTouches, 354 ""ClickAction"" = :ClickAction, ""Material"" = :Material, ""CollisionSound"" = :CollisionSound, ""CollisionSoundVolume"" = :CollisionSoundVolume, ""PassTouches"" = :PassTouches,
355 ""LinkNumber"" = :LinkNumber, ""MediaURL"" = :MediaURL, ""DynAttrs"" = :DynAttrs, 355 ""LinkNumber"" = :LinkNumber, ""MediaURL"" = :MediaURL, ""DynAttrs"" = :DynAttrs,
356 ""PhysicsShapeType"" = :PhysicsShapeType, ""Density"" = :Density, ""GravityModifier"" = :GravityModifier, ""Friction"" = :Friction, ""Restitution"" = :Restitution 356 ""PhysicsShapeType"" = :PhysicsShapeType, ""Density"" = :Density, ""GravityModifier"" = :GravityModifier, ""Friction"" = :Friction, ""Restitution"" = :Restitution
357 WHERE ""UUID"" = :UUID ; 357 WHERE ""UUID"" = :UUID ;
358 358
359 INSERT INTO 359 INSERT INTO
360 prims ( 360 prims (
361 ""UUID"", ""CreationDate"", ""Name"", ""Text"", ""Description"", ""SitName"", ""TouchName"", ""ObjectFlags"", ""OwnerMask"", ""NextOwnerMask"", ""GroupMask"", 361 ""UUID"", ""CreationDate"", ""Name"", ""Text"", ""Description"", ""SitName"", ""TouchName"", ""ObjectFlags"", ""OwnerMask"", ""NextOwnerMask"", ""GroupMask"",
362 ""EveryoneMask"", ""BaseMask"", ""PositionX"", ""PositionY"", ""PositionZ"", ""GroupPositionX"", ""GroupPositionY"", ""GroupPositionZ"", ""VelocityX"", 362 ""EveryoneMask"", ""BaseMask"", ""PositionX"", ""PositionY"", ""PositionZ"", ""GroupPositionX"", ""GroupPositionY"", ""GroupPositionZ"", ""VelocityX"",
363 ""VelocityY"", ""VelocityZ"", ""AngularVelocityX"", ""AngularVelocityY"", ""AngularVelocityZ"", ""AccelerationX"", ""AccelerationY"", ""AccelerationZ"", 363 ""VelocityY"", ""VelocityZ"", ""AngularVelocityX"", ""AngularVelocityY"", ""AngularVelocityZ"", ""AccelerationX"", ""AccelerationY"", ""AccelerationZ"",
364 ""RotationX"", ""RotationY"", ""RotationZ"", ""RotationW"", ""SitTargetOffsetX"", ""SitTargetOffsetY"", ""SitTargetOffsetZ"", ""SitTargetOrientW"", 364 ""RotationX"", ""RotationY"", ""RotationZ"", ""RotationW"", ""SitTargetOffsetX"", ""SitTargetOffsetY"", ""SitTargetOffsetZ"", ""SitTargetOrientW"",
365 ""SitTargetOrientX"", ""SitTargetOrientY"", ""SitTargetOrientZ"", ""RegionUUID"", ""CreatorID"", ""OwnerID"", ""GroupID"", ""LastOwnerID"", ""SceneGroupID"", 365 ""SitTargetOrientX"", ""SitTargetOrientY"", ""SitTargetOrientZ"", ""RegionUUID"", ""CreatorID"", ""OwnerID"", ""GroupID"", ""LastOwnerID"", ""SceneGroupID"",
366 ""PayPrice"", ""PayButton1"", ""PayButton2"", ""PayButton3"", ""PayButton4"", ""LoopedSound"", ""LoopedSoundGain"", ""TextureAnimation"", ""OmegaX"", 366 ""PayPrice"", ""PayButton1"", ""PayButton2"", ""PayButton3"", ""PayButton4"", ""LoopedSound"", ""LoopedSoundGain"", ""TextureAnimation"", ""OmegaX"",
367 ""OmegaY"", ""OmegaZ"", ""CameraEyeOffsetX"", ""CameraEyeOffsetY"", ""CameraEyeOffsetZ"", ""CameraAtOffsetX"", ""CameraAtOffsetY"", ""CameraAtOffsetZ"", 367 ""OmegaY"", ""OmegaZ"", ""CameraEyeOffsetX"", ""CameraEyeOffsetY"", ""CameraEyeOffsetZ"", ""CameraAtOffsetX"", ""CameraAtOffsetY"", ""CameraAtOffsetZ"",
368 ""ForceMouselook"", ""ScriptAccessPin"", ""AllowedDrop"", ""DieAtEdge"", ""SalePrice"", ""SaleType"", ""ColorR"", ""ColorG"", ""ColorB"", ""ColorA"", 368 ""ForceMouselook"", ""ScriptAccessPin"", ""AllowedDrop"", ""DieAtEdge"", ""SalePrice"", ""SaleType"", ""ColorR"", ""ColorG"", ""ColorB"", ""ColorA"",
369 ""ParticleSystem"", ""ClickAction"", ""Material"", ""CollisionSound"", ""CollisionSoundVolume"", ""PassTouches"", ""LinkNumber"", ""MediaURL"", ""DynAttrs"", 369 ""ParticleSystem"", ""ClickAction"", ""Material"", ""CollisionSound"", ""CollisionSoundVolume"", ""PassTouches"", ""LinkNumber"", ""MediaURL"", ""DynAttrs"",
370 ""PhysicsShapeType"", ""Density"", ""GravityModifier"", ""Friction"", ""Restitution"" 370 ""PhysicsShapeType"", ""Density"", ""GravityModifier"", ""Friction"", ""Restitution""
371 ) Select 371 ) Select
372 :UUID, :CreationDate, :Name, :Text, :Description, :SitName, :TouchName, :ObjectFlags, :OwnerMask, :NextOwnerMask, :GroupMask, 372 :UUID, :CreationDate, :Name, :Text, :Description, :SitName, :TouchName, :ObjectFlags, :OwnerMask, :NextOwnerMask, :GroupMask,
373 :EveryoneMask, :BaseMask, :PositionX, :PositionY, :PositionZ, :GroupPositionX, :GroupPositionY, :GroupPositionZ, :VelocityX, 373 :EveryoneMask, :BaseMask, :PositionX, :PositionY, :PositionZ, :GroupPositionX, :GroupPositionY, :GroupPositionZ, :VelocityX,
374 :VelocityY, :VelocityZ, :AngularVelocityX, :AngularVelocityY, :AngularVelocityZ, :AccelerationX, :AccelerationY, :AccelerationZ, 374 :VelocityY, :VelocityZ, :AngularVelocityX, :AngularVelocityY, :AngularVelocityZ, :AccelerationX, :AccelerationY, :AccelerationZ,
375 :RotationX, :RotationY, :RotationZ, :RotationW, :SitTargetOffsetX, :SitTargetOffsetY, :SitTargetOffsetZ, :SitTargetOrientW, 375 :RotationX, :RotationY, :RotationZ, :RotationW, :SitTargetOffsetX, :SitTargetOffsetY, :SitTargetOffsetZ, :SitTargetOrientW,
376 :SitTargetOrientX, :SitTargetOrientY, :SitTargetOrientZ, :RegionUUID, :CreatorID, :OwnerID, :GroupID, :LastOwnerID, :SceneGroupID, 376 :SitTargetOrientX, :SitTargetOrientY, :SitTargetOrientZ, :RegionUUID, :CreatorID, :OwnerID, :GroupID, :LastOwnerID, :SceneGroupID,
377 :PayPrice, :PayButton1, :PayButton2, :PayButton3, :PayButton4, :LoopedSound, :LoopedSoundGain, :TextureAnimation, :OmegaX, 377 :PayPrice, :PayButton1, :PayButton2, :PayButton3, :PayButton4, :LoopedSound, :LoopedSoundGain, :TextureAnimation, :OmegaX,
378 :OmegaY, :OmegaZ, :CameraEyeOffsetX, :CameraEyeOffsetY, :CameraEyeOffsetZ, :CameraAtOffsetX, :CameraAtOffsetY, :CameraAtOffsetZ, 378 :OmegaY, :OmegaZ, :CameraEyeOffsetX, :CameraEyeOffsetY, :CameraEyeOffsetZ, :CameraAtOffsetX, :CameraAtOffsetY, :CameraAtOffsetZ,
379 :ForceMouselook, :ScriptAccessPin, :AllowedDrop, :DieAtEdge, :SalePrice, :SaleType, :ColorR, :ColorG, :ColorB, :ColorA, 379 :ForceMouselook, :ScriptAccessPin, :AllowedDrop, :DieAtEdge, :SalePrice, :SaleType, :ColorR, :ColorG, :ColorB, :ColorA,
380 :ParticleSystem, :ClickAction, :Material, :CollisionSound, :CollisionSoundVolume, :PassTouches, :LinkNumber, :MediaURL, :DynAttrs, 380 :ParticleSystem, :ClickAction, :Material, :CollisionSound, :CollisionSoundVolume, :PassTouches, :LinkNumber, :MediaURL, :DynAttrs,
381 :PhysicsShapeType, :Density, :GravityModifier, :Friction, :Restitution 381 :PhysicsShapeType, :Density, :GravityModifier, :Friction, :Restitution
382 where not EXISTS (SELECT ""UUID"" FROM prims WHERE ""UUID"" = :UUID); 382 where not EXISTS (SELECT ""UUID"" FROM prims WHERE ""UUID"" = :UUID);
@@ -401,26 +401,26 @@ namespace OpenSim.Data.PGSQL
401 private void StoreSceneObjectPrimShapes(SceneObjectPart sceneObjectPart, NpgsqlCommand sqlCommand, UUID sceneGroupID, UUID regionUUID) 401 private void StoreSceneObjectPrimShapes(SceneObjectPart sceneObjectPart, NpgsqlCommand sqlCommand, UUID sceneGroupID, UUID regionUUID)
402 { 402 {
403 //Big query to or insert or update primshapes 403 //Big query to or insert or update primshapes
404 404
405 string queryPrimShapes = @" 405 string queryPrimShapes = @"
406 UPDATE primshapes SET 406 UPDATE primshapes SET
407 ""Shape"" = :Shape, ""ScaleX"" = :ScaleX, ""ScaleY"" = :ScaleY, ""ScaleZ"" = :ScaleZ, ""PCode"" = :PCode, ""PathBegin"" = :PathBegin, 407 ""Shape"" = :Shape, ""ScaleX"" = :ScaleX, ""ScaleY"" = :ScaleY, ""ScaleZ"" = :ScaleZ, ""PCode"" = :PCode, ""PathBegin"" = :PathBegin,
408 ""PathEnd"" = :PathEnd, ""PathScaleX"" = :PathScaleX, ""PathScaleY"" = :PathScaleY, ""PathShearX"" = :PathShearX, ""PathShearY"" = :PathShearY, 408 ""PathEnd"" = :PathEnd, ""PathScaleX"" = :PathScaleX, ""PathScaleY"" = :PathScaleY, ""PathShearX"" = :PathShearX, ""PathShearY"" = :PathShearY,
409 ""PathSkew"" = :PathSkew, ""PathCurve"" = :PathCurve, ""PathRadiusOffset"" = :PathRadiusOffset, ""PathRevolutions"" = :PathRevolutions, 409 ""PathSkew"" = :PathSkew, ""PathCurve"" = :PathCurve, ""PathRadiusOffset"" = :PathRadiusOffset, ""PathRevolutions"" = :PathRevolutions,
410 ""PathTaperX"" = :PathTaperX, ""PathTaperY"" = :PathTaperY, ""PathTwist"" = :PathTwist, ""PathTwistBegin"" = :PathTwistBegin, 410 ""PathTaperX"" = :PathTaperX, ""PathTaperY"" = :PathTaperY, ""PathTwist"" = :PathTwist, ""PathTwistBegin"" = :PathTwistBegin,
411 ""ProfileBegin"" = :ProfileBegin, ""ProfileEnd"" = :ProfileEnd, ""ProfileCurve"" = :ProfileCurve, ""ProfileHollow"" = :ProfileHollow, 411 ""ProfileBegin"" = :ProfileBegin, ""ProfileEnd"" = :ProfileEnd, ""ProfileCurve"" = :ProfileCurve, ""ProfileHollow"" = :ProfileHollow,
412 ""Texture"" = :Texture, ""ExtraParams"" = :ExtraParams, ""State"" = :State, ""Media"" = :Media 412 ""Texture"" = :Texture, ""ExtraParams"" = :ExtraParams, ""State"" = :State, ""Media"" = :Media
413 WHERE ""UUID"" = :UUID ; 413 WHERE ""UUID"" = :UUID ;
414 414
415 INSERT INTO 415 INSERT INTO
416 primshapes ( 416 primshapes (
417 ""UUID"", ""Shape"", ""ScaleX"", ""ScaleY"", ""ScaleZ"", ""PCode"", ""PathBegin"", ""PathEnd"", ""PathScaleX"", ""PathScaleY"", ""PathShearX"", ""PathShearY"", 417 ""UUID"", ""Shape"", ""ScaleX"", ""ScaleY"", ""ScaleZ"", ""PCode"", ""PathBegin"", ""PathEnd"", ""PathScaleX"", ""PathScaleY"", ""PathShearX"", ""PathShearY"",
418 ""PathSkew"", ""PathCurve"", ""PathRadiusOffset"", ""PathRevolutions"", ""PathTaperX"", ""PathTaperY"", ""PathTwist"", ""PathTwistBegin"", ""ProfileBegin"", 418 ""PathSkew"", ""PathCurve"", ""PathRadiusOffset"", ""PathRevolutions"", ""PathTaperX"", ""PathTaperY"", ""PathTwist"", ""PathTwistBegin"", ""ProfileBegin"",
419 ""ProfileEnd"", ""ProfileCurve"", ""ProfileHollow"", ""Texture"", ""ExtraParams"", ""State"", ""Media"" 419 ""ProfileEnd"", ""ProfileCurve"", ""ProfileHollow"", ""Texture"", ""ExtraParams"", ""State"", ""Media""
420 ) 420 )
421 Select 421 Select
422 :UUID, :Shape, :ScaleX, :ScaleY, :ScaleZ, :PCode, :PathBegin, :PathEnd, :PathScaleX, :PathScaleY, :PathShearX, :PathShearY, 422 :UUID, :Shape, :ScaleX, :ScaleY, :ScaleZ, :PCode, :PathBegin, :PathEnd, :PathScaleX, :PathScaleY, :PathShearX, :PathShearY,
423 :PathSkew, :PathCurve, :PathRadiusOffset, :PathRevolutions, :PathTaperX, :PathTaperY, :PathTwist, :PathTwistBegin, :ProfileBegin, 423 :PathSkew, :PathCurve, :PathRadiusOffset, :PathRevolutions, :PathTaperX, :PathTaperY, :PathTwist, :PathTwistBegin, :ProfileBegin,
424 :ProfileEnd, :ProfileCurve, :ProfileHollow, :Texture, :ExtraParams, :State, :Media 424 :ProfileEnd, :ProfileCurve, :ProfileHollow, :Texture, :ExtraParams, :State, :Media
425 where not EXISTS (SELECT ""UUID"" FROM primshapes WHERE ""UUID"" = :UUID); 425 where not EXISTS (SELECT ""UUID"" FROM primshapes WHERE ""UUID"" = :UUID);
426 "; 426 ";
@@ -500,7 +500,7 @@ namespace OpenSim.Data.PGSQL
500 sql = 500 sql =
501 @"INSERT INTO primitems ( 501 @"INSERT INTO primitems (
502 ""itemID"",""primID"",""assetID"",""parentFolderID"",""invType"",""assetType"",""name"",""description"",""creationDate"",""creatorID"",""ownerID"",""lastOwnerID"",""groupID"", 502 ""itemID"",""primID"",""assetID"",""parentFolderID"",""invType"",""assetType"",""name"",""description"",""creationDate"",""creatorID"",""ownerID"",""lastOwnerID"",""groupID"",
503 ""nextPermissions"",""currentPermissions"",""basePermissions"",""everyonePermissions"",""groupPermissions"",""flags"") 503 ""nextPermissions"",""currentPermissions"",""basePermissions"",""everyonePermissions"",""groupPermissions"",""flags"")
504 VALUES (:itemID,:primID,:assetID,:parentFolderID,:invType,:assetType,:name,:description,:creationDate,:creatorID,:ownerID, 504 VALUES (:itemID,:primID,:assetID,:parentFolderID,:invType,:assetType,:name,:description,:creationDate,:creatorID,:ownerID,
505 :lastOwnerID,:groupID,:nextPermissions,:currentPermissions,:basePermissions,:everyonePermissions,:groupPermissions,:flags)"; 505 :lastOwnerID,:groupID,:nextPermissions,:currentPermissions,:basePermissions,:everyonePermissions,:groupPermissions,:flags)";
506 506
@@ -538,7 +538,7 @@ namespace OpenSim.Data.PGSQL
538 { 538 {
539 TerrainData terrData = null; 539 TerrainData terrData = null;
540 540
541 string sql = @"select ""RegionUUID"", ""Revision"", ""Heightfield"" from terrain 541 string sql = @"select ""RegionUUID"", ""Revision"", ""Heightfield"" from terrain
542 where ""RegionUUID"" = :RegionUUID order by ""Revision"" desc limit 1; "; 542 where ""RegionUUID"" = :RegionUUID order by ""Revision"" desc limit 1; ";
543 543
544 using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString)) 544 using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
@@ -577,7 +577,7 @@ namespace OpenSim.Data.PGSQL
577 { 577 {
578 TerrainData terrData = null; 578 TerrainData terrData = null;
579 579
580 string sql = @"select ""RegionUUID"", ""Revision"", ""Heightfield"" from bakedterrain 580 string sql = @"select ""RegionUUID"", ""Revision"", ""Heightfield"" from bakedterrain
581 where ""RegionUUID"" = :RegionUUID; "; 581 where ""RegionUUID"" = :RegionUUID; ";
582 582
583 using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString)) 583 using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
@@ -1319,7 +1319,7 @@ namespace OpenSim.Data.PGSQL
1319 { 1319 {
1320 { 1320 {
1321 string sql = "DELETE FROM regionenvironment WHERE region_id = :region_id ;"; 1321 string sql = "DELETE FROM regionenvironment WHERE region_id = :region_id ;";
1322 1322
1323 using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString)) 1323 using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
1324 using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn)) 1324 using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
1325 { 1325 {
@@ -1420,17 +1420,17 @@ namespace OpenSim.Data.PGSQL
1420 { 1420 {
1421 //This method only updates region settings!!! First call LoadRegionSettings to create new region settings in DB 1421 //This method only updates region settings!!! First call LoadRegionSettings to create new region settings in DB
1422 sql = 1422 sql =
1423 @"UPDATE regionsettings SET block_terraform = :block_terraform ,block_fly = :block_fly ,allow_damage = :allow_damage 1423 @"UPDATE regionsettings SET block_terraform = :block_terraform ,block_fly = :block_fly ,allow_damage = :allow_damage
1424,restrict_pushing = :restrict_pushing ,allow_land_resell = :allow_land_resell ,allow_land_join_divide = :allow_land_join_divide 1424,restrict_pushing = :restrict_pushing ,allow_land_resell = :allow_land_resell ,allow_land_join_divide = :allow_land_join_divide
1425,block_show_in_search = :block_show_in_search ,agent_limit = :agent_limit ,object_bonus = :object_bonus ,maturity = :maturity 1425,block_show_in_search = :block_show_in_search ,agent_limit = :agent_limit ,object_bonus = :object_bonus ,maturity = :maturity
1426,disable_scripts = :disable_scripts ,disable_collisions = :disable_collisions ,disable_physics = :disable_physics 1426,disable_scripts = :disable_scripts ,disable_collisions = :disable_collisions ,disable_physics = :disable_physics
1427,terrain_texture_1 = :terrain_texture_1 ,terrain_texture_2 = :terrain_texture_2 ,terrain_texture_3 = :terrain_texture_3 1427,terrain_texture_1 = :terrain_texture_1 ,terrain_texture_2 = :terrain_texture_2 ,terrain_texture_3 = :terrain_texture_3
1428,terrain_texture_4 = :terrain_texture_4 ,elevation_1_nw = :elevation_1_nw ,elevation_2_nw = :elevation_2_nw 1428,terrain_texture_4 = :terrain_texture_4 ,elevation_1_nw = :elevation_1_nw ,elevation_2_nw = :elevation_2_nw
1429,elevation_1_ne = :elevation_1_ne ,elevation_2_ne = :elevation_2_ne ,elevation_1_se = :elevation_1_se ,elevation_2_se = :elevation_2_se 1429,elevation_1_ne = :elevation_1_ne ,elevation_2_ne = :elevation_2_ne ,elevation_1_se = :elevation_1_se ,elevation_2_se = :elevation_2_se
1430,elevation_1_sw = :elevation_1_sw ,elevation_2_sw = :elevation_2_sw ,water_height = :water_height ,terrain_raise_limit = :terrain_raise_limit 1430,elevation_1_sw = :elevation_1_sw ,elevation_2_sw = :elevation_2_sw ,water_height = :water_height ,terrain_raise_limit = :terrain_raise_limit
1431,terrain_lower_limit = :terrain_lower_limit ,use_estate_sun = :use_estate_sun ,fixed_sun = :fixed_sun ,sun_position = :sun_position 1431,terrain_lower_limit = :terrain_lower_limit ,use_estate_sun = :use_estate_sun ,fixed_sun = :fixed_sun ,sun_position = :sun_position
1432,covenant = :covenant ,covenant_datetime = :covenant_datetime, sunvectorx = :sunvectorx, sunvectory = :sunvectory, sunvectorz = :sunvectorz, 1432,covenant = :covenant ,covenant_datetime = :covenant_datetime, sunvectorx = :sunvectorx, sunvectory = :sunvectory, sunvectorz = :sunvectorz,
1433""Sandbox"" = :Sandbox, loaded_creation_datetime = :loaded_creation_datetime, loaded_creation_id = :loaded_creation_id, ""map_tile_ID"" = :TerrainImageID, 1433""Sandbox"" = :Sandbox, loaded_creation_datetime = :loaded_creation_datetime, loaded_creation_id = :loaded_creation_id, ""map_tile_ID"" = :TerrainImageID,
1434""TelehubObject"" = :telehubobject, ""parcel_tile_ID"" = :ParcelImageID 1434""TelehubObject"" = :telehubobject, ""parcel_tile_ID"" = :ParcelImageID
1435 WHERE ""regionUUID"" = :regionUUID"; 1435 WHERE ""regionUUID"" = :regionUUID";
1436 1436
@@ -1465,13 +1465,13 @@ namespace OpenSim.Data.PGSQL
1465 elevation_2_ne,elevation_1_se,elevation_2_se,elevation_1_sw,elevation_2_sw,water_height,terrain_raise_limit, 1465 elevation_2_ne,elevation_1_se,elevation_2_se,elevation_1_sw,elevation_2_sw,water_height,terrain_raise_limit,
1466 terrain_lower_limit,use_estate_sun,fixed_sun,sun_position,covenant,covenant_datetime,sunvectorx, sunvectory, sunvectorz, 1466 terrain_lower_limit,use_estate_sun,fixed_sun,sun_position,covenant,covenant_datetime,sunvectorx, sunvectory, sunvectorz,
1467 ""Sandbox"", loaded_creation_datetime, loaded_creation_id 1467 ""Sandbox"", loaded_creation_datetime, loaded_creation_id
1468 ) 1468 )
1469 VALUES 1469 VALUES
1470 (:regionUUID,:block_terraform,:block_fly,:allow_damage,:restrict_pushing,:allow_land_resell,:allow_land_join_divide, 1470 (:regionUUID,:block_terraform,:block_fly,:allow_damage,:restrict_pushing,:allow_land_resell,:allow_land_join_divide,
1471 :block_show_in_search,:agent_limit,:object_bonus,:maturity,:disable_scripts,:disable_collisions,:disable_physics, 1471 :block_show_in_search,:agent_limit,:object_bonus,:maturity,:disable_scripts,:disable_collisions,:disable_physics,
1472 :terrain_texture_1,:terrain_texture_2,:terrain_texture_3,:terrain_texture_4,:elevation_1_nw,:elevation_2_nw,:elevation_1_ne, 1472 :terrain_texture_1,:terrain_texture_2,:terrain_texture_3,:terrain_texture_4,:elevation_1_nw,:elevation_2_nw,:elevation_1_ne,
1473 :elevation_2_ne,:elevation_1_se,:elevation_2_se,:elevation_1_sw,:elevation_2_sw,:water_height,:terrain_raise_limit, 1473 :elevation_2_ne,:elevation_1_se,:elevation_2_se,:elevation_1_sw,:elevation_2_sw,:water_height,:terrain_raise_limit,
1474 :terrain_lower_limit,:use_estate_sun,:fixed_sun,:sun_position,:covenant, :covenant_datetime, :sunvectorx,:sunvectory, 1474 :terrain_lower_limit,:use_estate_sun,:fixed_sun,:sun_position,:covenant, :covenant_datetime, :sunvectorx,:sunvectory,
1475 :sunvectorz, :Sandbox, :loaded_creation_datetime, :loaded_creation_id )"; 1475 :sunvectorz, :Sandbox, :loaded_creation_datetime, :loaded_creation_id )";
1476 1476
1477 using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString)) 1477 using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
@@ -1626,7 +1626,7 @@ namespace OpenSim.Data.PGSQL
1626 newData.MediaLoop = Convert.ToBoolean(row["MediaLoop"]); 1626 newData.MediaLoop = Convert.ToBoolean(row["MediaLoop"]);
1627 newData.ObscureMusic = Convert.ToBoolean(row["ObscureMusic"]); 1627 newData.ObscureMusic = Convert.ToBoolean(row["ObscureMusic"]);
1628 newData.ObscureMedia = Convert.ToBoolean(row["ObscureMedia"]); 1628 newData.ObscureMedia = Convert.ToBoolean(row["ObscureMedia"]);
1629 1629
1630 newData.SeeAVs = Convert.ToBoolean(row["SeeAVs"]); 1630 newData.SeeAVs = Convert.ToBoolean(row["SeeAVs"]);
1631 newData.AnyAVSounds = Convert.ToBoolean(row["AnyAVSounds"]); 1631 newData.AnyAVSounds = Convert.ToBoolean(row["AnyAVSounds"]);
1632 newData.GroupAVSounds = Convert.ToBoolean(row["GroupAVSounds"]); 1632 newData.GroupAVSounds = Convert.ToBoolean(row["GroupAVSounds"]);
@@ -1789,7 +1789,7 @@ namespace OpenSim.Data.PGSQL
1789 if (!(primRow["DynAttrs"] is System.DBNull) && (string)primRow["DynAttrs"] != "") 1789 if (!(primRow["DynAttrs"] is System.DBNull) && (string)primRow["DynAttrs"] != "")
1790 prim.DynAttrs = DAMap.FromXml((string)primRow["DynAttrs"]); 1790 prim.DynAttrs = DAMap.FromXml((string)primRow["DynAttrs"]);
1791 else 1791 else
1792 prim.DynAttrs = new DAMap(); 1792 prim.DynAttrs = new DAMap();
1793 1793
1794 prim.PhysicsShapeType = Convert.ToByte(primRow["PhysicsShapeType"]); 1794 prim.PhysicsShapeType = Convert.ToByte(primRow["PhysicsShapeType"]);
1795 prim.Density = Convert.ToSingle(primRow["Density"]); 1795 prim.Density = Convert.ToSingle(primRow["Density"]);
@@ -2195,17 +2195,17 @@ namespace OpenSim.Data.PGSQL
2195 2195
2196 parameters.Add(_Database.CreateParameter("CollisionSound", prim.CollisionSound)); 2196 parameters.Add(_Database.CreateParameter("CollisionSound", prim.CollisionSound));
2197 parameters.Add(_Database.CreateParameter("CollisionSoundVolume", prim.CollisionSoundVolume)); 2197 parameters.Add(_Database.CreateParameter("CollisionSoundVolume", prim.CollisionSoundVolume));
2198 2198
2199 parameters.Add(_Database.CreateParameter("PassTouches", prim.PassTouches)); 2199 parameters.Add(_Database.CreateParameter("PassTouches", prim.PassTouches));
2200 2200
2201 parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum)); 2201 parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum));
2202 parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl)); 2202 parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl));
2203 2203
2204 if (prim.DynAttrs.CountNamespaces > 0) 2204 if (prim.DynAttrs.CountNamespaces > 0)
2205 parameters.Add(_Database.CreateParameter("DynAttrs", prim.DynAttrs.ToXml())); 2205 parameters.Add(_Database.CreateParameter("DynAttrs", prim.DynAttrs.ToXml()));
2206 else 2206 else
2207 parameters.Add(_Database.CreateParameter("DynAttrs", null)); 2207 parameters.Add(_Database.CreateParameter("DynAttrs", null));
2208 2208
2209 parameters.Add(_Database.CreateParameter("PhysicsShapeType", prim.PhysicsShapeType)); 2209 parameters.Add(_Database.CreateParameter("PhysicsShapeType", prim.PhysicsShapeType));
2210 parameters.Add(_Database.CreateParameter("Density", (double)prim.Density)); 2210 parameters.Add(_Database.CreateParameter("Density", (double)prim.Density));
2211 parameters.Add(_Database.CreateParameter("GravityModifier", (double)prim.GravityModifier)); 2211 parameters.Add(_Database.CreateParameter("GravityModifier", (double)prim.GravityModifier));
diff --git a/OpenSim/Data/PGSQL/PGSQLUserAccountData.cs b/OpenSim/Data/PGSQL/PGSQLUserAccountData.cs
index a2b5a2a..64cfff0 100644
--- a/OpenSim/Data/PGSQL/PGSQLUserAccountData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLUserAccountData.cs
@@ -42,13 +42,13 @@ namespace OpenSim.Data.PGSQL
42 { 42 {
43 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 43 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
44 44
45 45
46 public PGSQLUserAccountData(string connectionString, string realm) : 46 public PGSQLUserAccountData(string connectionString, string realm) :
47 base(connectionString, realm, "UserAccount") 47 base(connectionString, realm, "UserAccount")
48 { 48 {
49 } 49 }
50 50
51 /* 51 /*
52 private string m_Realm; 52 private string m_Realm;
53 private List<string> m_ColumnNames = null; 53 private List<string> m_ColumnNames = null;
54 private PGSQLManager m_database; 54 private PGSQLManager m_database;
@@ -122,7 +122,7 @@ namespace OpenSim.Data.PGSQL
122 { 122 {
123 cmd.Parameters.Add(m_database.CreateParameter("principalID", principalID)); 123 cmd.Parameters.Add(m_database.CreateParameter("principalID", principalID));
124 cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID)); 124 cmd.Parameters.Add(m_database.CreateParameter("scopeID", scopeID));
125 125
126 conn.Open(); 126 conn.Open();
127 using (NpgsqlDataReader result = cmd.ExecuteReader()) 127 using (NpgsqlDataReader result = cmd.ExecuteReader())
128 { 128 {
@@ -158,8 +158,8 @@ namespace OpenSim.Data.PGSQL
158 } 158 }
159 return null; 159 return null;
160 } 160 }
161 161
162 162
163 public override bool Store(UserAccountData data) 163 public override bool Store(UserAccountData data)
164 { 164 {
165 if (data.Data.ContainsKey("PrincipalID")) 165 if (data.Data.ContainsKey("PrincipalID"))
@@ -214,7 +214,7 @@ namespace OpenSim.Data.PGSQL
214 catch (Exception e){ 214 catch (Exception e){
215 m_log.ErrorFormat("[USER]: ERROR opened update user {0} ", e.Message); 215 m_log.ErrorFormat("[USER]: ERROR opened update user {0} ", e.Message);
216 } 216 }
217 217
218 218
219 if (conta < 1) 219 if (conta < 1)
220 { 220 {
@@ -242,14 +242,14 @@ namespace OpenSim.Data.PGSQL
242 } 242 }
243 return true; 243 return true;
244 } 244 }
245 245
246 246
247 public bool Store(UserAccountData data, UUID principalID, string token) 247 public bool Store(UserAccountData data, UUID principalID, string token)
248 { 248 {
249 return false; 249 return false;
250 } 250 }
251 251
252 252
253 public bool SetDataItem(UUID principalID, string item, string value) 253 public bool SetDataItem(UUID principalID, string item, string value)
254 { 254 {
255 string sql = string.Format(@"update {0} set {1} = :{1} where ""UUID"" = :UUID", m_Realm, item); 255 string sql = string.Format(@"update {0} set {1} = :{1} where ""UUID"" = :UUID", m_Realm, item);
@@ -299,7 +299,7 @@ namespace OpenSim.Data.PGSQL
299 299
300 string sql = ""; 300 string sql = "";
301 UUID scope_id; 301 UUID scope_id;
302 UUID.TryParse(scopeID.ToString(), out scope_id); 302 UUID.TryParse(scopeID.ToString(), out scope_id);
303 303
304 using (NpgsqlConnection conn = new NpgsqlConnection(m_ConnectionString)) 304 using (NpgsqlConnection conn = new NpgsqlConnection(m_ConnectionString))
305 using (NpgsqlCommand cmd = new NpgsqlCommand()) 305 using (NpgsqlCommand cmd = new NpgsqlCommand())
diff --git a/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs b/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs
index f166976..75a51e2 100644
--- a/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs
@@ -412,15 +412,15 @@ namespace OpenSim.Data.PGSQL
412 query = @"WITH upsert AS ( 412 query = @"WITH upsert AS (
413 UPDATE userpicks SET 413 UPDATE userpicks SET
414 pickuuid = :PickId, creatoruuid = :CreatorId, toppick = :TopPick, parceluuid = :ParcelId, 414 pickuuid = :PickId, creatoruuid = :CreatorId, toppick = :TopPick, parceluuid = :ParcelId,
415 name = :Name, description = :Desc, snapshotuuid = :SnapshotId, ""user"" = :User, 415 name = :Name, description = :Desc, snapshotuuid = :SnapshotId, ""user"" = :User,
416 originalname = :Original, simname = :SimName, posglobal = :GlobalPos, 416 originalname = :Original, simname = :SimName, posglobal = :GlobalPos,
417 sortorder = :SortOrder, enabled = :Enabled 417 sortorder = :SortOrder, enabled = :Enabled
418 RETURNING * ) 418 RETURNING * )
419 INSERT INTO userpicks (pickuuid,creatoruuid,toppick,parceluuid,name,description, 419 INSERT INTO userpicks (pickuuid,creatoruuid,toppick,parceluuid,name,description,
420 snapshotuuid,""user"",originalname,simname,posglobal,sortorder,enabled) 420 snapshotuuid,""user"",originalname,simname,posglobal,sortorder,enabled)
421 SELECT 421 SELECT
422 :PickId,:CreatorId,:TopPick,:ParcelId,:Name,:Desc,:SnapshotId,:User, 422 :PickId,:CreatorId,:TopPick,:ParcelId,:Name,:Desc,:SnapshotId,:User,
423 :Original,:SimName,:GlobalPos,:SortOrder,:Enabled 423 :Original,:SimName,:GlobalPos,:SortOrder,:Enabled
424 WHERE NOT EXISTS ( 424 WHERE NOT EXISTS (
425 SELECT * FROM upsert )"; 425 SELECT * FROM upsert )";
426 426
diff --git a/OpenSim/Data/PGSQL/PGSQLXAssetData.cs b/OpenSim/Data/PGSQL/PGSQLXAssetData.cs
index d3518cf..6e88489 100644
--- a/OpenSim/Data/PGSQL/PGSQLXAssetData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLXAssetData.cs
@@ -141,7 +141,7 @@ namespace OpenSim.Data.PGSQL
141 141
142 using (NpgsqlCommand cmd = new NpgsqlCommand( 142 using (NpgsqlCommand cmd = new NpgsqlCommand(
143 @"SELECT name, description, access_time, ""AssetType"", local, temporary, asset_flags, creatorid, data 143 @"SELECT name, description, access_time, ""AssetType"", local, temporary, asset_flags, creatorid, data
144 FROM XAssetsMeta 144 FROM XAssetsMeta
145 JOIN XAssetsData ON XAssetsMeta.hash = XAssetsData.Hash WHERE id=:ID", 145 JOIN XAssetsData ON XAssetsMeta.hash = XAssetsData.Hash WHERE id=:ID",
146 dbcon)) 146 dbcon))
147 { 147 {
@@ -179,7 +179,7 @@ namespace OpenSim.Data.PGSQL
179 WebUtil.CopyStream(decompressionStream, outputStream, int.MaxValue); 179 WebUtil.CopyStream(decompressionStream, outputStream, int.MaxValue);
180 // int compressedLength = asset.Data.Length; 180 // int compressedLength = asset.Data.Length;
181 asset.Data = outputStream.ToArray(); 181 asset.Data = outputStream.ToArray();
182 182
183 // m_log.DebugFormat( 183 // m_log.DebugFormat(
184 // "[XASSET DB]: Decompressed {0} {1} to {2} bytes from {3}", 184 // "[XASSET DB]: Decompressed {0} {1} to {2} bytes from {3}",
185 // asset.ID, asset.Name, asset.Data.Length, compressedLength); 185 // asset.ID, asset.Name, asset.Data.Length, compressedLength);
@@ -223,16 +223,16 @@ namespace OpenSim.Data.PGSQL
223 { 223 {
224 assetName = asset.Name.Substring(0, 64); 224 assetName = asset.Name.Substring(0, 64);
225 m_log.WarnFormat( 225 m_log.WarnFormat(
226 "[XASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add", 226 "[XASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add",
227 asset.Name, asset.ID, asset.Name.Length, assetName.Length); 227 asset.Name, asset.ID, asset.Name.Length, assetName.Length);
228 } 228 }
229 229
230 string assetDescription = asset.Description; 230 string assetDescription = asset.Description;
231 if (asset.Description.Length > 64) 231 if (asset.Description.Length > 64)
232 { 232 {
233 assetDescription = asset.Description.Substring(0, 64); 233 assetDescription = asset.Description.Substring(0, 64);
234 m_log.WarnFormat( 234 m_log.WarnFormat(
235 "[XASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add", 235 "[XASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add",
236 asset.Description, asset.ID, asset.Description.Length, assetDescription.Length); 236 asset.Description, asset.ID, asset.Description.Length, assetDescription.Length);
237 } 237 }
238 238
@@ -268,8 +268,8 @@ namespace OpenSim.Data.PGSQL
268 where not exists( Select id from XAssetsMeta where id = :ID); 268 where not exists( Select id from XAssetsMeta where id = :ID);
269 269
270 update XAssetsMeta 270 update XAssetsMeta
271 set id = :ID, hash = :Hash, name = :Name, description = :Description, 271 set id = :ID, hash = :Hash, name = :Name, description = :Description,
272 ""AssetType"" = :AssetType, local = :Local, temporary = :Temporary, create_time = :CreateTime, 272 ""AssetType"" = :AssetType, local = :Local, temporary = :Temporary, create_time = :CreateTime,
273 access_time = :AccessTime, asset_flags = :AssetFlags, creatorid = :CreatorID 273 access_time = :AccessTime, asset_flags = :AssetFlags, creatorid = :CreatorID
274 where id = :ID; 274 where id = :ID;
275 ", 275 ",
@@ -321,13 +321,13 @@ namespace OpenSim.Data.PGSQL
321 { 321 {
322 m_log.ErrorFormat("[XASSET DB]: PGSQL failure creating asset data {0} with name \"{1}\". Error: {2}", 322 m_log.ErrorFormat("[XASSET DB]: PGSQL failure creating asset data {0} with name \"{1}\". Error: {2}",
323 asset.FullID, asset.Name, e.Message); 323 asset.FullID, asset.Name, e.Message);
324 324
325 transaction.Rollback(); 325 transaction.Rollback();
326 326
327 return; 327 return;
328 } 328 }
329 } 329 }
330 330
331 transaction.Commit(); 331 transaction.Commit();
332 } 332 }
333 } 333 }
@@ -374,7 +374,7 @@ namespace OpenSim.Data.PGSQL
374 catch (Exception e) 374 catch (Exception e)
375 { 375 {
376 m_log.ErrorFormat( 376 m_log.ErrorFormat(
377 "[XASSET PGSQL DB]: Failure updating access_time for asset {0} with name {1} : {2}", 377 "[XASSET PGSQL DB]: Failure updating access_time for asset {0} with name {1} : {2}",
378 assetMetadata.ID, assetMetadata.Name, e.Message); 378 assetMetadata.ID, assetMetadata.Name, e.Message);
379 } 379 }
380 } 380 }
@@ -519,7 +519,7 @@ namespace OpenSim.Data.PGSQL
519 { 519 {
520 dbcon.Open(); 520 dbcon.Open();
521 using(NpgsqlCommand cmd = new NpgsqlCommand(@"SELECT name, description, access_time, ""AssetType"", temporary, id, asset_flags, creatorid 521 using(NpgsqlCommand cmd = new NpgsqlCommand(@"SELECT name, description, access_time, ""AssetType"", temporary, id, asset_flags, creatorid
522 FROM XAssetsMeta 522 FROM XAssetsMeta
523 LIMIT :start, :count",dbcon)) 523 LIMIT :start, :count",dbcon))
524 { 524 {
525 cmd.Parameters.Add(m_database.CreateParameter("start",start)); 525 cmd.Parameters.Add(m_database.CreateParameter("start",start));
diff --git a/OpenSim/Data/PGSQL/PGSQLXInventoryData.cs b/OpenSim/Data/PGSQL/PGSQLXInventoryData.cs
index 959c2cf..55a1996 100644
--- a/OpenSim/Data/PGSQL/PGSQLXInventoryData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLXInventoryData.cs
@@ -197,16 +197,16 @@ namespace OpenSim.Data.PGSQL
197 using (NpgsqlCommand cmd = new NpgsqlCommand()) 197 using (NpgsqlCommand cmd = new NpgsqlCommand())
198 { 198 {
199/* 199/*
200 cmd.CommandText = String.Format(@"select bit_or(""inventoryCurrentPermissions"") as ""inventoryCurrentPermissions"" 200 cmd.CommandText = String.Format(@"select bit_or(""inventoryCurrentPermissions"") as ""inventoryCurrentPermissions""
201 from inventoryitems 201 from inventoryitems
202 where ""avatarID"" = :PrincipalID 202 where ""avatarID"" = :PrincipalID
203 and ""assetID"" = :AssetID 203 and ""assetID"" = :AssetID
204 group by ""assetID"" ", m_Realm); 204 group by ""assetID"" ", m_Realm);
205*/ 205*/
206 cmd.CommandText = String.Format(@"select bit_or(""inventoryCurrentPermissions"") as ""inventoryCurrentPermissions"" 206 cmd.CommandText = String.Format(@"select bit_or(""inventoryCurrentPermissions"") as ""inventoryCurrentPermissions""
207 from inventoryitems 207 from inventoryitems
208 where ""avatarID""::uuid = :PrincipalID 208 where ""avatarID""::uuid = :PrincipalID
209 and ""assetID"" = :AssetID 209 and ""assetID"" = :AssetID
210 group by ""assetID"" "); 210 group by ""assetID"" ");
211 211
212 cmd.Parameters.Add(m_database.CreateParameter("PrincipalID", principalID)); 212 cmd.Parameters.Add(m_database.CreateParameter("PrincipalID", principalID));
diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs
index 9c2bd2e..966d0b8 100644
--- a/OpenSim/Data/SQLite/SQLiteAssetData.cs
+++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs
@@ -138,7 +138,7 @@ namespace OpenSim.Data.SQLite
138 { 138 {
139 assetName = asset.Name.Substring(0, AssetBase.MAX_ASSET_NAME); 139 assetName = asset.Name.Substring(0, AssetBase.MAX_ASSET_NAME);
140 m_log.WarnFormat( 140 m_log.WarnFormat(
141 "[ASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add", 141 "[ASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add",
142 asset.Name, asset.ID, asset.Name.Length, assetName.Length); 142 asset.Name, asset.ID, asset.Name.Length, assetName.Length);
143 } 143 }
144 144
@@ -147,7 +147,7 @@ namespace OpenSim.Data.SQLite
147 { 147 {
148 assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC); 148 assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC);
149 m_log.WarnFormat( 149 m_log.WarnFormat(
150 "[ASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add", 150 "[ASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add",
151 asset.Description, asset.ID, asset.Description.Length, assetDescription.Length); 151 asset.Description, asset.ID, asset.Description.Length, assetDescription.Length);
152 } 152 }
153 153
diff --git a/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs b/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs
index 0428c11..8fb955c 100644
--- a/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs
+++ b/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs
@@ -45,7 +45,7 @@ namespace OpenSim.Data.SQLite
45 public class SQLiteAuthenticationData : SQLiteFramework, IAuthenticationData 45 public class SQLiteAuthenticationData : SQLiteFramework, IAuthenticationData
46 { 46 {
47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 48
49 private string m_Realm; 49 private string m_Realm;
50 private List<string> m_ColumnNames; 50 private List<string> m_ColumnNames;
51 private int m_LastExpire; 51 private int m_LastExpire;
@@ -223,7 +223,7 @@ namespace OpenSim.Data.SQLite
223 if (System.Environment.TickCount - m_LastExpire > 30000) 223 if (System.Environment.TickCount - m_LastExpire > 30000)
224 DoExpire(); 224 DoExpire();
225 225
226 using (SqliteCommand cmd = new SqliteCommand("insert into tokens (UUID, token, validity) values ('" + principalID.ToString() + 226 using (SqliteCommand cmd = new SqliteCommand("insert into tokens (UUID, token, validity) values ('" + principalID.ToString() +
227 "', '" + token + "', datetime('now', 'localtime', '+" + lifetime.ToString() + " minutes'))")) 227 "', '" + token + "', datetime('now', 'localtime', '+" + lifetime.ToString() + " minutes'))"))
228 { 228 {
229 if (ExecuteNonQuery(cmd, m_Connection) > 0) 229 if (ExecuteNonQuery(cmd, m_Connection) > 0)
@@ -238,7 +238,7 @@ namespace OpenSim.Data.SQLite
238 if (System.Environment.TickCount - m_LastExpire > 30000) 238 if (System.Environment.TickCount - m_LastExpire > 30000)
239 DoExpire(); 239 DoExpire();
240 240
241 using (SqliteCommand cmd = new SqliteCommand("update tokens set validity = datetime('now', 'localtime', '+" + lifetime.ToString() + 241 using (SqliteCommand cmd = new SqliteCommand("update tokens set validity = datetime('now', 'localtime', '+" + lifetime.ToString() +
242 " minutes') where UUID = '" + principalID.ToString() + "' and token = '" + token + "' and validity > datetime('now', 'localtime')")) 242 " minutes') where UUID = '" + principalID.ToString() + "' and token = '" + token + "' and validity > datetime('now', 'localtime')"))
243 { 243 {
244 if (ExecuteNonQuery(cmd, m_Connection) > 0) 244 if (ExecuteNonQuery(cmd, m_Connection) > 0)
diff --git a/OpenSim/Data/SQLite/SQLiteEstateData.cs b/OpenSim/Data/SQLite/SQLiteEstateData.cs
index d51f2d4..0fcab21 100644
--- a/OpenSim/Data/SQLite/SQLiteEstateData.cs
+++ b/OpenSim/Data/SQLite/SQLiteEstateData.cs
@@ -190,7 +190,7 @@ namespace OpenSim.Data.SQLite
190 IDataReader r = null; 190 IDataReader r = null;
191 191
192 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) 192 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
193 { 193 {
194 names.Remove("EstateID"); 194 names.Remove("EstateID");
195 195
196 string sql = "insert into estate_settings ("+String.Join(",", names.ToArray())+") values ( :"+String.Join(", :", names.ToArray())+")"; 196 string sql = "insert into estate_settings ("+String.Join(",", names.ToArray())+") values ( :"+String.Join(", :", names.ToArray())+")";
@@ -386,15 +386,15 @@ namespace OpenSim.Data.SQLite
386 return DoLoad(cmd, UUID.Zero, false); 386 return DoLoad(cmd, UUID.Zero, false);
387 } 387 }
388 } 388 }
389 389
390 public List<EstateSettings> LoadEstateSettingsAll() 390 public List<EstateSettings> LoadEstateSettingsAll()
391 { 391 {
392 List<EstateSettings> estateSettings = new List<EstateSettings>(); 392 List<EstateSettings> estateSettings = new List<EstateSettings>();
393 393
394 List<int> estateIds = GetEstatesAll(); 394 List<int> estateIds = GetEstatesAll();
395 foreach (int estateId in estateIds) 395 foreach (int estateId in estateIds)
396 estateSettings.Add(LoadEstateSettings(estateId)); 396 estateSettings.Add(LoadEstateSettings(estateId));
397 397
398 return estateSettings; 398 return estateSettings;
399 } 399 }
400 400
@@ -421,7 +421,7 @@ namespace OpenSim.Data.SQLite
421 421
422 return result; 422 return result;
423 } 423 }
424 424
425 public List<int> GetEstatesAll() 425 public List<int> GetEstatesAll()
426 { 426 {
427 List<int> result = new List<int>(); 427 List<int> result = new List<int>();
@@ -442,7 +442,7 @@ namespace OpenSim.Data.SQLite
442 } 442 }
443 r.Close(); 443 r.Close();
444 444
445 return result; 445 return result;
446 } 446 }
447 447
448 public List<int> GetEstatesByOwner(UUID ownerID) 448 public List<int> GetEstatesByOwner(UUID ownerID)
diff --git a/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs b/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs
index 9fbeb10..a4b84b1 100644
--- a/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs
+++ b/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs
@@ -189,7 +189,7 @@ namespace OpenSim.Data.SQLite
189 m_Fields[name].SetValue(row, reader[name]); 189 m_Fields[name].SetValue(row, reader[name]);
190 } 190 }
191 } 191 }
192 192
193 if (m_DataField != null) 193 if (m_DataField != null)
194 { 194 {
195 Dictionary<string, string> data = 195 Dictionary<string, string> data =
@@ -268,7 +268,7 @@ namespace OpenSim.Data.SQLite
268 public virtual bool Delete(string field, string key) 268 public virtual bool Delete(string field, string key)
269 { 269 {
270 return Delete(new string[] { field }, new string[] { key }); 270 return Delete(new string[] { field }, new string[] { key });
271 } 271 }
272 272
273 public virtual bool Delete(string[] fields, string[] keys) 273 public virtual bool Delete(string[] fields, string[] keys)
274 { 274 {
diff --git a/OpenSim/Data/SQLite/SQLiteGridUserData.cs b/OpenSim/Data/SQLite/SQLiteGridUserData.cs
index d8c52f8..987240c 100644
--- a/OpenSim/Data/SQLite/SQLiteGridUserData.cs
+++ b/OpenSim/Data/SQLite/SQLiteGridUserData.cs
@@ -43,7 +43,7 @@ namespace OpenSim.Data.SQLite
43 { 43 {
44// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 44// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
45 45
46 public SQLiteGridUserData(string connectionString, string realm) 46 public SQLiteGridUserData(string connectionString, string realm)
47 : base(connectionString, realm, "GridUserStore") {} 47 : base(connectionString, realm, "GridUserStore") {}
48 48
49 public new GridUserData Get(string userID) 49 public new GridUserData Get(string userID)
diff --git a/OpenSim/Data/SQLite/SQLiteHGTravelData.cs b/OpenSim/Data/SQLite/SQLiteHGTravelData.cs
index db288b2..dd34710 100644
--- a/OpenSim/Data/SQLite/SQLiteHGTravelData.cs
+++ b/OpenSim/Data/SQLite/SQLiteHGTravelData.cs
@@ -44,7 +44,7 @@ namespace OpenSim.Data.SQLite
44 { 44 {
45// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 45// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46 46
47 public SQLiteHGTravelData(string connectionString, string realm) 47 public SQLiteHGTravelData(string connectionString, string realm)
48 : base(connectionString, realm, "HGTravelStore") {} 48 : base(connectionString, realm, "HGTravelStore") {}
49 49
50 public HGTravelingData Get(UUID sessionID) 50 public HGTravelingData Get(UUID sessionID)
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
index 5cfc202..eec386f 100644
--- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs
+++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
@@ -707,7 +707,7 @@ namespace OpenSim.Data.SQLite
707 DataRow[] primsForRegion = prims.Select(byRegion); 707 DataRow[] primsForRegion = prims.Select(byRegion);
708// m_log.Info("[SQLITE REGION DB]: Loaded " + primsForRegion.Length + " prims for region: " + regionUUID); 708// m_log.Info("[SQLITE REGION DB]: Loaded " + primsForRegion.Length + " prims for region: " + regionUUID);
709 709
710 // First, create all groups 710 // First, create all groups
711 foreach (DataRow primRow in primsForRegion) 711 foreach (DataRow primRow in primsForRegion)
712 { 712 {
713 try 713 try
@@ -733,12 +733,12 @@ namespace OpenSim.Data.SQLite
733 } 733 }
734 734
735 SceneObjectGroup group = new SceneObjectGroup(prim); 735 SceneObjectGroup group = new SceneObjectGroup(prim);
736 736
737 createdObjects.Add(group.UUID, group); 737 createdObjects.Add(group.UUID, group);
738 retvals.Add(group); 738 retvals.Add(group);
739 LoadItems(prim); 739 LoadItems(prim);
740 740
741 741
742 } 742 }
743 } 743 }
744 catch (Exception e) 744 catch (Exception e)
@@ -1298,7 +1298,7 @@ namespace OpenSim.Data.SQLite
1298 createCol(prims, "VolumeDetect", typeof(Int16)); 1298 createCol(prims, "VolumeDetect", typeof(Int16));
1299 1299
1300 createCol(prims, "MediaURL", typeof(String)); 1300 createCol(prims, "MediaURL", typeof(String));
1301 1301
1302 createCol(prims, "AttachedPosX", typeof(Double)); 1302 createCol(prims, "AttachedPosX", typeof(Double));
1303 createCol(prims, "AttachedPosY", typeof(Double)); 1303 createCol(prims, "AttachedPosY", typeof(Double));
1304 createCol(prims, "AttachedPosZ", typeof(Double)); 1304 createCol(prims, "AttachedPosZ", typeof(Double));
@@ -1795,7 +1795,7 @@ namespace OpenSim.Data.SQLite
1795// m_log.DebugFormat("[SQLITE]: MediaUrl type [{0}]", row["MediaURL"].GetType()); 1795// m_log.DebugFormat("[SQLITE]: MediaUrl type [{0}]", row["MediaURL"].GetType());
1796 prim.MediaUrl = (string)row["MediaURL"]; 1796 prim.MediaUrl = (string)row["MediaURL"];
1797 } 1797 }
1798 1798
1799 prim.AttachedPos = new Vector3( 1799 prim.AttachedPos = new Vector3(
1800 Convert.ToSingle(row["AttachedPosX"]), 1800 Convert.ToSingle(row["AttachedPosX"]),
1801 Convert.ToSingle(row["AttachedPosY"]), 1801 Convert.ToSingle(row["AttachedPosY"]),
@@ -1806,7 +1806,7 @@ namespace OpenSim.Data.SQLite
1806 { 1806 {
1807 //m_log.DebugFormat("[SQLITE]: DynAttrs type [{0}]", row["DynAttrs"].GetType()); 1807 //m_log.DebugFormat("[SQLITE]: DynAttrs type [{0}]", row["DynAttrs"].GetType());
1808 prim.DynAttrs = DAMap.FromXml((string)row["DynAttrs"]); 1808 prim.DynAttrs = DAMap.FromXml((string)row["DynAttrs"]);
1809 } 1809 }
1810 else 1810 else
1811 { 1811 {
1812 prim.DynAttrs = new DAMap(); 1812 prim.DynAttrs = new DAMap();
@@ -1818,7 +1818,7 @@ namespace OpenSim.Data.SQLite
1818 prim.Friction = Convert.ToSingle(row["Friction"]); 1818 prim.Friction = Convert.ToSingle(row["Friction"]);
1819 prim.Restitution = Convert.ToSingle(row["Restitution"]); 1819 prim.Restitution = Convert.ToSingle(row["Restitution"]);
1820 1820
1821 1821
1822 if (!(row["KeyframeMotion"] is DBNull)) 1822 if (!(row["KeyframeMotion"] is DBNull))
1823 { 1823 {
1824 Byte[] data = (byte[])row["KeyframeMotion"]; 1824 Byte[] data = (byte[])row["KeyframeMotion"];
@@ -2532,7 +2532,7 @@ namespace OpenSim.Data.SQLite
2532 2532
2533 if (!(row["Media"] is System.DBNull)) 2533 if (!(row["Media"] is System.DBNull))
2534 s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]); 2534 s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]);
2535 2535
2536 return s; 2536 return s;
2537 } 2537 }
2538 2538
diff --git a/OpenSim/Data/SQLite/SQLiteUserAccountData.cs b/OpenSim/Data/SQLite/SQLiteUserAccountData.cs
index 91d62ce..1b79185 100644
--- a/OpenSim/Data/SQLite/SQLiteUserAccountData.cs
+++ b/OpenSim/Data/SQLite/SQLiteUserAccountData.cs
@@ -75,7 +75,7 @@ namespace OpenSim.Data.SQLite
75 } 75 }
76 else 76 else
77 { 77 {
78 cmd.CommandText = String.Format("select * from {0} where (ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{3}%')", 78 cmd.CommandText = String.Format("select * from {0} where (ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{3}%')",
79 m_Realm, scopeID.ToString(), words[0], words[1]); 79 m_Realm, scopeID.ToString(), words[0], words[1]);
80 } 80 }
81 81
diff --git a/OpenSim/Data/SQLite/SQLiteUserProfilesData.cs b/OpenSim/Data/SQLite/SQLiteUserProfilesData.cs
index 2dfdba3..13aac79 100644
--- a/OpenSim/Data/SQLite/SQLiteUserProfilesData.cs
+++ b/OpenSim/Data/SQLite/SQLiteUserProfilesData.cs
@@ -46,43 +46,43 @@ namespace OpenSim.Data.SQLite
46 { 46 {
47 private static readonly ILog m_log = 47 private static readonly ILog m_log =
48 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 48 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
49 49
50 private SqliteConnection m_connection; 50 private SqliteConnection m_connection;
51 private string m_connectionString; 51 private string m_connectionString;
52 52
53 private Dictionary<string, FieldInfo> m_FieldMap = 53 private Dictionary<string, FieldInfo> m_FieldMap =
54 new Dictionary<string, FieldInfo>(); 54 new Dictionary<string, FieldInfo>();
55 55
56 protected virtual Assembly Assembly 56 protected virtual Assembly Assembly
57 { 57 {
58 get { return GetType().Assembly; } 58 get { return GetType().Assembly; }
59 } 59 }
60 60
61 public SQLiteUserProfilesData() 61 public SQLiteUserProfilesData()
62 { 62 {
63 } 63 }
64 64
65 public SQLiteUserProfilesData(string connectionString) 65 public SQLiteUserProfilesData(string connectionString)
66 { 66 {
67 Initialise(connectionString); 67 Initialise(connectionString);
68 } 68 }
69 69
70 public void Initialise(string connectionString) 70 public void Initialise(string connectionString)
71 { 71 {
72 if (Util.IsWindows()) 72 if (Util.IsWindows())
73 Util.LoadArchSpecificWindowsDll("sqlite3.dll"); 73 Util.LoadArchSpecificWindowsDll("sqlite3.dll");
74 74
75 m_connectionString = connectionString; 75 m_connectionString = connectionString;
76 76
77 m_log.Info("[PROFILES_DATA]: Sqlite - connecting: "+m_connectionString); 77 m_log.Info("[PROFILES_DATA]: Sqlite - connecting: "+m_connectionString);
78 78
79 m_connection = new SqliteConnection(m_connectionString); 79 m_connection = new SqliteConnection(m_connectionString);
80 m_connection.Open(); 80 m_connection.Open();
81 81
82 Migration m = new Migration(m_connection, Assembly, "UserProfiles"); 82 Migration m = new Migration(m_connection, Assembly, "UserProfiles");
83 m.Update(); 83 m.Update();
84 } 84 }
85 85
86 private string[] FieldList 86 private string[] FieldList
87 { 87 {
88 get { return new List<string>(m_FieldMap.Keys).ToArray(); } 88 get { return new List<string>(m_FieldMap.Keys).ToArray(); }
@@ -123,7 +123,7 @@ namespace OpenSim.Data.SQLite
123 } 123 }
124 124
125 reader.Close(); 125 reader.Close();
126 126
127 return data; 127 return data;
128 } 128 }
129 public bool UpdateClassifiedRecord(UserClassifiedAdd ad, ref string result) 129 public bool UpdateClassifiedRecord(UserClassifiedAdd ad, ref string result)
@@ -162,21 +162,21 @@ namespace OpenSim.Data.SQLite
162 query += ":ParcelName,"; 162 query += ":ParcelName,";
163 query += ":Flags,"; 163 query += ":Flags,";
164 query += ":ListingPrice ) "; 164 query += ":ListingPrice ) ";
165 165
166 if(string.IsNullOrEmpty(ad.ParcelName)) 166 if(string.IsNullOrEmpty(ad.ParcelName))
167 ad.ParcelName = "Unknown"; 167 ad.ParcelName = "Unknown";
168 if(ad.ParcelId == null) 168 if(ad.ParcelId == null)
169 ad.ParcelId = UUID.Zero; 169 ad.ParcelId = UUID.Zero;
170 if(string.IsNullOrEmpty(ad.Description)) 170 if(string.IsNullOrEmpty(ad.Description))
171 ad.Description = "No Description"; 171 ad.Description = "No Description";
172 172
173 DateTime epoch = new DateTime(1970, 1, 1); 173 DateTime epoch = new DateTime(1970, 1, 1);
174 DateTime now = DateTime.Now; 174 DateTime now = DateTime.Now;
175 TimeSpan epochnow = now - epoch; 175 TimeSpan epochnow = now - epoch;
176 TimeSpan duration; 176 TimeSpan duration;
177 DateTime expiration; 177 DateTime expiration;
178 TimeSpan epochexp; 178 TimeSpan epochexp;
179 179
180 if(ad.Flags == 2) 180 if(ad.Flags == 2)
181 { 181 {
182 duration = new TimeSpan(7,0,0,0); 182 duration = new TimeSpan(7,0,0,0);
@@ -211,7 +211,7 @@ namespace OpenSim.Data.SQLite
211 cmd.Parameters.AddWithValue(":ParcelName", ad.ParcelName.ToString()); 211 cmd.Parameters.AddWithValue(":ParcelName", ad.ParcelName.ToString());
212 cmd.Parameters.AddWithValue(":Flags", ad.Flags.ToString()); 212 cmd.Parameters.AddWithValue(":Flags", ad.Flags.ToString());
213 cmd.Parameters.AddWithValue(":ListingPrice", ad.Price.ToString ()); 213 cmd.Parameters.AddWithValue(":ListingPrice", ad.Price.ToString ());
214 214
215 cmd.ExecuteNonQuery(); 215 cmd.ExecuteNonQuery();
216 } 216 }
217 } 217 }
@@ -227,17 +227,17 @@ namespace OpenSim.Data.SQLite
227 public bool DeleteClassifiedRecord(UUID recordId) 227 public bool DeleteClassifiedRecord(UUID recordId)
228 { 228 {
229 string query = string.Empty; 229 string query = string.Empty;
230 230
231 query += "DELETE FROM classifieds WHERE "; 231 query += "DELETE FROM classifieds WHERE ";
232 query += "classifieduuid = :ClasifiedId"; 232 query += "classifieduuid = :ClasifiedId";
233 233
234 try 234 try
235 { 235 {
236 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) 236 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
237 { 237 {
238 cmd.CommandText = query; 238 cmd.CommandText = query;
239 cmd.Parameters.AddWithValue(":ClassifiedId", recordId.ToString()); 239 cmd.Parameters.AddWithValue(":ClassifiedId", recordId.ToString());
240 240
241 cmd.ExecuteNonQuery(); 241 cmd.ExecuteNonQuery();
242 } 242 }
243 } 243 }
@@ -254,17 +254,17 @@ namespace OpenSim.Data.SQLite
254 { 254 {
255 IDataReader reader = null; 255 IDataReader reader = null;
256 string query = string.Empty; 256 string query = string.Empty;
257 257
258 query += "SELECT * FROM classifieds WHERE "; 258 query += "SELECT * FROM classifieds WHERE ";
259 query += "classifieduuid = :AdId"; 259 query += "classifieduuid = :AdId";
260 260
261 try 261 try
262 { 262 {
263 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) 263 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
264 { 264 {
265 cmd.CommandText = query; 265 cmd.CommandText = query;
266 cmd.Parameters.AddWithValue(":AdId", ad.ClassifiedId.ToString()); 266 cmd.Parameters.AddWithValue(":AdId", ad.ClassifiedId.ToString());
267 267
268 using (reader = cmd.ExecuteReader()) 268 using (reader = cmd.ExecuteReader())
269 { 269 {
270 if(reader.Read ()) 270 if(reader.Read ())
@@ -299,24 +299,24 @@ namespace OpenSim.Data.SQLite
299 { 299 {
300 IDataReader reader = null; 300 IDataReader reader = null;
301 string query = string.Empty; 301 string query = string.Empty;
302 302
303 query += "SELECT `pickuuid`,`name` FROM userpicks WHERE "; 303 query += "SELECT `pickuuid`,`name` FROM userpicks WHERE ";
304 query += "creatoruuid = :Id"; 304 query += "creatoruuid = :Id";
305 OSDArray data = new OSDArray(); 305 OSDArray data = new OSDArray();
306 306
307 try 307 try
308 { 308 {
309 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) 309 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
310 { 310 {
311 cmd.CommandText = query; 311 cmd.CommandText = query;
312 cmd.Parameters.AddWithValue(":Id", avatarId.ToString()); 312 cmd.Parameters.AddWithValue(":Id", avatarId.ToString());
313 313
314 using (reader = cmd.ExecuteReader()) 314 using (reader = cmd.ExecuteReader())
315 { 315 {
316 while (reader.Read()) 316 while (reader.Read())
317 { 317 {
318 OSDMap record = new OSDMap(); 318 OSDMap record = new OSDMap();
319 319
320 record.Add("pickuuid",OSD.FromString((string)reader["pickuuid"])); 320 record.Add("pickuuid",OSD.FromString((string)reader["pickuuid"]));
321 record.Add("name",OSD.FromString((string)reader["name"])); 321 record.Add("name",OSD.FromString((string)reader["name"]));
322 data.Add(record); 322 data.Add(record);
@@ -336,11 +336,11 @@ namespace OpenSim.Data.SQLite
336 IDataReader reader = null; 336 IDataReader reader = null;
337 string query = string.Empty; 337 string query = string.Empty;
338 UserProfilePick pick = new UserProfilePick(); 338 UserProfilePick pick = new UserProfilePick();
339 339
340 query += "SELECT * FROM userpicks WHERE "; 340 query += "SELECT * FROM userpicks WHERE ";
341 query += "creatoruuid = :CreatorId AND "; 341 query += "creatoruuid = :CreatorId AND ";
342 query += "pickuuid = :PickId"; 342 query += "pickuuid = :PickId";
343 343
344 try 344 try
345 { 345 {
346 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) 346 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
@@ -348,17 +348,17 @@ namespace OpenSim.Data.SQLite
348 cmd.CommandText = query; 348 cmd.CommandText = query;
349 cmd.Parameters.AddWithValue(":CreatorId", avatarId.ToString()); 349 cmd.Parameters.AddWithValue(":CreatorId", avatarId.ToString());
350 cmd.Parameters.AddWithValue(":PickId", pickId.ToString()); 350 cmd.Parameters.AddWithValue(":PickId", pickId.ToString());
351 351
352 using (reader = cmd.ExecuteReader()) 352 using (reader = cmd.ExecuteReader())
353 { 353 {
354 354
355 while (reader.Read()) 355 while (reader.Read())
356 { 356 {
357 string description = (string)reader["description"]; 357 string description = (string)reader["description"];
358 358
359 if (string.IsNullOrEmpty(description)) 359 if (string.IsNullOrEmpty(description))
360 description = "No description given."; 360 description = "No description given.";
361 361
362 UUID.TryParse((string)reader["pickuuid"], out pick.PickId); 362 UUID.TryParse((string)reader["pickuuid"], out pick.PickId);
363 UUID.TryParse((string)reader["creatoruuid"], out pick.CreatorId); 363 UUID.TryParse((string)reader["creatoruuid"], out pick.CreatorId);
364 UUID.TryParse((string)reader["parceluuid"], out pick.ParcelId); 364 UUID.TryParse((string)reader["parceluuid"], out pick.ParcelId);
@@ -385,7 +385,7 @@ namespace OpenSim.Data.SQLite
385 } 385 }
386 386
387 public bool UpdatePicksRecord(UserProfilePick pick) 387 public bool UpdatePicksRecord(UserProfilePick pick)
388 { 388 {
389 string query = string.Empty; 389 string query = string.Empty;
390 390
391 query += "INSERT OR REPLACE INTO userpicks ("; 391 query += "INSERT OR REPLACE INTO userpicks (";
@@ -416,7 +416,7 @@ namespace OpenSim.Data.SQLite
416 query += ":GlobalPos,"; 416 query += ":GlobalPos,";
417 query += ":SortOrder,"; 417 query += ":SortOrder,";
418 query += ":Enabled) "; 418 query += ":Enabled) ";
419 419
420 try 420 try
421 { 421 {
422 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) 422 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
@@ -456,10 +456,10 @@ namespace OpenSim.Data.SQLite
456 public bool DeletePicksRecord(UUID pickId) 456 public bool DeletePicksRecord(UUID pickId)
457 { 457 {
458 string query = string.Empty; 458 string query = string.Empty;
459 459
460 query += "DELETE FROM userpicks WHERE "; 460 query += "DELETE FROM userpicks WHERE ";
461 query += "pickuuid = :PickId"; 461 query += "pickuuid = :PickId";
462 462
463 try 463 try
464 { 464 {
465 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) 465 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
@@ -479,15 +479,15 @@ namespace OpenSim.Data.SQLite
479 } 479 }
480 480
481 public bool GetAvatarNotes(ref UserProfileNotes notes) 481 public bool GetAvatarNotes(ref UserProfileNotes notes)
482 { 482 {
483 IDataReader reader = null; 483 IDataReader reader = null;
484 string query = string.Empty; 484 string query = string.Empty;
485 485
486 query += "SELECT `notes` FROM usernotes WHERE "; 486 query += "SELECT `notes` FROM usernotes WHERE ";
487 query += "useruuid = :Id AND "; 487 query += "useruuid = :Id AND ";
488 query += "targetuuid = :TargetId"; 488 query += "targetuuid = :TargetId";
489 OSDArray data = new OSDArray(); 489 OSDArray data = new OSDArray();
490 490
491 try 491 try
492 { 492 {
493 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) 493 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
@@ -495,7 +495,7 @@ namespace OpenSim.Data.SQLite
495 cmd.CommandText = query; 495 cmd.CommandText = query;
496 cmd.Parameters.AddWithValue(":Id", notes.UserId.ToString()); 496 cmd.Parameters.AddWithValue(":Id", notes.UserId.ToString());
497 cmd.Parameters.AddWithValue(":TargetId", notes.TargetId.ToString()); 497 cmd.Parameters.AddWithValue(":TargetId", notes.TargetId.ToString());
498 498
499 using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) 499 using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
500 { 500 {
501 while (reader.Read()) 501 while (reader.Read())
@@ -514,10 +514,10 @@ namespace OpenSim.Data.SQLite
514 } 514 }
515 515
516 public bool UpdateAvatarNotes(ref UserProfileNotes note, ref string result) 516 public bool UpdateAvatarNotes(ref UserProfileNotes note, ref string result)
517 { 517 {
518 string query = string.Empty; 518 string query = string.Empty;
519 bool remove; 519 bool remove;
520 520
521 if(string.IsNullOrEmpty(note.Notes)) 521 if(string.IsNullOrEmpty(note.Notes))
522 { 522 {
523 remove = true; 523 remove = true;
@@ -533,7 +533,7 @@ namespace OpenSim.Data.SQLite
533 query += ":TargetId,"; 533 query += ":TargetId,";
534 query += ":Notes )"; 534 query += ":Notes )";
535 } 535 }
536 536
537 try 537 try
538 { 538 {
539 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) 539 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
@@ -544,7 +544,7 @@ namespace OpenSim.Data.SQLite
544 cmd.Parameters.AddWithValue(":Notes", note.Notes); 544 cmd.Parameters.AddWithValue(":Notes", note.Notes);
545 cmd.Parameters.AddWithValue(":TargetId", note.TargetId.ToString ()); 545 cmd.Parameters.AddWithValue(":TargetId", note.TargetId.ToString ());
546 cmd.Parameters.AddWithValue(":UserId", note.UserId.ToString()); 546 cmd.Parameters.AddWithValue(":UserId", note.UserId.ToString());
547 547
548 cmd.ExecuteNonQuery(); 548 cmd.ExecuteNonQuery();
549 } 549 }
550 } 550 }
@@ -561,7 +561,7 @@ namespace OpenSim.Data.SQLite
561 { 561 {
562 IDataReader reader = null; 562 IDataReader reader = null;
563 string query = string.Empty; 563 string query = string.Empty;
564 564
565 query += "SELECT * FROM userprofile WHERE "; 565 query += "SELECT * FROM userprofile WHERE ";
566 query += "useruuid = :Id"; 566 query += "useruuid = :Id";
567 567
@@ -569,7 +569,7 @@ namespace OpenSim.Data.SQLite
569 { 569 {
570 cmd.CommandText = query; 570 cmd.CommandText = query;
571 cmd.Parameters.AddWithValue(":Id", props.UserId.ToString()); 571 cmd.Parameters.AddWithValue(":Id", props.UserId.ToString());
572 572
573 573
574 try 574 try
575 { 575 {
@@ -611,7 +611,7 @@ namespace OpenSim.Data.SQLite
611 props.Language = string.Empty; 611 props.Language = string.Empty;
612 props.PublishProfile = false; 612 props.PublishProfile = false;
613 props.PublishMature = false; 613 props.PublishMature = false;
614 614
615 query = "INSERT INTO userprofile ("; 615 query = "INSERT INTO userprofile (";
616 query += "useruuid, "; 616 query += "useruuid, ";
617 query += "profilePartner, "; 617 query += "profilePartner, ";
@@ -659,7 +659,7 @@ namespace OpenSim.Data.SQLite
659 put.Parameters.AddWithValue(":profileAboutText", props.AboutText); 659 put.Parameters.AddWithValue(":profileAboutText", props.AboutText);
660 put.Parameters.AddWithValue(":profileFirstImage", props.FirstLifeImageId.ToString()); 660 put.Parameters.AddWithValue(":profileFirstImage", props.FirstLifeImageId.ToString());
661 put.Parameters.AddWithValue(":profileFirstText", props.FirstLifeText); 661 put.Parameters.AddWithValue(":profileFirstText", props.FirstLifeText);
662 662
663 put.ExecuteNonQuery(); 663 put.ExecuteNonQuery();
664 } 664 }
665 } 665 }
@@ -668,9 +668,9 @@ namespace OpenSim.Data.SQLite
668 } 668 }
669 669
670 public bool UpdateAvatarProperties(ref UserProfileProperties props, ref string result) 670 public bool UpdateAvatarProperties(ref UserProfileProperties props, ref string result)
671 { 671 {
672 string query = string.Empty; 672 string query = string.Empty;
673 673
674 query += "UPDATE userprofile SET "; 674 query += "UPDATE userprofile SET ";
675 query += "profileURL=:profileURL, "; 675 query += "profileURL=:profileURL, ";
676 query += "profileImage=:image, "; 676 query += "profileImage=:image, ";
@@ -678,7 +678,7 @@ namespace OpenSim.Data.SQLite
678 query += "profileFirstImage=:firstlifeimage,"; 678 query += "profileFirstImage=:firstlifeimage,";
679 query += "profileFirstText=:firstlifetext "; 679 query += "profileFirstText=:firstlifetext ";
680 query += "WHERE useruuid=:uuid"; 680 query += "WHERE useruuid=:uuid";
681 681
682 try 682 try
683 { 683 {
684 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) 684 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
@@ -690,7 +690,7 @@ namespace OpenSim.Data.SQLite
690 cmd.Parameters.AddWithValue(":firstlifeimage", props.FirstLifeImageId.ToString()); 690 cmd.Parameters.AddWithValue(":firstlifeimage", props.FirstLifeImageId.ToString());
691 cmd.Parameters.AddWithValue(":firstlifetext", props.FirstLifeText); 691 cmd.Parameters.AddWithValue(":firstlifetext", props.FirstLifeText);
692 cmd.Parameters.AddWithValue(":uuid", props.UserId.ToString()); 692 cmd.Parameters.AddWithValue(":uuid", props.UserId.ToString());
693 693
694 cmd.ExecuteNonQuery(); 694 cmd.ExecuteNonQuery();
695 } 695 }
696 } 696 }
@@ -698,16 +698,16 @@ namespace OpenSim.Data.SQLite
698 { 698 {
699 m_log.ErrorFormat("[PROFILES_DATA]" + 699 m_log.ErrorFormat("[PROFILES_DATA]" +
700 ": AgentPropertiesUpdate exception {0}", e.Message); 700 ": AgentPropertiesUpdate exception {0}", e.Message);
701 701
702 return false; 702 return false;
703 } 703 }
704 return true; 704 return true;
705 } 705 }
706 706
707 public bool UpdateAvatarInterests(UserProfileProperties up, ref string result) 707 public bool UpdateAvatarInterests(UserProfileProperties up, ref string result)
708 { 708 {
709 string query = string.Empty; 709 string query = string.Empty;
710 710
711 query += "UPDATE userprofile SET "; 711 query += "UPDATE userprofile SET ";
712 query += "profileWantToMask=:WantMask, "; 712 query += "profileWantToMask=:WantMask, ";
713 query += "profileWantToText=:WantText,"; 713 query += "profileWantToText=:WantText,";
@@ -715,7 +715,7 @@ namespace OpenSim.Data.SQLite
715 query += "profileSkillsText=:SkillsText, "; 715 query += "profileSkillsText=:SkillsText, ";
716 query += "profileLanguages=:Languages "; 716 query += "profileLanguages=:Languages ";
717 query += "WHERE useruuid=:uuid"; 717 query += "WHERE useruuid=:uuid";
718 718
719 try 719 try
720 { 720 {
721 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) 721 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
@@ -727,7 +727,7 @@ namespace OpenSim.Data.SQLite
727 cmd.Parameters.AddWithValue(":SkillsText", up.SkillsText); 727 cmd.Parameters.AddWithValue(":SkillsText", up.SkillsText);
728 cmd.Parameters.AddWithValue(":Languages", up.Language); 728 cmd.Parameters.AddWithValue(":Languages", up.Language);
729 cmd.Parameters.AddWithValue(":uuid", up.UserId.ToString()); 729 cmd.Parameters.AddWithValue(":uuid", up.UserId.ToString());
730 730
731 cmd.ExecuteNonQuery(); 731 cmd.ExecuteNonQuery();
732 } 732 }
733 } 733 }
@@ -741,17 +741,17 @@ namespace OpenSim.Data.SQLite
741 return true; 741 return true;
742 } 742 }
743 743
744 744
745 public bool UpdateUserPreferences(ref UserPreferences pref, ref string result) 745 public bool UpdateUserPreferences(ref UserPreferences pref, ref string result)
746 { 746 {
747 string query = string.Empty; 747 string query = string.Empty;
748 748
749 query += "UPDATE usersettings SET "; 749 query += "UPDATE usersettings SET ";
750 query += "imviaemail=:ImViaEmail, "; 750 query += "imviaemail=:ImViaEmail, ";
751 query += "visible=:Visible, "; 751 query += "visible=:Visible, ";
752 query += "email=:EMail "; 752 query += "email=:EMail ";
753 query += "WHERE useruuid=:uuid"; 753 query += "WHERE useruuid=:uuid";
754 754
755 try 755 try
756 { 756 {
757 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) 757 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
@@ -761,7 +761,7 @@ namespace OpenSim.Data.SQLite
761 cmd.Parameters.AddWithValue(":Visible", pref.Visible); 761 cmd.Parameters.AddWithValue(":Visible", pref.Visible);
762 cmd.Parameters.AddWithValue(":EMail", pref.EMail); 762 cmd.Parameters.AddWithValue(":EMail", pref.EMail);
763 cmd.Parameters.AddWithValue(":uuid", pref.UserId.ToString()); 763 cmd.Parameters.AddWithValue(":uuid", pref.UserId.ToString());
764 764
765 cmd.ExecuteNonQuery(); 765 cmd.ExecuteNonQuery();
766 } 766 }
767 } 767 }
@@ -779,20 +779,20 @@ namespace OpenSim.Data.SQLite
779 { 779 {
780 IDataReader reader = null; 780 IDataReader reader = null;
781 string query = string.Empty; 781 string query = string.Empty;
782 782
783 query += "SELECT imviaemail,visible,email FROM "; 783 query += "SELECT imviaemail,visible,email FROM ";
784 query += "usersettings WHERE "; 784 query += "usersettings WHERE ";
785 query += "useruuid = :Id"; 785 query += "useruuid = :Id";
786 786
787 OSDArray data = new OSDArray(); 787 OSDArray data = new OSDArray();
788 788
789 try 789 try
790 { 790 {
791 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) 791 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
792 { 792 {
793 cmd.CommandText = query; 793 cmd.CommandText = query;
794 cmd.Parameters.AddWithValue("?Id", pref.UserId.ToString()); 794 cmd.Parameters.AddWithValue("?Id", pref.UserId.ToString());
795 795
796 using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) 796 using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
797 { 797 {
798 if(reader.Read()) 798 if(reader.Read())
@@ -805,13 +805,13 @@ namespace OpenSim.Data.SQLite
805 { 805 {
806 query = "INSERT INTO usersettings VALUES "; 806 query = "INSERT INTO usersettings VALUES ";
807 query += "(:Id,'false','false', :Email)"; 807 query += "(:Id,'false','false', :Email)";
808 808
809 using (SqliteCommand put = (SqliteCommand)m_connection.CreateCommand()) 809 using (SqliteCommand put = (SqliteCommand)m_connection.CreateCommand())
810 { 810 {
811 put.Parameters.AddWithValue(":Id", pref.UserId.ToString()); 811 put.Parameters.AddWithValue(":Id", pref.UserId.ToString());
812 put.Parameters.AddWithValue(":Email", pref.EMail); 812 put.Parameters.AddWithValue(":Email", pref.EMail);
813 put.ExecuteNonQuery(); 813 put.ExecuteNonQuery();
814 814
815 } 815 }
816 } 816 }
817 } 817 }
@@ -831,11 +831,11 @@ namespace OpenSim.Data.SQLite
831 { 831 {
832 IDataReader reader = null; 832 IDataReader reader = null;
833 string query = string.Empty; 833 string query = string.Empty;
834 834
835 query += "SELECT * FROM `userdata` WHERE "; 835 query += "SELECT * FROM `userdata` WHERE ";
836 query += "UserId = :Id AND "; 836 query += "UserId = :Id AND ";
837 query += "TagId = :TagId"; 837 query += "TagId = :TagId";
838 838
839 try 839 try
840 { 840 {
841 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) 841 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
@@ -843,7 +843,7 @@ namespace OpenSim.Data.SQLite
843 cmd.CommandText = query; 843 cmd.CommandText = query;
844 cmd.Parameters.AddWithValue(":Id", props.UserId.ToString()); 844 cmd.Parameters.AddWithValue(":Id", props.UserId.ToString());
845 cmd.Parameters.AddWithValue (":TagId", props.TagId.ToString()); 845 cmd.Parameters.AddWithValue (":TagId", props.TagId.ToString());
846 846
847 using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) 847 using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
848 { 848 {
849 if(reader.Read()) 849 if(reader.Read())
@@ -858,7 +858,7 @@ namespace OpenSim.Data.SQLite
858 query += ":TagId,"; 858 query += ":TagId,";
859 query += ":DataKey,"; 859 query += ":DataKey,";
860 query += ":DataVal) "; 860 query += ":DataVal) ";
861 861
862 using (SqliteCommand put = (SqliteCommand)m_connection.CreateCommand()) 862 using (SqliteCommand put = (SqliteCommand)m_connection.CreateCommand())
863 { 863 {
864 put.Parameters.AddWithValue(":Id", props.UserId.ToString()); 864 put.Parameters.AddWithValue(":Id", props.UserId.ToString());
@@ -882,16 +882,16 @@ namespace OpenSim.Data.SQLite
882 return true; 882 return true;
883 } 883 }
884 public bool SetUserAppData(UserAppData props, ref string result) 884 public bool SetUserAppData(UserAppData props, ref string result)
885 { 885 {
886 string query = string.Empty; 886 string query = string.Empty;
887 887
888 query += "UPDATE userdata SET "; 888 query += "UPDATE userdata SET ";
889 query += "TagId = :TagId, "; 889 query += "TagId = :TagId, ";
890 query += "DataKey = :DataKey, "; 890 query += "DataKey = :DataKey, ";
891 query += "DataVal = :DataVal WHERE "; 891 query += "DataVal = :DataVal WHERE ";
892 query += "UserId = :UserId AND "; 892 query += "UserId = :UserId AND ";
893 query += "TagId = :TagId"; 893 query += "TagId = :TagId";
894 894
895 try 895 try
896 { 896 {
897 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) 897 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
@@ -918,17 +918,17 @@ namespace OpenSim.Data.SQLite
918 IDataReader reader = null; 918 IDataReader reader = null;
919 OSDArray data = new OSDArray(); 919 OSDArray data = new OSDArray();
920 string query = "SELECT `snapshotuuid` FROM {0} WHERE `creatoruuid` = :Id"; 920 string query = "SELECT `snapshotuuid` FROM {0} WHERE `creatoruuid` = :Id";
921 921
922 // Get classified image assets 922 // Get classified image assets
923 923
924 924
925 try 925 try
926 { 926 {
927 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) 927 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
928 { 928 {
929 cmd.CommandText = query; 929 cmd.CommandText = query;
930 cmd.Parameters.AddWithValue(":Id", avatarId.ToString()); 930 cmd.Parameters.AddWithValue(":Id", avatarId.ToString());
931 931
932 using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) 932 using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
933 { 933 {
934 while(reader.Read()) 934 while(reader.Read())
@@ -942,7 +942,7 @@ namespace OpenSim.Data.SQLite
942 { 942 {
943 cmd.CommandText = query; 943 cmd.CommandText = query;
944 cmd.Parameters.AddWithValue(":Id", avatarId.ToString()); 944 cmd.Parameters.AddWithValue(":Id", avatarId.ToString());
945 945
946 using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) 946 using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
947 { 947 {
948 if(reader.Read()) 948 if(reader.Read())
@@ -951,14 +951,14 @@ namespace OpenSim.Data.SQLite
951 } 951 }
952 } 952 }
953 } 953 }
954 954
955 query = "SELECT `profileImage`, `profileFirstImage` FROM `userprofile` WHERE `useruuid` = :Id"; 955 query = "SELECT `profileImage`, `profileFirstImage` FROM `userprofile` WHERE `useruuid` = :Id";
956 956
957 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand()) 957 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
958 { 958 {
959 cmd.CommandText = query; 959 cmd.CommandText = query;
960 cmd.Parameters.AddWithValue(":Id", avatarId.ToString()); 960 cmd.Parameters.AddWithValue(":Id", avatarId.ToString());
961 961
962 using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow)) 962 using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
963 { 963 {
964 if(reader.Read()) 964 if(reader.Read())
diff --git a/OpenSim/Data/SQLite/SQLiteUtils.cs b/OpenSim/Data/SQLite/SQLiteUtils.cs
index ca5861f..1218ebb 100644
--- a/OpenSim/Data/SQLite/SQLiteUtils.cs
+++ b/OpenSim/Data/SQLite/SQLiteUtils.cs
@@ -49,7 +49,7 @@ namespace OpenSim.Data.SQLite
49 **********************************************************************/ 49 **********************************************************************/
50 50
51 /// <summary> 51 /// <summary>
52 /// 52 ///
53 /// </summary> 53 /// </summary>
54 /// <param name="dt"></param> 54 /// <param name="dt"></param>
55 /// <param name="name"></param> 55 /// <param name="name"></param>
@@ -147,7 +147,7 @@ namespace OpenSim.Data.SQLite
147 } 147 }
148 148
149 /// <summary> 149 /// <summary>
150 /// 150 ///
151 /// </summary> 151 /// </summary>
152 /// <param name="dt">Data Table</param> 152 /// <param name="dt">Data Table</param>
153 /// <returns></returns> 153 /// <returns></returns>
@@ -191,7 +191,7 @@ namespace OpenSim.Data.SQLite
191 /// lines for defining SqliteParameters to 2 parameters: 191 /// lines for defining SqliteParameters to 2 parameters:
192 /// column name and database type. 192 /// column name and database type.
193 /// </para> 193 /// </para>
194 /// 194 ///
195 /// <para> 195 /// <para>
196 /// It assumes certain conventions like :param as the param 196 /// It assumes certain conventions like :param as the param
197 /// name to replace in parametrized queries, and that source 197 /// name to replace in parametrized queries, and that source
diff --git a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs
index 2a0a8f6..7f44a65 100644
--- a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs
+++ b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs
@@ -107,7 +107,7 @@ namespace OpenSim.Data.SQLite
107 public bool DeleteItems(string[] fields, string[] vals) 107 public bool DeleteItems(string[] fields, string[] vals)
108 { 108 {
109 return m_Items.Delete(fields, vals); 109 return m_Items.Delete(fields, vals);
110 } 110 }
111 111
112 public bool MoveItem(string id, string newParent) 112 public bool MoveItem(string id, string newParent)
113 { 113 {
@@ -302,7 +302,7 @@ namespace OpenSim.Data.SQLite
302 { 302 {
303// m_log.DebugFormat("[MYSQL ITEM HANDLER]: Incrementing version on folder {0}", folderID); 303// m_log.DebugFormat("[MYSQL ITEM HANDLER]: Incrementing version on folder {0}", folderID);
304// Util.PrintCallStack(); 304// Util.PrintCallStack();
305 305
306 using (SqliteCommand cmd = new SqliteCommand()) 306 using (SqliteCommand cmd = new SqliteCommand())
307 { 307 {
308 cmd.CommandText = "update inventoryfolders set version=version+1 where folderID = ?folderID"; 308 cmd.CommandText = "update inventoryfolders set version=version+1 where folderID = ?folderID";
diff --git a/OpenSim/Data/Tests/AssetTests.cs b/OpenSim/Data/Tests/AssetTests.cs
index 5982a09..70880cf 100644
--- a/OpenSim/Data/Tests/AssetTests.cs
+++ b/OpenSim/Data/Tests/AssetTests.cs
@@ -110,7 +110,7 @@ namespace OpenSim.Data.Tests
110 public void T010_StoreReadVerifyAssets() 110 public void T010_StoreReadVerifyAssets()
111 { 111 {
112 TestHelpers.InMethod(); 112 TestHelpers.InMethod();
113 113
114 AssetBase a1 = new AssetBase(uuid1, "asset one", (sbyte)AssetType.Texture, critter1.ToString()); 114 AssetBase a1 = new AssetBase(uuid1, "asset one", (sbyte)AssetType.Texture, critter1.ToString());
115 AssetBase a2 = new AssetBase(uuid2, "asset two", (sbyte)AssetType.Texture, critter2.ToString()); 115 AssetBase a2 = new AssetBase(uuid2, "asset two", (sbyte)AssetType.Texture, critter2.ToString());
116 AssetBase a3 = new AssetBase(uuid3, "asset three", (sbyte)AssetType.Texture, critter3.ToString()); 116 AssetBase a3 = new AssetBase(uuid3, "asset three", (sbyte)AssetType.Texture, critter3.ToString());
@@ -128,7 +128,7 @@ namespace OpenSim.Data.Tests
128 a1.UploadAttempts = 0; 128 a1.UploadAttempts = 0;
129 a2.UploadAttempts = 0; 129 a2.UploadAttempts = 0;
130 a3.UploadAttempts = 0; 130 a3.UploadAttempts = 0;
131 131
132 AssetBase a1a = m_db.GetAsset(uuid1); 132 AssetBase a1a = m_db.GetAsset(uuid1);
133 a1a.UploadAttempts = 0; 133 a1a.UploadAttempts = 0;
134 Assert.That(a1a, Constraints.PropertyCompareConstraint(a1)); 134 Assert.That(a1a, Constraints.PropertyCompareConstraint(a1));
@@ -190,7 +190,7 @@ namespace OpenSim.Data.Tests
190 public void T020_CheckForWeirdCreatorID() 190 public void T020_CheckForWeirdCreatorID()
191 { 191 {
192 TestHelpers.InMethod(); 192 TestHelpers.InMethod();
193 193
194 // It is expected that eventually the CreatorID might be an arbitrary string (an URI) 194 // It is expected that eventually the CreatorID might be an arbitrary string (an URI)
195 // rather than a valid UUID (?). This test is to make sure that the database layer does not 195 // rather than a valid UUID (?). This test is to make sure that the database layer does not
196 // attempt to convert CreatorID to GUID, but just passes it both ways as a string. 196 // attempt to convert CreatorID to GUID, but just passes it both ways as a string.
diff --git a/OpenSim/Data/Tests/BasicDataServiceTest.cs b/OpenSim/Data/Tests/BasicDataServiceTest.cs
index acfebd0..79691e4 100644
--- a/OpenSim/Data/Tests/BasicDataServiceTest.cs
+++ b/OpenSim/Data/Tests/BasicDataServiceTest.cs
@@ -41,11 +41,11 @@ using System.Reflection;
41 41
42namespace OpenSim.Data.Tests 42namespace OpenSim.Data.Tests
43{ 43{
44 /// <summary>This is a base class for testing any Data service for any DBMS. 44 /// <summary>This is a base class for testing any Data service for any DBMS.
45 /// Requires NUnit 2.5 or better (to support the generics). 45 /// Requires NUnit 2.5 or better (to support the generics).
46 /// </summary> 46 /// </summary>
47 /// <remarks> 47 /// <remarks>
48 /// FIXME: Should extend OpenSimTestCase but compile on mono 2.4.3 currently fails with 48 /// FIXME: Should extend OpenSimTestCase but compile on mono 2.4.3 currently fails with
49 /// AssetTests`2 : System.MemberAccessException : Cannot create an instance of OpenSim.Data.Tests.AssetTests`2[TConn,TAssetData] because Type.ContainsGenericParameters is true. 49 /// AssetTests`2 : System.MemberAccessException : Cannot create an instance of OpenSim.Data.Tests.AssetTests`2[TConn,TAssetData] because Type.ContainsGenericParameters is true.
50 /// and similar on EstateTests, InventoryTests and RegionTests. 50 /// and similar on EstateTests, InventoryTests and RegionTests.
51 /// Runs fine with mono 2.10.8.1, so easiest thing is to wait until min Mono version uplifts. 51 /// Runs fine with mono 2.10.8.1, so easiest thing is to wait until min Mono version uplifts.
@@ -60,7 +60,7 @@ namespace OpenSim.Data.Tests
60 private TService m_service; 60 private TService m_service;
61 private string m_file; 61 private string m_file;
62 62
63 // TODO: Is this in the right place here? 63 // TODO: Is this in the right place here?
64 // Later: apparently it's not, but does it matter here? 64 // Later: apparently it's not, but does it matter here?
65// protected static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 65// protected static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
66 66
@@ -68,7 +68,7 @@ namespace OpenSim.Data.Tests
68 68
69 public BasicDataServiceTest() 69 public BasicDataServiceTest()
70 : this("") 70 : this("")
71 { 71 {
72 } 72 }
73 73
74 public BasicDataServiceTest(string conn) 74 public BasicDataServiceTest(string conn)
@@ -226,7 +226,7 @@ namespace OpenSim.Data.Tests
226 } 226 }
227 } 227 }
228 228
229 /// <summary>Clear tables listed as parameters (without dropping them). 229 /// <summary>Clear tables listed as parameters (without dropping them).
230 /// </summary> 230 /// </summary>
231 /// <param name="tables"></param> 231 /// <param name="tables"></param>
232 protected virtual void ResetMigrations(params string[] stores) 232 protected virtual void ResetMigrations(params string[] stores)
@@ -251,7 +251,7 @@ namespace OpenSim.Data.Tests
251 } 251 }
252 } 252 }
253 253
254 /// <summary>Clear tables listed as parameters (without dropping them). 254 /// <summary>Clear tables listed as parameters (without dropping them).
255 /// </summary> 255 /// </summary>
256 /// <param name="tables"></param> 256 /// <param name="tables"></param>
257 protected virtual void ClearTables(params string[] tables) 257 protected virtual void ClearTables(params string[] tables)
diff --git a/OpenSim/Data/Tests/DefaultTestConns.cs b/OpenSim/Data/Tests/DefaultTestConns.cs
index 7c47bdd..5ad238b 100644
--- a/OpenSim/Data/Tests/DefaultTestConns.cs
+++ b/OpenSim/Data/Tests/DefaultTestConns.cs
@@ -39,16 +39,16 @@ namespace OpenSim.Data.Tests
39 /// a connection string for testing one of the supported databases. 39 /// a connection string for testing one of the supported databases.
40 /// The connections must be in the section [TestConnections] with names matching the connection class 40 /// The connections must be in the section [TestConnections] with names matching the connection class
41 /// name for the specific database, e.g.: 41 /// name for the specific database, e.g.:
42 /// 42 ///
43 /// [TestConnections] 43 /// [TestConnections]
44 /// MySqlConnection="..." 44 /// MySqlConnection="..."
45 /// SqlConnection="..." 45 /// SqlConnection="..."
46 /// SqliteConnection="..." 46 /// SqliteConnection="..."
47 /// 47 ///
48 /// Note that the conn string may also be set explicitly in the [TestCase()] attribute of test classes 48 /// Note that the conn string may also be set explicitly in the [TestCase()] attribute of test classes
49 /// based on BasicDataServiceTest.cs. 49 /// based on BasicDataServiceTest.cs.
50 /// </summary> 50 /// </summary>
51 51
52 static class DefaultTestConns 52 static class DefaultTestConns
53 { 53 {
54 private static Dictionary<Type, string> conns = new Dictionary<Type, string>(); 54 private static Dictionary<Type, string> conns = new Dictionary<Type, string>();
@@ -63,8 +63,8 @@ namespace OpenSim.Data.Tests
63 Assembly asm = Assembly.GetExecutingAssembly(); 63 Assembly asm = Assembly.GetExecutingAssembly();
64 string sType = connType.Name; 64 string sType = connType.Name;
65 65
66 // Note: when running from NUnit, the DLL is located in some temp dir, so how do we get 66 // Note: when running from NUnit, the DLL is located in some temp dir, so how do we get
67 // to the INI file? Ok, so put it into the resources! 67 // to the INI file? Ok, so put it into the resources!
68 // string iniName = Path.Combine(Path.GetDirectoryName(asm.Location), "TestDataConnections.ini"); 68 // string iniName = Path.Combine(Path.GetDirectoryName(asm.Location), "TestDataConnections.ini");
69 69
70 string[] allres = asm.GetManifestResourceNames(); 70 string[] allres = asm.GetManifestResourceNames();
diff --git a/OpenSim/Data/Tests/EstateTests.cs b/OpenSim/Data/Tests/EstateTests.cs
index e2b2d12..cf3f2b4 100644
--- a/OpenSim/Data/Tests/EstateTests.cs
+++ b/OpenSim/Data/Tests/EstateTests.cs
@@ -100,7 +100,7 @@ namespace OpenSim.Data.Tests
100 public void T010_EstateSettingsSimpleStorage_MinimumParameterSet() 100 public void T010_EstateSettingsSimpleStorage_MinimumParameterSet()
101 { 101 {
102 TestHelpers.InMethod(); 102 TestHelpers.InMethod();
103 103
104 EstateSettingsSimpleStorage( 104 EstateSettingsSimpleStorage(
105 REGION_ID, 105 REGION_ID,
106 DataTestUtil.STRING_MIN, 106 DataTestUtil.STRING_MIN,
@@ -133,7 +133,7 @@ namespace OpenSim.Data.Tests
133 public void T011_EstateSettingsSimpleStorage_MaximumParameterSet() 133 public void T011_EstateSettingsSimpleStorage_MaximumParameterSet()
134 { 134 {
135 TestHelpers.InMethod(); 135 TestHelpers.InMethod();
136 136
137 EstateSettingsSimpleStorage( 137 EstateSettingsSimpleStorage(
138 REGION_ID, 138 REGION_ID,
139 DataTestUtil.STRING_MAX(64), 139 DataTestUtil.STRING_MAX(64),
@@ -166,7 +166,7 @@ namespace OpenSim.Data.Tests
166 public void T012_EstateSettingsSimpleStorage_AccurateParameterSet() 166 public void T012_EstateSettingsSimpleStorage_AccurateParameterSet()
167 { 167 {
168 TestHelpers.InMethod(); 168 TestHelpers.InMethod();
169 169
170 EstateSettingsSimpleStorage( 170 EstateSettingsSimpleStorage(
171 REGION_ID, 171 REGION_ID,
172 DataTestUtil.STRING_MAX(1), 172 DataTestUtil.STRING_MAX(1),
@@ -199,7 +199,7 @@ namespace OpenSim.Data.Tests
199 public void T012_EstateSettingsRandomStorage() 199 public void T012_EstateSettingsRandomStorage()
200 { 200 {
201 TestHelpers.InMethod(); 201 TestHelpers.InMethod();
202 202
203 // Letting estate store generate rows to database for us 203 // Letting estate store generate rows to database for us
204 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true); 204 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true);
205 new PropertyScrambler<EstateSettings>() 205 new PropertyScrambler<EstateSettings>()
@@ -220,7 +220,7 @@ namespace OpenSim.Data.Tests
220 public void T020_EstateSettingsManagerList() 220 public void T020_EstateSettingsManagerList()
221 { 221 {
222 TestHelpers.InMethod(); 222 TestHelpers.InMethod();
223 223
224 // Letting estate store generate rows to database for us 224 // Letting estate store generate rows to database for us
225 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true); 225 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true);
226 226
@@ -241,7 +241,7 @@ namespace OpenSim.Data.Tests
241 public void T021_EstateSettingsUserList() 241 public void T021_EstateSettingsUserList()
242 { 242 {
243 TestHelpers.InMethod(); 243 TestHelpers.InMethod();
244 244
245 // Letting estate store generate rows to database for us 245 // Letting estate store generate rows to database for us
246 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true); 246 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true);
247 247
@@ -262,7 +262,7 @@ namespace OpenSim.Data.Tests
262 public void T022_EstateSettingsGroupList() 262 public void T022_EstateSettingsGroupList()
263 { 263 {
264 TestHelpers.InMethod(); 264 TestHelpers.InMethod();
265 265
266 // Letting estate store generate rows to database for us 266 // Letting estate store generate rows to database for us
267 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true); 267 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true);
268 268
@@ -283,7 +283,7 @@ namespace OpenSim.Data.Tests
283 public void T022_EstateSettingsBanList() 283 public void T022_EstateSettingsBanList()
284 { 284 {
285 TestHelpers.InMethod(); 285 TestHelpers.InMethod();
286 286
287 // Letting estate store generate rows to database for us 287 // Letting estate store generate rows to database for us
288 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true); 288 EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true);
289 289
@@ -310,7 +310,7 @@ namespace OpenSim.Data.Tests
310 310
311 #endregion 311 #endregion
312 312
313 #region Parametrizable Test Implementations 313 #region Parametrizable Test Implementations
314 314
315 private void EstateSettingsSimpleStorage( 315 private void EstateSettingsSimpleStorage(
316 UUID regionId, 316 UUID regionId,
diff --git a/OpenSim/Data/Tests/InventoryTests.cs b/OpenSim/Data/Tests/InventoryTests.cs
index e4ec5c1..da6e7d4 100644
--- a/OpenSim/Data/Tests/InventoryTests.cs
+++ b/OpenSim/Data/Tests/InventoryTests.cs
@@ -46,7 +46,7 @@ namespace OpenSim.Data.Tests
46{ 46{
47 [TestFixture(Description = "Inventory store tests (MySQL)")] 47 [TestFixture(Description = "Inventory store tests (MySQL)")]
48 public class MySqlInventoryTests : InventoryTests<MySqlConnection, MySQLInventoryData> 48 public class MySqlInventoryTests : InventoryTests<MySqlConnection, MySQLInventoryData>
49 { 49 {
50 } 50 }
51 51
52 public class InventoryTests<TConn, TInvStore> : BasicDataServiceTest<TConn, TInvStore> 52 public class InventoryTests<TConn, TInvStore> : BasicDataServiceTest<TConn, TInvStore>
@@ -102,7 +102,7 @@ namespace OpenSim.Data.Tests
102 public void T001_LoadEmpty() 102 public void T001_LoadEmpty()
103 { 103 {
104 TestHelpers.InMethod(); 104 TestHelpers.InMethod();
105 105
106 Assert.That(db.getInventoryFolder(zero), Is.Null); 106 Assert.That(db.getInventoryFolder(zero), Is.Null);
107 Assert.That(db.getInventoryFolder(folder1), Is.Null); 107 Assert.That(db.getInventoryFolder(folder1), Is.Null);
108 Assert.That(db.getInventoryFolder(folder2), Is.Null); 108 Assert.That(db.getInventoryFolder(folder2), Is.Null);
@@ -122,7 +122,7 @@ namespace OpenSim.Data.Tests
122 public void T010_FolderNonParent() 122 public void T010_FolderNonParent()
123 { 123 {
124 TestHelpers.InMethod(); 124 TestHelpers.InMethod();
125 125
126 InventoryFolderBase f1 = NewFolder(folder2, folder1, owner1, name2); 126 InventoryFolderBase f1 = NewFolder(folder2, folder1, owner1, name2);
127 // the folder will go in 127 // the folder will go in
128 db.addInventoryFolder(f1); 128 db.addInventoryFolder(f1);
@@ -134,7 +134,7 @@ namespace OpenSim.Data.Tests
134 public void T011_FolderCreate() 134 public void T011_FolderCreate()
135 { 135 {
136 TestHelpers.InMethod(); 136 TestHelpers.InMethod();
137 137
138 InventoryFolderBase f1 = NewFolder(folder1, zero, owner1, name1); 138 InventoryFolderBase f1 = NewFolder(folder1, zero, owner1, name1);
139 // TODO: this is probably wrong behavior, but is what we have 139 // TODO: this is probably wrong behavior, but is what we have
140 // db.updateInventoryFolder(f1); 140 // db.updateInventoryFolder(f1);
@@ -159,7 +159,7 @@ namespace OpenSim.Data.Tests
159 public void T012_FolderList() 159 public void T012_FolderList()
160 { 160 {
161 TestHelpers.InMethod(); 161 TestHelpers.InMethod();
162 162
163 InventoryFolderBase f2 = NewFolder(folder3, folder1, owner1, name3); 163 InventoryFolderBase f2 = NewFolder(folder3, folder1, owner1, name3);
164 db.addInventoryFolder(f2); 164 db.addInventoryFolder(f2);
165 165
@@ -175,7 +175,7 @@ namespace OpenSim.Data.Tests
175 public void T013_FolderHierarchy() 175 public void T013_FolderHierarchy()
176 { 176 {
177 TestHelpers.InMethod(); 177 TestHelpers.InMethod();
178 178
179 int n = db.getFolderHierarchy(zero).Count; // (for dbg - easier to see what's returned) 179 int n = db.getFolderHierarchy(zero).Count; // (for dbg - easier to see what's returned)
180 Assert.That(n, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0))"); 180 Assert.That(n, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0))");
181 n = db.getFolderHierarchy(folder1).Count; 181 n = db.getFolderHierarchy(folder1).Count;
@@ -190,7 +190,7 @@ namespace OpenSim.Data.Tests
190 public void T014_MoveFolder() 190 public void T014_MoveFolder()
191 { 191 {
192 TestHelpers.InMethod(); 192 TestHelpers.InMethod();
193 193
194 InventoryFolderBase f2 = db.getInventoryFolder(folder2); 194 InventoryFolderBase f2 = db.getInventoryFolder(folder2);
195 f2.ParentID = folder3; 195 f2.ParentID = folder3;
196 db.moveInventoryFolder(f2); 196 db.moveInventoryFolder(f2);
@@ -206,7 +206,7 @@ namespace OpenSim.Data.Tests
206 public void T015_FolderHierarchy() 206 public void T015_FolderHierarchy()
207 { 207 {
208 TestHelpers.InMethod(); 208 TestHelpers.InMethod();
209 209
210 Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0))"); 210 Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0))");
211 Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2), "Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2))"); 211 Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2), "Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2))");
212 Assert.That(db.getFolderHierarchy(folder2).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(folder2).Count, Is.EqualTo(0))"); 212 Assert.That(db.getFolderHierarchy(folder2).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(folder2).Count, Is.EqualTo(0))");
@@ -219,7 +219,7 @@ namespace OpenSim.Data.Tests
219 public void T100_NoItems() 219 public void T100_NoItems()
220 { 220 {
221 TestHelpers.InMethod(); 221 TestHelpers.InMethod();
222 222
223 Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0))"); 223 Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0))");
224 Assert.That(db.getInventoryInFolder(folder1).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(folder1).Count, Is.EqualTo(0))"); 224 Assert.That(db.getInventoryInFolder(folder1).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(folder1).Count, Is.EqualTo(0))");
225 Assert.That(db.getInventoryInFolder(folder2).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(folder2).Count, Is.EqualTo(0))"); 225 Assert.That(db.getInventoryInFolder(folder2).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(folder2).Count, Is.EqualTo(0))");
@@ -233,7 +233,7 @@ namespace OpenSim.Data.Tests
233 public void T101_CreatItems() 233 public void T101_CreatItems()
234 { 234 {
235 TestHelpers.InMethod(); 235 TestHelpers.InMethod();
236 236
237 db.addInventoryItem(NewItem(item1, folder3, owner1, iname1, asset1)); 237 db.addInventoryItem(NewItem(item1, folder3, owner1, iname1, asset1));
238 db.addInventoryItem(NewItem(item2, folder3, owner1, iname2, asset2)); 238 db.addInventoryItem(NewItem(item2, folder3, owner1, iname2, asset2));
239 db.addInventoryItem(NewItem(item3, folder3, owner1, iname3, asset3)); 239 db.addInventoryItem(NewItem(item3, folder3, owner1, iname3, asset3));
@@ -244,7 +244,7 @@ namespace OpenSim.Data.Tests
244 public void T102_CompareItems() 244 public void T102_CompareItems()
245 { 245 {
246 TestHelpers.InMethod(); 246 TestHelpers.InMethod();
247 247
248 InventoryItemBase i1 = db.getInventoryItem(item1); 248 InventoryItemBase i1 = db.getInventoryItem(item1);
249 InventoryItemBase i2 = db.getInventoryItem(item2); 249 InventoryItemBase i2 = db.getInventoryItem(item2);
250 InventoryItemBase i3 = db.getInventoryItem(item3); 250 InventoryItemBase i3 = db.getInventoryItem(item3);
@@ -263,7 +263,7 @@ namespace OpenSim.Data.Tests
263 public void T103_UpdateItem() 263 public void T103_UpdateItem()
264 { 264 {
265 TestHelpers.InMethod(); 265 TestHelpers.InMethod();
266 266
267 // TODO: probably shouldn't have the ability to have an 267 // TODO: probably shouldn't have the ability to have an
268 // owner of an item in a folder not owned by the user 268 // owner of an item in a folder not owned by the user
269 269
@@ -283,7 +283,7 @@ namespace OpenSim.Data.Tests
283 public void T104_RandomUpdateItem() 283 public void T104_RandomUpdateItem()
284 { 284 {
285 TestHelpers.InMethod(); 285 TestHelpers.InMethod();
286 286
287 PropertyScrambler<InventoryFolderBase> folderScrambler = 287 PropertyScrambler<InventoryFolderBase> folderScrambler =
288 new PropertyScrambler<InventoryFolderBase>() 288 new PropertyScrambler<InventoryFolderBase>()
289 .DontScramble(x => x.Owner) 289 .DontScramble(x => x.Owner)
@@ -342,7 +342,7 @@ namespace OpenSim.Data.Tests
342 public void T999_StillNull() 342 public void T999_StillNull()
343 { 343 {
344 TestHelpers.InMethod(); 344 TestHelpers.InMethod();
345 345
346 // After all tests are run, these should still return no results 346 // After all tests are run, these should still return no results
347 Assert.That(db.getInventoryFolder(zero), Is.Null); 347 Assert.That(db.getInventoryFolder(zero), Is.Null);
348 Assert.That(db.getInventoryItem(zero), Is.Null); 348 Assert.That(db.getInventoryItem(zero), Is.Null);
diff --git a/OpenSim/Data/Tests/PropertyScrambler.cs b/OpenSim/Data/Tests/PropertyScrambler.cs
index e0f5862..0d291df 100644
--- a/OpenSim/Data/Tests/PropertyScrambler.cs
+++ b/OpenSim/Data/Tests/PropertyScrambler.cs
@@ -42,7 +42,7 @@ namespace OpenSim.Data.Tests
42 public class PropertyScrambler<T> 42 public class PropertyScrambler<T>
43 { 43 {
44 readonly System.Collections.Generic.List<string> membersToNotScramble = new List<string>(); 44 readonly System.Collections.Generic.List<string> membersToNotScramble = new List<string>();
45 45
46 private void AddExpressionToNotScrableList(Expression expression) 46 private void AddExpressionToNotScrableList(Expression expression)
47 { 47 {
48 UnaryExpression unaryExpression = expression as UnaryExpression; 48 UnaryExpression unaryExpression = expression as UnaryExpression;
diff --git a/OpenSim/Data/Tests/RegionTests.cs b/OpenSim/Data/Tests/RegionTests.cs
index e1503d0..4f81594 100644
--- a/OpenSim/Data/Tests/RegionTests.cs
+++ b/OpenSim/Data/Tests/RegionTests.cs
@@ -83,7 +83,7 @@ namespace OpenSim.Data.Tests
83 public UUID item3 = UUID.Random(); 83 public UUID item3 = UUID.Random();
84 84
85 public static Random random = new Random(); 85 public static Random random = new Random();
86 86
87 public string itemname1 = "item1"; 87 public string itemname1 = "item1";
88 88
89 public uint localID = 1; 89 public uint localID = 1;
@@ -111,10 +111,10 @@ namespace OpenSim.Data.Tests
111 111
112 private void ClearDB() 112 private void ClearDB()
113 { 113 {
114 string[] reg_tables = new string[] { 114 string[] reg_tables = new string[] {
115 "prims", "primshapes", "primitems", "terrain", "land", "landaccesslist", "regionban", "regionsettings" 115 "prims", "primshapes", "primitems", "terrain", "land", "landaccesslist", "regionban", "regionsettings"
116 }; 116 };
117 117
118 if (m_rebuildDB) 118 if (m_rebuildDB)
119 { 119 {
120 DropTables(reg_tables); 120 DropTables(reg_tables);
@@ -145,7 +145,7 @@ namespace OpenSim.Data.Tests
145 public void T001_LoadEmpty() 145 public void T001_LoadEmpty()
146 { 146 {
147 TestHelpers.InMethod(); 147 TestHelpers.InMethod();
148 148
149 List<SceneObjectGroup> objs = db.LoadObjects(region1); 149 List<SceneObjectGroup> objs = db.LoadObjects(region1);
150 List<SceneObjectGroup> objs3 = db.LoadObjects(region3); 150 List<SceneObjectGroup> objs3 = db.LoadObjects(region3);
151 List<LandData> land = db.LoadLandObjects(region1); 151 List<LandData> land = db.LoadLandObjects(region1);
@@ -154,21 +154,21 @@ namespace OpenSim.Data.Tests
154 Assert.That(objs3.Count, Is.EqualTo(0), "Assert.That(objs3.Count, Is.EqualTo(0))"); 154 Assert.That(objs3.Count, Is.EqualTo(0), "Assert.That(objs3.Count, Is.EqualTo(0))");
155 Assert.That(land.Count, Is.EqualTo(0), "Assert.That(land.Count, Is.EqualTo(0))"); 155 Assert.That(land.Count, Is.EqualTo(0), "Assert.That(land.Count, Is.EqualTo(0))");
156 } 156 }
157 157
158 // SOG round trips 158 // SOG round trips
159 // * store objects, make sure they save 159 // * store objects, make sure they save
160 // * update 160 // * update
161 161
162 [Test] 162 [Test]
163 public void T010_StoreSimpleObject() 163 public void T010_StoreSimpleObject()
164 { 164 {
165 TestHelpers.InMethod(); 165 TestHelpers.InMethod();
166 166
167 SceneObjectGroup sog = NewSOG("object1", prim1, region1); 167 SceneObjectGroup sog = NewSOG("object1", prim1, region1);
168 SceneObjectGroup sog2 = NewSOG("object2", prim2, region1); 168 SceneObjectGroup sog2 = NewSOG("object2", prim2, region1);
169 169
170 // in case the objects don't store 170 // in case the objects don't store
171 try 171 try
172 { 172 {
173 db.StoreObject(sog, region1); 173 db.StoreObject(sog, region1);
174 } 174 }
@@ -177,8 +177,8 @@ namespace OpenSim.Data.Tests
177 m_log.Error(e.ToString()); 177 m_log.Error(e.ToString());
178 Assert.Fail(); 178 Assert.Fail();
179 } 179 }
180 180
181 try 181 try
182 { 182 {
183 db.StoreObject(sog2, region1); 183 db.StoreObject(sog2, region1);
184 } 184 }
@@ -190,15 +190,15 @@ namespace OpenSim.Data.Tests
190 190
191 // This tests the ADO.NET driver 191 // This tests the ADO.NET driver
192 List<SceneObjectGroup> objs = db.LoadObjects(region1); 192 List<SceneObjectGroup> objs = db.LoadObjects(region1);
193 193
194 Assert.That(objs.Count, Is.EqualTo(2), "Assert.That(objs.Count, Is.EqualTo(2))"); 194 Assert.That(objs.Count, Is.EqualTo(2), "Assert.That(objs.Count, Is.EqualTo(2))");
195 } 195 }
196 196
197 [Test] 197 [Test]
198 public void T011_ObjectNames() 198 public void T011_ObjectNames()
199 { 199 {
200 TestHelpers.InMethod(); 200 TestHelpers.InMethod();
201 201
202 List<SceneObjectGroup> objs = db.LoadObjects(region1); 202 List<SceneObjectGroup> objs = db.LoadObjects(region1);
203 foreach (SceneObjectGroup sog in objs) 203 foreach (SceneObjectGroup sog in objs)
204 { 204 {
@@ -207,12 +207,12 @@ namespace OpenSim.Data.Tests
207 Assert.That(p.Name, Is.EqualTo(p.Description), "Assert.That(p.Name, Is.EqualTo(p.Description))"); 207 Assert.That(p.Name, Is.EqualTo(p.Description), "Assert.That(p.Name, Is.EqualTo(p.Description))");
208 } 208 }
209 } 209 }
210 210
211 [Test] 211 [Test]
212 public void T012_SceneParts() 212 public void T012_SceneParts()
213 { 213 {
214 TestHelpers.InMethod(); 214 TestHelpers.InMethod();
215 215
216 UUID tmp0 = UUID.Random(); 216 UUID tmp0 = UUID.Random();
217 UUID tmp1 = UUID.Random(); 217 UUID tmp1 = UUID.Random();
218 UUID tmp2 = UUID.Random(); 218 UUID tmp2 = UUID.Random();
@@ -225,10 +225,10 @@ namespace OpenSim.Data.Tests
225 sog.AddPart(p1); 225 sog.AddPart(p1);
226 sog.AddPart(p2); 226 sog.AddPart(p2);
227 sog.AddPart(p3); 227 sog.AddPart(p3);
228 228
229 SceneObjectPart[] parts = sog.Parts; 229 SceneObjectPart[] parts = sog.Parts;
230 Assert.That(parts.Length,Is.EqualTo(4), "Assert.That(parts.Length,Is.EqualTo(4))"); 230 Assert.That(parts.Length,Is.EqualTo(4), "Assert.That(parts.Length,Is.EqualTo(4))");
231 231
232 db.StoreObject(sog, newregion); 232 db.StoreObject(sog, newregion);
233 List<SceneObjectGroup> sogs = db.LoadObjects(newregion); 233 List<SceneObjectGroup> sogs = db.LoadObjects(newregion);
234 Assert.That(sogs.Count,Is.EqualTo(1), "Assert.That(sogs.Count,Is.EqualTo(1))"); 234 Assert.That(sogs.Count,Is.EqualTo(1), "Assert.That(sogs.Count,Is.EqualTo(1))");
@@ -236,18 +236,18 @@ namespace OpenSim.Data.Tests
236 236
237 SceneObjectPart[] newparts = newsog.Parts; 237 SceneObjectPart[] newparts = newsog.Parts;
238 Assert.That(newparts.Length,Is.EqualTo(4), "Assert.That(newparts.Length,Is.EqualTo(4))"); 238 Assert.That(newparts.Length,Is.EqualTo(4), "Assert.That(newparts.Length,Is.EqualTo(4))");
239 239
240 Assert.That(newsog.ContainsPart(tmp0), "Assert.That(newsog.ContainsPart(tmp0))"); 240 Assert.That(newsog.ContainsPart(tmp0), "Assert.That(newsog.ContainsPart(tmp0))");
241 Assert.That(newsog.ContainsPart(tmp1), "Assert.That(newsog.ContainsPart(tmp1))"); 241 Assert.That(newsog.ContainsPart(tmp1), "Assert.That(newsog.ContainsPart(tmp1))");
242 Assert.That(newsog.ContainsPart(tmp2), "Assert.That(newsog.ContainsPart(tmp2))"); 242 Assert.That(newsog.ContainsPart(tmp2), "Assert.That(newsog.ContainsPart(tmp2))");
243 Assert.That(newsog.ContainsPart(tmp3), "Assert.That(newsog.ContainsPart(tmp3))"); 243 Assert.That(newsog.ContainsPart(tmp3), "Assert.That(newsog.ContainsPart(tmp3))");
244 } 244 }
245 245
246 [Test] 246 [Test]
247 public void T013_DatabasePersistency() 247 public void T013_DatabasePersistency()
248 { 248 {
249 TestHelpers.InMethod(); 249 TestHelpers.InMethod();
250 250
251 // Sets all ScenePart parameters, stores and retrieves them, then check for consistency with initial data 251 // Sets all ScenePart parameters, stores and retrieves them, then check for consistency with initial data
252 // The commented Asserts are the ones that are unchangeable (when storing on the database, their "Set" values are ignored 252 // The commented Asserts are the ones that are unchangeable (when storing on the database, their "Set" values are ignored
253 // The ObjectFlags is an exception, if it is entered incorrectly, the object IS REJECTED on the database silently. 253 // The ObjectFlags is an exception, if it is entered incorrectly, the object IS REJECTED on the database silently.
@@ -298,7 +298,7 @@ namespace OpenSim.Data.Tests
298 298
299 SceneObjectPart sop = new SceneObjectPart(); 299 SceneObjectPart sop = new SceneObjectPart();
300 SceneObjectGroup sog = new SceneObjectGroup(sop); 300 SceneObjectGroup sog = new SceneObjectGroup(sop);
301 301
302 sop.RegionHandle = regionh; 302 sop.RegionHandle = regionh;
303 sop.UUID = uuid; 303 sop.UUID = uuid;
304 sop.LocalId = localid; 304 sop.LocalId = localid;
@@ -360,10 +360,10 @@ namespace OpenSim.Data.Tests
360 Assert.That(linknum,Is.EqualTo(sop.LinkNum), "Assert.That(linknum,Is.EqualTo(sop.LinkNum))"); 360 Assert.That(linknum,Is.EqualTo(sop.LinkNum), "Assert.That(linknum,Is.EqualTo(sop.LinkNum))");
361 Assert.That(clickaction,Is.EqualTo(sop.ClickAction), "Assert.That(clickaction,Is.EqualTo(sop.ClickAction))"); 361 Assert.That(clickaction,Is.EqualTo(sop.ClickAction), "Assert.That(clickaction,Is.EqualTo(sop.ClickAction))");
362 Assert.That(scale,Is.EqualTo(sop.Scale), "Assert.That(scale,Is.EqualTo(sop.Scale))"); 362 Assert.That(scale,Is.EqualTo(sop.Scale), "Assert.That(scale,Is.EqualTo(sop.Scale))");
363 363
364 // This is necessary or object will not be inserted in DB 364 // This is necessary or object will not be inserted in DB
365 sop.Flags = PrimFlags.None; 365 sop.Flags = PrimFlags.None;
366 366
367 // Inserts group in DB 367 // Inserts group in DB
368 db.StoreObject(sog,region3); 368 db.StoreObject(sog,region3);
369 List<SceneObjectGroup> sogs = db.LoadObjects(region3); 369 List<SceneObjectGroup> sogs = db.LoadObjects(region3);
@@ -372,7 +372,7 @@ namespace OpenSim.Data.Tests
372 db.StoreObject(sog,region3); 372 db.StoreObject(sog,region3);
373 sogs = db.LoadObjects(region3); 373 sogs = db.LoadObjects(region3);
374 Assert.That(sogs.Count, Is.EqualTo(1), "Assert.That(sogs.Count, Is.EqualTo(1))"); 374 Assert.That(sogs.Count, Is.EqualTo(1), "Assert.That(sogs.Count, Is.EqualTo(1))");
375 375
376 376
377 // Tests if the parameters were inserted correctly 377 // Tests if the parameters were inserted correctly
378 SceneObjectPart p = sogs[0].RootPart; 378 SceneObjectPart p = sogs[0].RootPart;
@@ -414,12 +414,12 @@ namespace OpenSim.Data.Tests
414 Assert.That(pbshap.ProfileEnd, Is.EqualTo(p.Shape.ProfileEnd), "Assert.That(pbshap.ProfileEnd, Is.EqualTo(p.Shape.ProfileEnd))"); 414 Assert.That(pbshap.ProfileEnd, Is.EqualTo(p.Shape.ProfileEnd), "Assert.That(pbshap.ProfileEnd, Is.EqualTo(p.Shape.ProfileEnd))");
415 Assert.That(pbshap.ProfileHollow, Is.EqualTo(p.Shape.ProfileHollow), "Assert.That(pbshap.ProfileHollow, Is.EqualTo(p.Shape.ProfileHollow))"); 415 Assert.That(pbshap.ProfileHollow, Is.EqualTo(p.Shape.ProfileHollow), "Assert.That(pbshap.ProfileHollow, Is.EqualTo(p.Shape.ProfileHollow))");
416 } 416 }
417 417
418 [Test] 418 [Test]
419 public void T014_UpdateObject() 419 public void T014_UpdateObject()
420 { 420 {
421 TestHelpers.InMethod(); 421 TestHelpers.InMethod();
422 422
423 string text1 = "object1 text"; 423 string text1 = "object1 text";
424 SceneObjectGroup sog = FindSOG("object1", region1); 424 SceneObjectGroup sog = FindSOG("object1", region1);
425 sog.RootPart.Text = text1; 425 sog.RootPart.Text = text1;
@@ -459,7 +459,7 @@ namespace OpenSim.Data.Tests
459 PrimitiveBaseShape pbshap = new PrimitiveBaseShape(); 459 PrimitiveBaseShape pbshap = new PrimitiveBaseShape();
460 pbshap = PrimitiveBaseShape.Default; 460 pbshap = PrimitiveBaseShape.Default;
461 Vector3 scale = new Vector3(random.Next(),random.Next(),random.Next()); 461 Vector3 scale = new Vector3(random.Next(),random.Next(),random.Next());
462 462
463 // Updates the region with new values 463 // Updates the region with new values
464 SceneObjectGroup sog2 = FindSOG("Adam West", region3); 464 SceneObjectGroup sog2 = FindSOG("Adam West", region3);
465 Assert.That(sog2,Is.Not.Null); 465 Assert.That(sog2,Is.Not.Null);
@@ -488,11 +488,11 @@ namespace OpenSim.Data.Tests
488 sog2.RootPart.LinkNum = linknum; 488 sog2.RootPart.LinkNum = linknum;
489 sog2.RootPart.ClickAction = clickaction; 489 sog2.RootPart.ClickAction = clickaction;
490 sog2.RootPart.Scale = scale; 490 sog2.RootPart.Scale = scale;
491 491
492 db.StoreObject(sog2, region3); 492 db.StoreObject(sog2, region3);
493 List<SceneObjectGroup> sogs = db.LoadObjects(region3); 493 List<SceneObjectGroup> sogs = db.LoadObjects(region3);
494 Assert.That(sogs.Count, Is.EqualTo(1), "Assert.That(sogs.Count, Is.EqualTo(1))"); 494 Assert.That(sogs.Count, Is.EqualTo(1), "Assert.That(sogs.Count, Is.EqualTo(1))");
495 495
496 SceneObjectGroup retsog = FindSOG("West Adam", region3); 496 SceneObjectGroup retsog = FindSOG("West Adam", region3);
497 Assert.That(retsog,Is.Not.Null); 497 Assert.That(retsog,Is.Not.Null);
498 SceneObjectPart p = retsog.RootPart; 498 SceneObjectPart p = retsog.RootPart;
@@ -519,7 +519,7 @@ namespace OpenSim.Data.Tests
519 Assert.That(clickaction,Is.EqualTo(p.ClickAction), "Assert.That(clickaction,Is.EqualTo(p.ClickAction))"); 519 Assert.That(clickaction,Is.EqualTo(p.ClickAction), "Assert.That(clickaction,Is.EqualTo(p.ClickAction))");
520 Assert.That(scale,Is.EqualTo(p.Scale), "Assert.That(scale,Is.EqualTo(p.Scale))"); 520 Assert.That(scale,Is.EqualTo(p.Scale), "Assert.That(scale,Is.EqualTo(p.Scale))");
521 } 521 }
522 522
523 /// <summary> 523 /// <summary>
524 /// Test storage and retrieval of a scene object with a large number of parts. 524 /// Test storage and retrieval of a scene object with a large number of parts.
525 /// </summary> 525 /// </summary>
@@ -527,12 +527,12 @@ namespace OpenSim.Data.Tests
527 public void T015_LargeSceneObjects() 527 public void T015_LargeSceneObjects()
528 { 528 {
529 TestHelpers.InMethod(); 529 TestHelpers.InMethod();
530 530
531 UUID id = UUID.Random(); 531 UUID id = UUID.Random();
532 Dictionary<UUID, SceneObjectPart> mydic = new Dictionary<UUID, SceneObjectPart>(); 532 Dictionary<UUID, SceneObjectPart> mydic = new Dictionary<UUID, SceneObjectPart>();
533 SceneObjectGroup sog = NewSOG("Test SOG", id, region4); 533 SceneObjectGroup sog = NewSOG("Test SOG", id, region4);
534 mydic.Add(sog.RootPart.UUID,sog.RootPart); 534 mydic.Add(sog.RootPart.UUID,sog.RootPart);
535 for (int i = 0; i < 30; i++) 535 for (int i = 0; i < 30; i++)
536 { 536 {
537 UUID tmp = UUID.Random(); 537 UUID tmp = UUID.Random();
538 SceneObjectPart sop = NewSOP(("Test SOP " + i.ToString()),tmp); 538 SceneObjectPart sop = NewSOP(("Test SOP " + i.ToString()),tmp);
@@ -542,20 +542,20 @@ namespace OpenSim.Data.Tests
542 Vector3 velocity = new Vector3(random.Next(),random.Next(),random.Next()); 542 Vector3 velocity = new Vector3(random.Next(),random.Next(),random.Next());
543 Vector3 angvelo = new Vector3(random.Next(),random.Next(),random.Next()); 543 Vector3 angvelo = new Vector3(random.Next(),random.Next(),random.Next());
544 Vector3 accel = new Vector3(random.Next(),random.Next(),random.Next()); 544 Vector3 accel = new Vector3(random.Next(),random.Next(),random.Next());
545 545
546 sop.GroupPosition = groupos; 546 sop.GroupPosition = groupos;
547 sop.RotationOffset = rotoff; 547 sop.RotationOffset = rotoff;
548 sop.OffsetPosition = offset; 548 sop.OffsetPosition = offset;
549 sop.Velocity = velocity; 549 sop.Velocity = velocity;
550 sop.AngularVelocity = angvelo; 550 sop.AngularVelocity = angvelo;
551 sop.Acceleration = accel; 551 sop.Acceleration = accel;
552 552
553 mydic.Add(tmp,sop); 553 mydic.Add(tmp,sop);
554 sog.AddPart(sop); 554 sog.AddPart(sop);
555 } 555 }
556 556
557 db.StoreObject(sog, region4); 557 db.StoreObject(sog, region4);
558 558
559 SceneObjectGroup retsog = FindSOG("Test SOG", region4); 559 SceneObjectGroup retsog = FindSOG("Test SOG", region4);
560 SceneObjectPart[] parts = retsog.Parts; 560 SceneObjectPart[] parts = retsog.Parts;
561 for (int i = 0; i < 30; i++) 561 for (int i = 0; i < 30; i++)
@@ -574,7 +574,7 @@ namespace OpenSim.Data.Tests
574 public void T016_RandomSogWithSceneParts() 574 public void T016_RandomSogWithSceneParts()
575 { 575 {
576 TestHelpers.InMethod(); 576 TestHelpers.InMethod();
577 577
578 PropertyScrambler<SceneObjectPart> scrambler = 578 PropertyScrambler<SceneObjectPart> scrambler =
579 new PropertyScrambler<SceneObjectPart>() 579 new PropertyScrambler<SceneObjectPart>()
580 .DontScramble(x => x.UUID); 580 .DontScramble(x => x.UUID);
@@ -634,22 +634,22 @@ namespace OpenSim.Data.Tests
634 SceneObjectGroup sog = FindSOG(name, region1); 634 SceneObjectGroup sog = FindSOG(name, region1);
635 if (sog == null) 635 if (sog == null)
636 { 636 {
637 sog = NewSOG(name, prim1, region1); 637 sog = NewSOG(name, prim1, region1);
638 db.StoreObject(sog, region1); 638 db.StoreObject(sog, region1);
639 } 639 }
640 return sog; 640 return sog;
641 } 641 }
642 642
643 // NOTE: it is a bad practice to rely on some of the previous tests having been run before. 643 // NOTE: it is a bad practice to rely on some of the previous tests having been run before.
644 // If the tests are run manually, one at a time, each starts with full class init (DB cleared). 644 // If the tests are run manually, one at a time, each starts with full class init (DB cleared).
645 // Even when all tests are run, NUnit 2.5+ no longer guarantee a specific test order. 645 // Even when all tests are run, NUnit 2.5+ no longer guarantee a specific test order.
646 // We shouldn't expect to find anything in the DB if we haven't put it there *in the same test*! 646 // We shouldn't expect to find anything in the DB if we haven't put it there *in the same test*!
647 647
648 [Test] 648 [Test]
649 public void T020_PrimInventoryEmpty() 649 public void T020_PrimInventoryEmpty()
650 { 650 {
651 TestHelpers.InMethod(); 651 TestHelpers.InMethod();
652 652
653 SceneObjectGroup sog = GetMySOG("object1"); 653 SceneObjectGroup sog = GetMySOG("object1");
654 TaskInventoryItem t = sog.GetInventoryItem(sog.RootPart.LocalId, item1); 654 TaskInventoryItem t = sog.GetInventoryItem(sog.RootPart.LocalId, item1);
655 Assert.That(t, Is.Null); 655 Assert.That(t, Is.Null);
@@ -673,14 +673,14 @@ namespace OpenSim.Data.Tests
673 public void T021_PrimInventoryBasic() 673 public void T021_PrimInventoryBasic()
674 { 674 {
675 TestHelpers.InMethod(); 675 TestHelpers.InMethod();
676 676
677 SceneObjectGroup sog = GetMySOG("object1"); 677 SceneObjectGroup sog = GetMySOG("object1");
678 InventoryItemBase i = NewItem(item1, zero, zero, itemname1, zero); 678 InventoryItemBase i = NewItem(item1, zero, zero, itemname1, zero);
679 679
680 Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, i, zero), Is.True); 680 Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, i, zero), Is.True);
681 TaskInventoryItem t = sog.GetInventoryItem(sog.RootPart.LocalId, item1); 681 TaskInventoryItem t = sog.GetInventoryItem(sog.RootPart.LocalId, item1);
682 Assert.That(t.Name, Is.EqualTo(itemname1), "Assert.That(t.Name, Is.EqualTo(itemname1))"); 682 Assert.That(t.Name, Is.EqualTo(itemname1), "Assert.That(t.Name, Is.EqualTo(itemname1))");
683 683
684 StoreInventory(sog); 684 StoreInventory(sog);
685 685
686 SceneObjectGroup sog1 = FindSOG("object1", region1); 686 SceneObjectGroup sog1 = FindSOG("object1", region1);
@@ -708,12 +708,12 @@ namespace OpenSim.Data.Tests
708 t = sog.GetInventoryItem(sog.RootPart.LocalId, item1); 708 t = sog.GetInventoryItem(sog.RootPart.LocalId, item1);
709 Assert.That(t, Is.Null); 709 Assert.That(t, Is.Null);
710 } 710 }
711 711
712 [Test] 712 [Test]
713 public void T025_PrimInventoryPersistency() 713 public void T025_PrimInventoryPersistency()
714 { 714 {
715 TestHelpers.InMethod(); 715 TestHelpers.InMethod();
716 716
717 InventoryItemBase i = new InventoryItemBase(); 717 InventoryItemBase i = new InventoryItemBase();
718 UUID id = UUID.Random(); 718 UUID id = UUID.Random();
719 i.ID = id; 719 i.ID = id;
@@ -752,11 +752,11 @@ namespace OpenSim.Data.Tests
752 i.Flags = flags; 752 i.Flags = flags;
753 int creationd = random.Next(); 753 int creationd = random.Next();
754 i.CreationDate = creationd; 754 i.CreationDate = creationd;
755 755
756 SceneObjectGroup sog = GetMySOG("object1"); 756 SceneObjectGroup sog = GetMySOG("object1");
757 Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, i, zero), Is.True); 757 Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, i, zero), Is.True);
758 TaskInventoryItem t = sog.GetInventoryItem(sog.RootPart.LocalId, id); 758 TaskInventoryItem t = sog.GetInventoryItem(sog.RootPart.LocalId, id);
759 759
760 Assert.That(t.Name, Is.EqualTo(name), "Assert.That(t.Name, Is.EqualTo(name))"); 760 Assert.That(t.Name, Is.EqualTo(name), "Assert.That(t.Name, Is.EqualTo(name))");
761 Assert.That(t.AssetID,Is.EqualTo(assetid), "Assert.That(t.AssetID,Is.EqualTo(assetid))"); 761 Assert.That(t.AssetID,Is.EqualTo(assetid), "Assert.That(t.AssetID,Is.EqualTo(assetid))");
762 Assert.That(t.BasePermissions,Is.EqualTo(baseperm), "Assert.That(t.BasePermissions,Is.EqualTo(baseperm))"); 762 Assert.That(t.BasePermissions,Is.EqualTo(baseperm), "Assert.That(t.BasePermissions,Is.EqualTo(baseperm))");
@@ -780,13 +780,13 @@ namespace OpenSim.Data.Tests
780 Assert.That(t.ParentID,Is.EqualTo(sog.RootPart.FolderID), "Assert.That(t.ParentID,Is.EqualTo(sog.RootPart.FolderID))"); 780 Assert.That(t.ParentID,Is.EqualTo(sog.RootPart.FolderID), "Assert.That(t.ParentID,Is.EqualTo(sog.RootPart.FolderID))");
781 Assert.That(t.ParentPartID,Is.EqualTo(sog.RootPart.UUID), "Assert.That(t.ParentPartID,Is.EqualTo(sog.RootPart.UUID))"); 781 Assert.That(t.ParentPartID,Is.EqualTo(sog.RootPart.UUID), "Assert.That(t.ParentPartID,Is.EqualTo(sog.RootPart.UUID))");
782 } 782 }
783 783
784 [Test] 784 [Test]
785 [ExpectedException(typeof(ArgumentException))] 785 [ExpectedException(typeof(ArgumentException))]
786 public void T026_PrimInventoryMany() 786 public void T026_PrimInventoryMany()
787 { 787 {
788 TestHelpers.InMethod(); 788 TestHelpers.InMethod();
789 789
790 UUID i1,i2,i3,i4; 790 UUID i1,i2,i3,i4;
791 i1 = UUID.Random(); 791 i1 = UUID.Random();
792 i2 = UUID.Random(); 792 i2 = UUID.Random();
@@ -796,14 +796,14 @@ namespace OpenSim.Data.Tests
796 InventoryItemBase ib2 = NewItem(i2, zero, zero, RandomName(), zero); 796 InventoryItemBase ib2 = NewItem(i2, zero, zero, RandomName(), zero);
797 InventoryItemBase ib3 = NewItem(i3, zero, zero, RandomName(), zero); 797 InventoryItemBase ib3 = NewItem(i3, zero, zero, RandomName(), zero);
798 InventoryItemBase ib4 = NewItem(i4, zero, zero, RandomName(), zero); 798 InventoryItemBase ib4 = NewItem(i4, zero, zero, RandomName(), zero);
799 799
800 SceneObjectGroup sog = FindSOG("object1", region1); 800 SceneObjectGroup sog = FindSOG("object1", region1);
801 801
802 Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, ib1, zero), Is.True); 802 Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, ib1, zero), Is.True);
803 Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, ib2, zero), Is.True); 803 Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, ib2, zero), Is.True);
804 Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, ib3, zero), Is.True); 804 Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, ib3, zero), Is.True);
805 Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, ib4, zero), Is.True); 805 Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, ib4, zero), Is.True);
806 806
807 TaskInventoryItem t1 = sog.GetInventoryItem(sog.RootPart.LocalId, i1); 807 TaskInventoryItem t1 = sog.GetInventoryItem(sog.RootPart.LocalId, i1);
808 Assert.That(t1.Name, Is.EqualTo(ib1.Name), "Assert.That(t1.Name, Is.EqualTo(ib1.Name))"); 808 Assert.That(t1.Name, Is.EqualTo(ib1.Name), "Assert.That(t1.Name, Is.EqualTo(ib1.Name))");
809 TaskInventoryItem t2 = sog.GetInventoryItem(sog.RootPart.LocalId, i2); 809 TaskInventoryItem t2 = sog.GetInventoryItem(sog.RootPart.LocalId, i2);
@@ -818,7 +818,7 @@ namespace OpenSim.Data.Tests
818 public void T052_RemoveObject() 818 public void T052_RemoveObject()
819 { 819 {
820 TestHelpers.InMethod(); 820 TestHelpers.InMethod();
821 821
822 db.RemoveObject(prim1, region1); 822 db.RemoveObject(prim1, region1);
823 SceneObjectGroup sog = FindSOG("object1", region1); 823 SceneObjectGroup sog = FindSOG("object1", region1);
824 Assert.That(sog, Is.Null); 824 Assert.That(sog, Is.Null);
@@ -828,7 +828,7 @@ namespace OpenSim.Data.Tests
828 public void T100_DefaultRegionInfo() 828 public void T100_DefaultRegionInfo()
829 { 829 {
830 TestHelpers.InMethod(); 830 TestHelpers.InMethod();
831 831
832 RegionSettings r1 = db.LoadRegionSettings(region1); 832 RegionSettings r1 = db.LoadRegionSettings(region1);
833 Assert.That(r1.RegionUUID, Is.EqualTo(region1), "Assert.That(r1.RegionUUID, Is.EqualTo(region1))"); 833 Assert.That(r1.RegionUUID, Is.EqualTo(region1), "Assert.That(r1.RegionUUID, Is.EqualTo(region1))");
834 834
@@ -840,7 +840,7 @@ namespace OpenSim.Data.Tests
840 public void T101_UpdateRegionInfo() 840 public void T101_UpdateRegionInfo()
841 { 841 {
842 TestHelpers.InMethod(); 842 TestHelpers.InMethod();
843 843
844 int agentlimit = random.Next(); 844 int agentlimit = random.Next();
845 double objectbonus = random.Next(); 845 double objectbonus = random.Next();
846 int maturity = random.Next(); 846 int maturity = random.Next();
@@ -900,9 +900,9 @@ namespace OpenSim.Data.Tests
900 r1.FixedSun = true; 900 r1.FixedSun = true;
901 r1.SunPosition = sunpos; 901 r1.SunPosition = sunpos;
902 r1.Covenant = cov; 902 r1.Covenant = cov;
903 903
904 db.StoreRegionSettings(r1); 904 db.StoreRegionSettings(r1);
905 905
906 RegionSettings r1a = db.LoadRegionSettings(region1); 906 RegionSettings r1a = db.LoadRegionSettings(region1);
907 Assert.That(r1a.RegionUUID, Is.EqualTo(region1), "Assert.That(r1a.RegionUUID, Is.EqualTo(region1))"); 907 Assert.That(r1a.RegionUUID, Is.EqualTo(region1), "Assert.That(r1a.RegionUUID, Is.EqualTo(region1))");
908 Assert.That(r1a.BlockTerraform,Is.True); 908 Assert.That(r1a.BlockTerraform,Is.True);
@@ -939,14 +939,14 @@ namespace OpenSim.Data.Tests
939 //Assert.That(r1a.TerrainImageID,Is.EqualTo(terimgid), "Assert.That(r1a.TerrainImageID,Is.EqualTo(terimgid))"); 939 //Assert.That(r1a.TerrainImageID,Is.EqualTo(terimgid), "Assert.That(r1a.TerrainImageID,Is.EqualTo(terimgid))");
940 Assert.That(r1a.FixedSun,Is.True); 940 Assert.That(r1a.FixedSun,Is.True);
941 Assert.That(r1a.SunPosition, Is.EqualTo(sunpos), "Assert.That(r1a.SunPosition, Is.EqualTo(sunpos))"); 941 Assert.That(r1a.SunPosition, Is.EqualTo(sunpos), "Assert.That(r1a.SunPosition, Is.EqualTo(sunpos))");
942 Assert.That(r1a.Covenant, Is.EqualTo(cov), "Assert.That(r1a.Covenant, Is.EqualTo(cov))"); 942 Assert.That(r1a.Covenant, Is.EqualTo(cov), "Assert.That(r1a.Covenant, Is.EqualTo(cov))");
943 } 943 }
944 944
945 [Test] 945 [Test]
946 public void T300_NoTerrain() 946 public void T300_NoTerrain()
947 { 947 {
948 TestHelpers.InMethod(); 948 TestHelpers.InMethod();
949 949
950 Assert.That(db.LoadTerrain(zero), Is.Null); 950 Assert.That(db.LoadTerrain(zero), Is.Null);
951 Assert.That(db.LoadTerrain(region1), Is.Null); 951 Assert.That(db.LoadTerrain(region1), Is.Null);
952 Assert.That(db.LoadTerrain(region2), Is.Null); 952 Assert.That(db.LoadTerrain(region2), Is.Null);
@@ -957,13 +957,13 @@ namespace OpenSim.Data.Tests
957 public void T301_CreateTerrain() 957 public void T301_CreateTerrain()
958 { 958 {
959 TestHelpers.InMethod(); 959 TestHelpers.InMethod();
960 960
961 double[,] t1 = GenTerrain(height1); 961 double[,] t1 = GenTerrain(height1);
962 db.StoreTerrain(t1, region1); 962 db.StoreTerrain(t1, region1);
963 963
964 // store terrain is async 964 // store terrain is async
965 Thread.Sleep(1000); 965 Thread.Sleep(1000);
966 966
967 Assert.That(db.LoadTerrain(zero), Is.Null); 967 Assert.That(db.LoadTerrain(zero), Is.Null);
968 Assert.That(db.LoadTerrain(region1), Is.Not.Null); 968 Assert.That(db.LoadTerrain(region1), Is.Not.Null);
969 Assert.That(db.LoadTerrain(region2), Is.Null); 969 Assert.That(db.LoadTerrain(region2), Is.Null);
@@ -974,7 +974,7 @@ namespace OpenSim.Data.Tests
974 public void T302_FetchTerrain() 974 public void T302_FetchTerrain()
975 { 975 {
976 TestHelpers.InMethod(); 976 TestHelpers.InMethod();
977 977
978 double[,] baseterrain1 = GenTerrain(height1); 978 double[,] baseterrain1 = GenTerrain(height1);
979 double[,] baseterrain2 = GenTerrain(height2); 979 double[,] baseterrain2 = GenTerrain(height2);
980 double[,] t1 = db.LoadTerrain(region1); 980 double[,] t1 = db.LoadTerrain(region1);
@@ -986,7 +986,7 @@ namespace OpenSim.Data.Tests
986 public void T303_UpdateTerrain() 986 public void T303_UpdateTerrain()
987 { 987 {
988 TestHelpers.InMethod(); 988 TestHelpers.InMethod();
989 989
990 double[,] baseterrain1 = GenTerrain(height1); 990 double[,] baseterrain1 = GenTerrain(height1);
991 double[,] baseterrain2 = GenTerrain(height2); 991 double[,] baseterrain2 = GenTerrain(height2);
992 db.StoreTerrain(baseterrain2, region1); 992 db.StoreTerrain(baseterrain2, region1);
@@ -1003,7 +1003,7 @@ namespace OpenSim.Data.Tests
1003 public void T400_EmptyLand() 1003 public void T400_EmptyLand()
1004 { 1004 {
1005 TestHelpers.InMethod(); 1005 TestHelpers.InMethod();
1006 1006
1007 Assert.That(db.LoadLandObjects(zero).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(zero).Count, Is.EqualTo(0))"); 1007 Assert.That(db.LoadLandObjects(zero).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(zero).Count, Is.EqualTo(0))");
1008 Assert.That(db.LoadLandObjects(region1).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(region1).Count, Is.EqualTo(0))"); 1008 Assert.That(db.LoadLandObjects(region1).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(region1).Count, Is.EqualTo(0))");
1009 Assert.That(db.LoadLandObjects(region2).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(region2).Count, Is.EqualTo(0))"); 1009 Assert.That(db.LoadLandObjects(region2).Count, Is.EqualTo(0), "Assert.That(db.LoadLandObjects(region2).Count, Is.EqualTo(0))");
@@ -1025,15 +1025,15 @@ namespace OpenSim.Data.Tests
1025 for (int x = 0; x < Constants.RegionSize; x++) 1025 for (int x = 0; x < Constants.RegionSize; x++)
1026 for (int y = 0; y < Constants.RegionSize; y++) 1026 for (int y = 0; y < Constants.RegionSize; y++)
1027 terret[x,y] = value; 1027 terret[x,y] = value;
1028 1028
1029 return terret; 1029 return terret;
1030 } 1030 }
1031 1031
1032 private bool CompareTerrain(double[,] one, double[,] two) 1032 private bool CompareTerrain(double[,] one, double[,] two)
1033 { 1033 {
1034 for (int x = 0; x < Constants.RegionSize; x++) 1034 for (int x = 0; x < Constants.RegionSize; x++)
1035 for (int y = 0; y < Constants.RegionSize; y++) 1035 for (int y = 0; y < Constants.RegionSize; y++)
1036 if (one[x,y] != two[x,y]) 1036 if (one[x,y] != two[x,y])
1037 return false; 1037 return false;
1038 1038
1039 return true; 1039 return true;
@@ -1053,12 +1053,12 @@ namespace OpenSim.Data.Tests
1053 // common failure case is people adding new fields that aren't 1053 // common failure case is people adding new fields that aren't
1054 // initialized, but have non-null db constraints. We should 1054 // initialized, but have non-null db constraints. We should
1055 // honestly be passing more and more null things in here. 1055 // honestly be passing more and more null things in here.
1056 // 1056 //
1057 // Please note that in Sqlite.BuildPrim there is a commented out inline version 1057 // Please note that in Sqlite.BuildPrim there is a commented out inline version
1058 // of this so you can debug and step through the build process and check the fields 1058 // of this so you can debug and step through the build process and check the fields
1059 // 1059 //
1060 // Real World Value: Tests for situation where extending a SceneObjectGroup/SceneObjectPart 1060 // Real World Value: Tests for situation where extending a SceneObjectGroup/SceneObjectPart
1061 // causes the application to crash at the database layer because of null values 1061 // causes the application to crash at the database layer because of null values
1062 // in NOT NULL fields 1062 // in NOT NULL fields
1063 // 1063 //
1064 private SceneObjectGroup NewSOG(string name, UUID uuid, UUID regionId) 1064 private SceneObjectGroup NewSOG(string name, UUID uuid, UUID regionId)
@@ -1082,7 +1082,7 @@ namespace OpenSim.Data.Tests
1082 1082
1083 return sog; 1083 return sog;
1084 } 1084 }
1085 1085
1086 private SceneObjectPart NewSOP(string name, UUID uuid) 1086 private SceneObjectPart NewSOP(string name, UUID uuid)
1087 { 1087 {
1088 SceneObjectPart sop = new SceneObjectPart(); 1088 SceneObjectPart sop = new SceneObjectPart();
@@ -1096,7 +1096,7 @@ namespace OpenSim.Data.Tests
1096 return sop; 1096 return sop;
1097 } 1097 }
1098 1098
1099 // These are copied from the Inventory Item tests 1099 // These are copied from the Inventory Item tests
1100 1100
1101 private InventoryItemBase NewItem(UUID id, UUID parent, UUID owner, string name, UUID asset) 1101 private InventoryItemBase NewItem(UUID id, UUID parent, UUID owner, string name, UUID asset)
1102 { 1102 {
@@ -1114,7 +1114,7 @@ namespace OpenSim.Data.Tests
1114 private static string RandomName() 1114 private static string RandomName()
1115 { 1115 {
1116 StringBuilder name = new StringBuilder(); 1116 StringBuilder name = new StringBuilder();
1117 int size = random.Next(5,12); 1117 int size = random.Next(5,12);
1118 char ch ; 1118 char ch ;
1119 for (int i=0; i<size; i++) 1119 for (int i=0; i<size; i++)
1120 { 1120 {