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 /OpenSim/Data/PGSQL/PGSQLEstateData.cs | |
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_OLD-d82d6bb1ec51dbdcbd99d365fa80148b931c1e2d.zip opensim-SC_OLD-d82d6bb1ec51dbdcbd99d365fa80148b931c1e2d.tar.gz opensim-SC_OLD-d82d6bb1ec51dbdcbd99d365fa80148b931c1e2d.tar.bz2 opensim-SC_OLD-d82d6bb1ec51dbdcbd99d365fa80148b931c1e2d.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Data/PGSQL/PGSQLEstateData.cs')
-rw-r--r-- | OpenSim/Data/PGSQL/PGSQLEstateData.cs | 14 |
1 files changed, 9 insertions, 5 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 | ||