diff --git a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs
index 97c40bab1f..557dec792d 100644
--- a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs
+++ b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs
@@ -301,7 +301,8 @@ namespace OpenSim.Data.SQLite
DataTable inventoryFolderTable = ds.Tables["inventoryfolders"];
inventoryRow = inventoryFolderTable.Rows.Find(item.Folder.ToString());
- inventoryRow["version"] = (int)inventoryRow["version"] + 1;
+ if(inventoryRow != null) //MySQL doesn't throw an exception here, so sqlite shouldn't either.
+ inventoryRow["version"] = (int)inventoryRow["version"] + 1;
invFoldersDa.Update(ds, "inventoryfolders");
}
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs
index d2548c2807..0259ac58f5 100644
--- a/OpenSim/Data/SQLite/SQLiteRegionData.cs
+++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs
@@ -307,26 +307,21 @@ namespace OpenSim.Data.SQLite
/// the region UUID
public void StoreObject(SceneObjectGroup obj, UUID regionUUID)
{
+ uint flags = obj.RootPart.GetEffectiveObjectFlags();
+
+ // Eligibility check
+ //
+ if ((flags & (uint)PrimFlags.Temporary) != 0)
+ return;
+ if ((flags & (uint)PrimFlags.TemporaryOnRez) != 0)
+ return;
+
lock (ds)
{
foreach (SceneObjectPart prim in obj.Children.Values)
{
- if ((prim.GetEffectiveObjectFlags() & (uint)PrimFlags.Temporary) == 0
- && (prim.GetEffectiveObjectFlags() & (uint)PrimFlags.TemporaryOnRez) == 0)
- {
- m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID);
- addPrim(prim, obj.UUID, regionUUID);
- }
- else if (prim.Stopped)
- {
- //m_log.Info("[DATASTORE]: " +
- //"Adding stopped obj: " + obj.UUID + " to region: " + regionUUID);
- //addPrim(prim, obj.UUID.ToString(), regionUUID.ToString());
- }
- else
- {
- // m_log.Info("[DATASTORE]: Ignoring Physical obj: " + obj.UUID + " in region: " + regionUUID);
- }
+ m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID);
+ addPrim(prim, obj.UUID, regionUUID);
}
}
@@ -1130,7 +1125,7 @@ namespace OpenSim.Data.SQLite
// explicit conversion of integers is required, which sort
// of sucks. No idea if there is a shortcut here or not.
prim.CreationDate = Convert.ToInt32(row["CreationDate"]);
- prim.Name = (String) row["Name"];
+ prim.Name = row["Name"] == DBNull.Value ? string.Empty : (string)row["Name"];
// various text fields
prim.Text = (String) row["Text"];
prim.Color = Color.FromArgb(Convert.ToInt32(row["ColorA"]),
diff --git a/OpenSim/Data/Tests/BasicInventoryTest.cs b/OpenSim/Data/Tests/BasicInventoryTest.cs
index 3c33bb489a..967c6e7ca3 100644
--- a/OpenSim/Data/Tests/BasicInventoryTest.cs
+++ b/OpenSim/Data/Tests/BasicInventoryTest.cs
@@ -266,6 +266,7 @@ namespace OpenSim.Data.Tests
InventoryItemBase actual = db.getInventoryItem(item1);
Assert.That(actual, Constraints.PropertyCompareConstraint(expected)
.IgnoreProperty(x=>x.InvType)
+ .IgnoreProperty(x=>x.CreatorIdAsUuid)
.IgnoreProperty(x=>x.Description)
.IgnoreProperty(x=>x.CreatorId));
}
diff --git a/OpenSim/Data/Tests/BasicRegionTest.cs b/OpenSim/Data/Tests/BasicRegionTest.cs
index a746ef0db6..8373922cb5 100644
--- a/OpenSim/Data/Tests/BasicRegionTest.cs
+++ b/OpenSim/Data/Tests/BasicRegionTest.cs
@@ -576,8 +576,10 @@ namespace OpenSim.Data.Tests
.IgnoreProperty(x=>x.HasGroupChanged)
.IgnoreProperty(x=>x.IsSelected)
.IgnoreProperty(x=>x.RegionHandle)
+ .IgnoreProperty(x=>x.RegionUUID)
.IgnoreProperty(x=>x.Scene)
- .IgnoreProperty(x=>x.RootPart.InventorySerial));
+ .IgnoreProperty(x=>x.Children)
+ .IgnoreProperty(x=>x.RootPart));
}
[Test]
diff --git a/OpenSim/Data/Tests/BasicUserTest.cs b/OpenSim/Data/Tests/BasicUserTest.cs
index 21d1a7e93e..a3c125dbd2 100644
--- a/OpenSim/Data/Tests/BasicUserTest.cs
+++ b/OpenSim/Data/Tests/BasicUserTest.cs
@@ -403,6 +403,7 @@ namespace OpenSim.Data.Tests
Assert.That(u1a, Constraints.PropertyCompareConstraint(u)
.IgnoreProperty(x=>x.HomeRegionX)
.IgnoreProperty(x=>x.HomeRegionY)
+ .IgnoreProperty(x=>x.RootInventoryFolderID)
);
}
diff --git a/OpenSim/Data/Tests/PropertyCompareConstraint.cs b/OpenSim/Data/Tests/PropertyCompareConstraint.cs
index 063267baf0..5f53725e17 100644
--- a/OpenSim/Data/Tests/PropertyCompareConstraint.cs
+++ b/OpenSim/Data/Tests/PropertyCompareConstraint.cs
@@ -69,6 +69,15 @@ namespace OpenSim.Data.Tests
private bool ObjectCompare(object expected, object actual, Stack propertyNames)
{
+ //prevent loops...
+ if(propertyNames.Count > 50)
+ {
+ failingPropertyName = string.Join(".", propertyNames.Reverse().ToArray());
+ failingActual = actual;
+ failingExpected = expected;
+ return false;
+ }
+
if (actual.GetType() != expected.GetType())
{
propertyNames.Push("GetType()");
@@ -122,6 +131,60 @@ namespace OpenSim.Data.Tests
return true;
}
+ IComparable comp = actual as IComparable;
+ if (comp != null)
+ {
+ if (comp.CompareTo(expected) != 0)
+ {
+ failingPropertyName = string.Join(".", propertyNames.Reverse().ToArray());
+ failingActual = actual;
+ failingExpected = expected;
+ return false;
+ }
+ return true;
+ }
+
+ //Now try the much more annoying IComparable
+ Type icomparableInterface = actual.GetType().GetInterface("IComparable`1");
+ if (icomparableInterface != null)
+ {
+ int result = (int)icomparableInterface.GetMethod("CompareTo").Invoke(actual, new[] { expected });
+ if (result != 0)
+ {
+ failingPropertyName = string.Join(".", propertyNames.Reverse().ToArray());
+ failingActual = actual;
+ failingExpected = expected;
+ return false;
+ }
+ return true;
+ }
+
+ IEnumerable arr = actual as IEnumerable;
+ if (arr != null)
+ {
+ List