aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MSSQL
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-01-29 20:08:04 +0000
committerJustin Clarke Casey2009-01-29 20:08:04 +0000
commit13f069b945b10ccdcb7ffd26392a0c9166914852 (patch)
tree89cfec025d3c41b3f94d4c93e3dcbfb53d225924 /OpenSim/Data/MSSQL
parentComplete the implementation of llSHA1String. (diff)
downloadopensim-SC-13f069b945b10ccdcb7ffd26392a0c9166914852.zip
opensim-SC-13f069b945b10ccdcb7ffd26392a0c9166914852.tar.gz
opensim-SC-13f069b945b10ccdcb7ffd26392a0c9166914852.tar.bz2
opensim-SC-13f069b945b10ccdcb7ffd26392a0c9166914852.tar.xz
* If an orphaned group is found in the mysql or mssql databases (i.e. there is no prim where UUID = SceneGroupID), then force one prim to have UUID = SceneGroupID.
* A warning is posted about this on startup giving the location of the object * This should allow one class of persistently undeletable prims to be removed * This change should not cause any issues, but I still suggest that you backup your database beforehand * If this doesn't work for previously linked objects, then you could also try the workaround in http://opensimulator.org/mantis/view.php?id=3059 * This change has been made to mysql and mssql, but sqlite appears to work in a different way
Diffstat (limited to 'OpenSim/Data/MSSQL')
-rw-r--r--OpenSim/Data/MSSQL/MSSQLRegionData.cs33
1 files changed, 21 insertions, 12 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLRegionData.cs b/OpenSim/Data/MSSQL/MSSQLRegionData.cs
index 5ab29ff..2388207 100644
--- a/OpenSim/Data/MSSQL/MSSQLRegionData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLRegionData.cs
@@ -79,7 +79,6 @@ namespace OpenSim.Data.MSSQL
79 79
80 //Migration settings 80 //Migration settings
81 _Database.CheckMigration(_migrationStore); 81 _Database.CheckMigration(_migrationStore);
82
83 } 82 }
84 83
85 /// <summary> 84 /// <summary>
@@ -124,10 +123,9 @@ namespace OpenSim.Data.MSSQL
124 else 123 else
125 sceneObjectPart.Shape = BuildShape(reader); 124 sceneObjectPart.Shape = BuildShape(reader);
126 125
127 sceneObjectPart.FolderID = sceneObjectPart.UUID; // A relic from when we 126 // A relic from when we we thought that prims contained folder objects. In
128 // we thought prims contained 127 // reality, prim == folder
129 // folder objects. In 128 sceneObjectPart.FolderID = sceneObjectPart.UUID;
130 // reality, prim == folder
131 sceneObjectParts.Add(sceneObjectPart); 129 sceneObjectParts.Add(sceneObjectPart);
132 130
133 UUID groupID = new UUID(reader["SceneGroupID"].ToString()); 131 UUID groupID = new UUID(reader["SceneGroupID"].ToString());
@@ -138,6 +136,20 @@ namespace OpenSim.Data.MSSQL
138 sceneObjectGroups.Add(grp); 136 sceneObjectGroups.Add(grp);
139 137
140 lastGroupID = groupID; 138 lastGroupID = groupID;
139
140 // There sometimes exist OpenSim bugs that 'orphan groups' so that none of the prims are
141 // recorded as the root prim (for which the UUID must equal the persisted group UUID). In
142 // this case, force the UUID to be the same as the group UUID so that at least these can be
143 // deleted (we need to change the UUID so that any other prims in the linkset can also be
144 // deleted).
145 if (sceneObjectPart.UUID != groupID && groupID != UUID.Zero)
146 {
147 _Log.WarnFormat(
148 "[REGION DB]: Found root prim {0} {1} at {2} where group was actually {3}. Forcing UUID to group UUID",
149 sceneObjectPart.Name, sceneObjectPart.UUID, sceneObjectPart.GroupPosition, groupID);
150
151 sceneObjectPart.UUID = groupID;
152 }
141 153
142 grp = new SceneObjectGroup(sceneObjectPart); 154 grp = new SceneObjectGroup(sceneObjectPart);
143 } 155 }
@@ -162,10 +174,9 @@ namespace OpenSim.Data.MSSQL
162 //Load the inventory off all sceneobjects within the region 174 //Load the inventory off all sceneobjects within the region
163 LoadItems(sceneObjectParts); 175 LoadItems(sceneObjectParts);
164 176
165 _Log.DebugFormat("[DATABASE] Loaded {0} objects using {1} prims", sceneObjectGroups.Count, sceneObjectParts.Count); 177 _Log.DebugFormat("[REGION DB]: Loaded {0} objects using {1} prims", sceneObjectGroups.Count, sceneObjectParts.Count);
166 178
167 return sceneObjectGroups; 179 return sceneObjectGroups;
168
169 } 180 }
170 181
171 /// <summary> 182 /// <summary>
@@ -216,7 +227,7 @@ namespace OpenSim.Data.MSSQL
216 /// <param name="regionUUID"></param> 227 /// <param name="regionUUID"></param>
217 public void StoreObject(SceneObjectGroup obj, UUID regionUUID) 228 public void StoreObject(SceneObjectGroup obj, UUID regionUUID)
218 { 229 {
219 _Log.InfoFormat("[REGION DB]: Adding/Changing SceneObjectGroup: {0} to region: {1}, object has {2} prims.", obj.UUID, regionUUID, obj.Children.Count); 230 _Log.InfoFormat("[MSSQL]: Adding/Changing SceneObjectGroup: {0} to region: {1}, object has {2} prims.", obj.UUID, regionUUID, obj.Children.Count);
220 231
221 using (SqlConnection conn = _Database.DatabaseConnection()) 232 using (SqlConnection conn = _Database.DatabaseConnection())
222 { 233 {
@@ -404,7 +415,7 @@ ELSE
404 /// <param name="regionUUID">regionUUID (is this used anyway</param> 415 /// <param name="regionUUID">regionUUID (is this used anyway</param>
405 public void RemoveObject(UUID objectID, UUID regionUUID) 416 public void RemoveObject(UUID objectID, UUID regionUUID)
406 { 417 {
407 _Log.InfoFormat("[REGION DB]: Removing obj: {0} from region: {1}", objectID, regionUUID); 418 _Log.InfoFormat("[MSSQL]: Removing obj: {0} from region: {1}", objectID, regionUUID);
408 419
409 //Remove from prims and primsitem table 420 //Remove from prims and primsitem table
410 string sqlPrims = string.Format("DELETE FROM PRIMS WHERE SceneGroupID = '{0}'", objectID); 421 string sqlPrims = string.Format("DELETE FROM PRIMS WHERE SceneGroupID = '{0}'", objectID);
@@ -1482,9 +1493,7 @@ VALUES
1482 1493
1483 return parameters.ToArray(); 1494 return parameters.ToArray();
1484 } 1495 }
1485 1496
1486
1487
1488 #endregion 1497 #endregion
1489 1498
1490 #endregion 1499 #endregion