diff options
author | Melanie Thielker | 2017-01-05 19:07:37 +0000 |
---|---|---|
committer | Melanie Thielker | 2017-01-05 19:07:37 +0000 |
commit | b16abc8166c29585cb76cc55c3bdd76e5833cb4f (patch) | |
tree | 6a34f465a74b7a3a6dc00a3d7aa8dcc25ac3e3a5 /OpenSim/Data/PGSQL | |
parent | Make it possible to disable the bakes module in the way it is described in co... (diff) | |
download | opensim-SC-b16abc8166c29585cb76cc55c3bdd76e5833cb4f.zip opensim-SC-b16abc8166c29585cb76cc55c3bdd76e5833cb4f.tar.gz opensim-SC-b16abc8166c29585cb76cc55c3bdd76e5833cb4f.tar.bz2 opensim-SC-b16abc8166c29585cb76cc55c3bdd76e5833cb4f.tar.xz |
Massive tab and trailing space cleanup
Diffstat (limited to 'OpenSim/Data/PGSQL')
-rw-r--r-- | OpenSim/Data/PGSQL/PGSQLAssetData.cs | 18 | ||||
-rw-r--r-- | OpenSim/Data/PGSQL/PGSQLAuthenticationData.cs | 6 | ||||
-rw-r--r-- | OpenSim/Data/PGSQL/PGSQLAvatarData.cs | 2 | ||||
-rw-r--r-- | OpenSim/Data/PGSQL/PGSQLEstateData.cs | 2 | ||||
-rw-r--r-- | OpenSim/Data/PGSQL/PGSQLFriendsData.cs | 6 | ||||
-rw-r--r-- | OpenSim/Data/PGSQL/PGSQLGenericTableHandler.cs | 14 | ||||
-rwxr-xr-x | OpenSim/Data/PGSQL/PGSQLGroupsData.cs | 36 | ||||
-rw-r--r-- | OpenSim/Data/PGSQL/PGSQLInventoryData.cs | 58 | ||||
-rw-r--r-- | OpenSim/Data/PGSQL/PGSQLManager.cs | 2 | ||||
-rw-r--r-- | OpenSim/Data/PGSQL/PGSQLMigration.cs | 4 | ||||
-rw-r--r-- | OpenSim/Data/PGSQL/PGSQLOfflineIMData.cs | 2 | ||||
-rwxr-xr-x | OpenSim/Data/PGSQL/PGSQLPresenceData.cs | 4 | ||||
-rw-r--r-- | OpenSim/Data/PGSQL/PGSQLRegionData.cs | 14 | ||||
-rwxr-xr-x | OpenSim/Data/PGSQL/PGSQLSimulationData.cs | 156 | ||||
-rw-r--r-- | OpenSim/Data/PGSQL/PGSQLUserAccountData.cs | 20 | ||||
-rw-r--r-- | OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs | 12 | ||||
-rw-r--r-- | OpenSim/Data/PGSQL/PGSQLXAssetData.cs | 24 | ||||
-rw-r--r-- | OpenSim/Data/PGSQL/PGSQLXInventoryData.cs | 14 |
18 files changed, 197 insertions, 197 deletions
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; | |||
37 | namespace OpenSim.Data.PGSQL | 37 | namespace 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)); |