* Fixes mantis #6802 Simulator crashes whist loading (lighshare enabled)

* Please test
link-sitting
fernando 2013-10-15 11:55:08 -05:00
parent f106ba87ca
commit 3e1ca2bd21
4 changed files with 40 additions and 9 deletions

View File

@ -201,11 +201,10 @@ namespace OpenSim.Data.PGSQL
string sql = string.Format("insert into estate_settings (\"{0}\") values ( :{1} )", String.Join("\",\"", names.ToArray()), String.Join(", :", names.ToArray()));
m_log.Debug("[DB ESTATE]: SQL: " + sql);
using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
using (NpgsqlCommand insertCommand = new NpgsqlCommand(sql, conn))
{
insertCommand.CommandText = sql + "; Select cast(lastval() as int) as ID ;";
insertCommand.CommandText = sql;
foreach (string name in names)
{
@ -218,11 +217,16 @@ namespace OpenSim.Data.PGSQL
es.EstateID = 100;
using (NpgsqlDataReader result = insertCommand.ExecuteReader())
if (insertCommand.ExecuteNonQuery() > 0)
{
if (result.Read())
insertCommand.CommandText = "Select cast(lastval() as int) as ID ;";
using (NpgsqlDataReader result = insertCommand.ExecuteReader())
{
es.EstateID = (uint)result.GetInt32(0);
if (result.Read())
{
es.EstateID = (uint)result.GetInt32(0);
}
}
}

View File

@ -727,7 +727,7 @@ namespace OpenSim.Data.PGSQL
using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
{
cmd.Parameters.Add(_Database.CreateParameter("regionID", regionUUID));
cmd.Parameters.Add(_Database.CreateParameter("regionID", regionUUID.ToString() ));
conn.Open();
using (NpgsqlDataReader result = cmd.ExecuteReader())
{
@ -817,7 +817,7 @@ namespace OpenSim.Data.PGSQL
using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
{
conn.Open();
cmd.Parameters.Add(_Database.CreateParameter("region_id", regionID));
cmd.Parameters.Add(_Database.CreateParameter("region_id", regionID.ToString()));
cmd.ExecuteNonQuery();
}
}
@ -831,8 +831,8 @@ namespace OpenSim.Data.PGSQL
conn.Open();
using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
{
cmd.Parameters.Add(_Database.CreateParameter("region_id", wl.regionID));
exists = (int)cmd.ExecuteScalar() > 0;
cmd.Parameters.Add(_Database.CreateParameter("region_id", wl.regionID.ToString() ));
exists = cmd.ExecuteNonQuery() > 0;
}
}
if (exists)

View File

@ -209,3 +209,12 @@ alter table inventoryitems
alter column "creatorID" type varchar(255);
Commit;
:VERSION 10
BEGIN TRANSACTION;
Alter table inventoryitems Rename Column "SaleType" to "saleType";
Commit;

View File

@ -1134,3 +1134,21 @@ ALTER TABLE prims ADD "Friction" double precision NOT NULL default '0.6';
ALTER TABLE prims ADD "Restitution" double precision NOT NULL default '0.5';
COMMIT;
:VERSION 40 #-- regionwindlight changed type from smallint to bool
BEGIN TRANSACTION;
ALTER TABLE regionwindlight ALTER COLUMN cloud_scroll_x_lock DROP DEFAULT;
ALTER TABLE regionwindlight ALTER cloud_scroll_x_lock TYPE bool USING CASE WHEN cloud_scroll_x_lock=0 THEN FALSE ELSE TRUE END;
ALTER TABLE regionwindlight ALTER COLUMN cloud_scroll_x_lock SET DEFAULT FALSE;
ALTER TABLE regionwindlight ALTER COLUMN cloud_scroll_y_lock DROP DEFAULT;
ALTER TABLE regionwindlight ALTER cloud_scroll_y_lock TYPE bool USING CASE WHEN cloud_scroll_y_lock=0 THEN FALSE ELSE TRUE END;
ALTER TABLE regionwindlight ALTER COLUMN cloud_scroll_y_lock SET DEFAULT FALSE;
ALTER TABLE regionwindlight ALTER COLUMN draw_classic_clouds DROP DEFAULT;
ALTER TABLE regionwindlight ALTER draw_classic_clouds TYPE bool USING CASE WHEN draw_classic_clouds=0 THEN FALSE ELSE TRUE END;
ALTER TABLE regionwindlight ALTER COLUMN draw_classic_clouds SET DEFAULT FALSE;
COMMIT;