diff options
author | Justin Clark-Casey (justincc) | 2013-10-15 23:18:50 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-10-15 23:18:50 +0100 |
commit | d82d6bb1ec51dbdcbd99d365fa80148b931c1e2d (patch) | |
tree | 710e8dfb90f3beac84ca436b853db0381f05cbd2 | |
parent | Added support for attachments to group notices when using Flotsam groups. (diff) | |
parent | * Fixes mantis #6802 Simulator crashes whist loading (lighshare enabled) (diff) | |
download | opensim-SC-d82d6bb1ec51dbdcbd99d365fa80148b931c1e2d.zip opensim-SC-d82d6bb1ec51dbdcbd99d365fa80148b931c1e2d.tar.gz opensim-SC-d82d6bb1ec51dbdcbd99d365fa80148b931c1e2d.tar.bz2 opensim-SC-d82d6bb1ec51dbdcbd99d365fa80148b931c1e2d.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/PGSQL/PGSQLEstateData.cs | 14 | ||||
-rw-r--r-- | OpenSim/Data/PGSQL/PGSQLSimulationData.cs | 8 | ||||
-rw-r--r-- | OpenSim/Data/PGSQL/Resources/InventoryStore.migrations | 9 | ||||
-rw-r--r-- | OpenSim/Data/PGSQL/Resources/RegionStore.migrations | 18 |
4 files changed, 40 insertions, 9 deletions
diff --git a/OpenSim/Data/PGSQL/PGSQLEstateData.cs b/OpenSim/Data/PGSQL/PGSQLEstateData.cs index 347baf3..141b8ed 100644 --- a/OpenSim/Data/PGSQL/PGSQLEstateData.cs +++ b/OpenSim/Data/PGSQL/PGSQLEstateData.cs | |||
@@ -201,11 +201,10 @@ namespace OpenSim.Data.PGSQL | |||
201 | 201 | ||
202 | string sql = string.Format("insert into estate_settings (\"{0}\") values ( :{1} )", String.Join("\",\"", names.ToArray()), String.Join(", :", names.ToArray())); | 202 | string sql = string.Format("insert into estate_settings (\"{0}\") values ( :{1} )", String.Join("\",\"", names.ToArray()), String.Join(", :", names.ToArray())); |
203 | 203 | ||
204 | m_log.Debug("[DB ESTATE]: SQL: " + sql); | ||
205 | using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString)) | 204 | using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString)) |
206 | using (NpgsqlCommand insertCommand = new NpgsqlCommand(sql, conn)) | 205 | using (NpgsqlCommand insertCommand = new NpgsqlCommand(sql, conn)) |
207 | { | 206 | { |
208 | insertCommand.CommandText = sql + "; Select cast(lastval() as int) as ID ;"; | 207 | insertCommand.CommandText = sql; |
209 | 208 | ||
210 | foreach (string name in names) | 209 | foreach (string name in names) |
211 | { | 210 | { |
@@ -218,11 +217,16 @@ namespace OpenSim.Data.PGSQL | |||
218 | 217 | ||
219 | es.EstateID = 100; | 218 | es.EstateID = 100; |
220 | 219 | ||
221 | using (NpgsqlDataReader result = insertCommand.ExecuteReader()) | 220 | if (insertCommand.ExecuteNonQuery() > 0) |
222 | { | 221 | { |
223 | if (result.Read()) | 222 | insertCommand.CommandText = "Select cast(lastval() as int) as ID ;"; |
223 | |||
224 | using (NpgsqlDataReader result = insertCommand.ExecuteReader()) | ||
224 | { | 225 | { |
225 | es.EstateID = (uint)result.GetInt32(0); | 226 | if (result.Read()) |
227 | { | ||
228 | es.EstateID = (uint)result.GetInt32(0); | ||
229 | } | ||
226 | } | 230 | } |
227 | } | 231 | } |
228 | 232 | ||
diff --git a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs index 5753ae3..69b0beb 100644 --- a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs +++ b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs | |||
@@ -727,7 +727,7 @@ namespace OpenSim.Data.PGSQL | |||
727 | using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString)) | 727 | using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString)) |
728 | using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn)) | 728 | using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn)) |
729 | { | 729 | { |
730 | cmd.Parameters.Add(_Database.CreateParameter("regionID", regionUUID)); | 730 | cmd.Parameters.Add(_Database.CreateParameter("regionID", regionUUID.ToString() )); |
731 | conn.Open(); | 731 | conn.Open(); |
732 | using (NpgsqlDataReader result = cmd.ExecuteReader()) | 732 | using (NpgsqlDataReader result = cmd.ExecuteReader()) |
733 | { | 733 | { |
@@ -817,7 +817,7 @@ namespace OpenSim.Data.PGSQL | |||
817 | using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn)) | 817 | using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn)) |
818 | { | 818 | { |
819 | conn.Open(); | 819 | conn.Open(); |
820 | cmd.Parameters.Add(_Database.CreateParameter("region_id", regionID)); | 820 | cmd.Parameters.Add(_Database.CreateParameter("region_id", regionID.ToString())); |
821 | cmd.ExecuteNonQuery(); | 821 | cmd.ExecuteNonQuery(); |
822 | } | 822 | } |
823 | } | 823 | } |
@@ -831,8 +831,8 @@ namespace OpenSim.Data.PGSQL | |||
831 | conn.Open(); | 831 | conn.Open(); |
832 | using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn)) | 832 | using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn)) |
833 | { | 833 | { |
834 | cmd.Parameters.Add(_Database.CreateParameter("region_id", wl.regionID)); | 834 | cmd.Parameters.Add(_Database.CreateParameter("region_id", wl.regionID.ToString() )); |
835 | exists = (int)cmd.ExecuteScalar() > 0; | 835 | exists = cmd.ExecuteNonQuery() > 0; |
836 | } | 836 | } |
837 | } | 837 | } |
838 | if (exists) | 838 | if (exists) |
diff --git a/OpenSim/Data/PGSQL/Resources/InventoryStore.migrations b/OpenSim/Data/PGSQL/Resources/InventoryStore.migrations index b61e1f8..8f7982a 100644 --- a/OpenSim/Data/PGSQL/Resources/InventoryStore.migrations +++ b/OpenSim/Data/PGSQL/Resources/InventoryStore.migrations | |||
@@ -209,3 +209,12 @@ alter table inventoryitems | |||
209 | alter column "creatorID" type varchar(255); | 209 | alter column "creatorID" type varchar(255); |
210 | 210 | ||
211 | Commit; | 211 | Commit; |
212 | |||
213 | :VERSION 10 | ||
214 | |||
215 | BEGIN TRANSACTION; | ||
216 | |||
217 | Alter table inventoryitems Rename Column "SaleType" to "saleType"; | ||
218 | |||
219 | Commit; | ||
220 | |||
diff --git a/OpenSim/Data/PGSQL/Resources/RegionStore.migrations b/OpenSim/Data/PGSQL/Resources/RegionStore.migrations index 65eb011..1e33027 100644 --- a/OpenSim/Data/PGSQL/Resources/RegionStore.migrations +++ b/OpenSim/Data/PGSQL/Resources/RegionStore.migrations | |||
@@ -1134,3 +1134,21 @@ ALTER TABLE prims ADD "Friction" double precision NOT NULL default '0.6'; | |||
1134 | ALTER TABLE prims ADD "Restitution" double precision NOT NULL default '0.5'; | 1134 | ALTER TABLE prims ADD "Restitution" double precision NOT NULL default '0.5'; |
1135 | 1135 | ||
1136 | COMMIT; | 1136 | COMMIT; |
1137 | |||
1138 | :VERSION 40 #-- regionwindlight changed type from smallint to bool | ||
1139 | |||
1140 | BEGIN TRANSACTION; | ||
1141 | |||
1142 | ALTER TABLE regionwindlight ALTER COLUMN cloud_scroll_x_lock DROP DEFAULT; | ||
1143 | ALTER TABLE regionwindlight ALTER cloud_scroll_x_lock TYPE bool USING CASE WHEN cloud_scroll_x_lock=0 THEN FALSE ELSE TRUE END; | ||
1144 | ALTER TABLE regionwindlight ALTER COLUMN cloud_scroll_x_lock SET DEFAULT FALSE; | ||
1145 | |||
1146 | ALTER TABLE regionwindlight ALTER COLUMN cloud_scroll_y_lock DROP DEFAULT; | ||
1147 | ALTER TABLE regionwindlight ALTER cloud_scroll_y_lock TYPE bool USING CASE WHEN cloud_scroll_y_lock=0 THEN FALSE ELSE TRUE END; | ||
1148 | ALTER TABLE regionwindlight ALTER COLUMN cloud_scroll_y_lock SET DEFAULT FALSE; | ||
1149 | |||
1150 | ALTER TABLE regionwindlight ALTER COLUMN draw_classic_clouds DROP DEFAULT; | ||
1151 | ALTER TABLE regionwindlight ALTER draw_classic_clouds TYPE bool USING CASE WHEN draw_classic_clouds=0 THEN FALSE ELSE TRUE END; | ||
1152 | ALTER TABLE regionwindlight ALTER COLUMN draw_classic_clouds SET DEFAULT FALSE; | ||
1153 | |||
1154 | COMMIT; | ||