mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
* Align new fields upgrade sql to have the same 'not null' and default settings as when an inventoryitems table is newly created
* Normalize logging titles in database code, though this doesn't yet cover invoking code
This commit is contained in:
@@ -92,10 +92,10 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
override public void CreateAsset(AssetBase asset)
|
||||
{
|
||||
m_log.Info("[SQLITE]: Creating Asset " + Util.ToRawUuidString(asset.FullID));
|
||||
m_log.Info("[ASSET DB]: Creating Asset " + Util.ToRawUuidString(asset.FullID));
|
||||
if (ExistsAsset(asset.FullID))
|
||||
{
|
||||
m_log.Info("[SQLITE]: Asset exists already, ignoring.");
|
||||
m_log.Info("[ASSET DB]: Asset exists already, ignoring.");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -142,7 +142,7 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
int assetLength = (asset.Data != null) ? asset.Data.Length : 0;
|
||||
|
||||
m_log.Info("[SQLITE]: " +
|
||||
m_log.Info("[ASSET DB]: " +
|
||||
string.Format("Loaded {6} {5} Asset: [{0}][{3}/{4}] \"{1}\":{2} ({7} bytes)",
|
||||
asset.FullID, asset.Name, asset.Description, asset.Type,
|
||||
asset.InvType, temporary, local, assetLength));
|
||||
@@ -181,7 +181,7 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
override public void CommitAssets() // force a sync to the database
|
||||
{
|
||||
m_log.Info("[SQLITE]: Attempting commit");
|
||||
m_log.Info("[ASSET DB]: Attempting commit");
|
||||
// lock (ds)
|
||||
// {
|
||||
// da.Update(ds, "assets");
|
||||
@@ -268,7 +268,7 @@ namespace OpenSim.Data.SQLite
|
||||
}
|
||||
catch (SqliteSyntaxException)
|
||||
{
|
||||
m_log.Info("[SQLITE]: SQLite Database doesn't exist... creating");
|
||||
m_log.Info("[ASSET DB]: SQLite Database doesn't exist... creating");
|
||||
InitDB(conn);
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -210,7 +210,7 @@ namespace OpenSim.Data.SQLite
|
||||
if (inventoryRow == null)
|
||||
{
|
||||
if (! add)
|
||||
m_log.ErrorFormat("Interface Misuse: Attempting to Update non-existant inventory item: {0}", item.ID);
|
||||
m_log.ErrorFormat("[INVENTORY DB]: Interface Misuse: Attempting to Update non-existant inventory item: {0}", item.ID);
|
||||
|
||||
inventoryRow = inventoryItemTable.NewRow();
|
||||
fillItemRow(inventoryRow, item);
|
||||
@@ -219,7 +219,7 @@ namespace OpenSim.Data.SQLite
|
||||
else
|
||||
{
|
||||
if (add)
|
||||
m_log.ErrorFormat("Interface Misuse: Attempting to Add inventory item that already exists: {0}", item.ID);
|
||||
m_log.ErrorFormat("[INVENTORY DB]: Interface Misuse: Attempting to Add inventory item that already exists: {0}", item.ID);
|
||||
|
||||
fillItemRow(inventoryRow, item);
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
ds = new DataSet();
|
||||
|
||||
m_log.Info("[DATASTORE]: Sqlite - connecting: " + connectionString);
|
||||
m_log.Info("[REGION DB]: Sqlite - connecting: " + connectionString);
|
||||
m_conn = new SqliteConnection(m_connectionString);
|
||||
m_conn.Open();
|
||||
|
||||
@@ -143,7 +143,7 @@ namespace OpenSim.Data.SQLite
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
m_log.Info("[DATASTORE]: Caught fill error on primshapes table");
|
||||
m_log.Info("[REGION DB]: Caught fill error on primshapes table");
|
||||
}
|
||||
|
||||
try
|
||||
@@ -152,7 +152,7 @@ namespace OpenSim.Data.SQLite
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
m_log.Info("[DATASTORE]: Caught fill error on terrain table");
|
||||
m_log.Info("[REGION DB]: Caught fill error on terrain table");
|
||||
}
|
||||
|
||||
try
|
||||
@@ -161,7 +161,7 @@ namespace OpenSim.Data.SQLite
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
m_log.Info("[DATASTORE]: Caught fill error on land table");
|
||||
m_log.Info("[REGION DB]: Caught fill error on land table");
|
||||
}
|
||||
|
||||
try
|
||||
@@ -170,7 +170,7 @@ namespace OpenSim.Data.SQLite
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
m_log.Info("[DATASTORE]: Caught fill error on landaccesslist table");
|
||||
m_log.Info("[REGION DB]: Caught fill error on landaccesslist table");
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -184,7 +184,7 @@ namespace OpenSim.Data.SQLite
|
||||
{
|
||||
if ((prim.GetEffectiveObjectFlags() & (uint) LLObject.ObjectFlags.Physics) == 0)
|
||||
{
|
||||
m_log.Info("[DATASTORE]: Adding obj: " + obj.UUID + " to region: " + regionUUID);
|
||||
m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID);
|
||||
addPrim(prim, Util.ToRawUuidString(obj.UUID), Util.ToRawUuidString(regionUUID));
|
||||
}
|
||||
else if (prim.Stopped)
|
||||
@@ -206,7 +206,7 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
public void RemoveObject(LLUUID obj, LLUUID regionUUID)
|
||||
{
|
||||
m_log.InfoFormat("[DATASTORE]: Removing obj: {0} from region: {1}", obj.UUID, regionUUID);
|
||||
m_log.InfoFormat("[REGION DB]: Removing obj: {0} from region: {1}", obj.UUID, regionUUID);
|
||||
|
||||
DataTable prims = ds.Tables["prims"];
|
||||
DataTable shapes = ds.Tables["primshapes"];
|
||||
@@ -275,7 +275,7 @@ namespace OpenSim.Data.SQLite
|
||||
lock (ds)
|
||||
{
|
||||
DataRow[] primsForRegion = prims.Select(byRegion, orderByParent);
|
||||
m_log.Info("[DATASTORE]: " +
|
||||
m_log.Info("[REGION DB]: " +
|
||||
"Loaded " + primsForRegion.Length + " prims for region: " + regionUUID);
|
||||
|
||||
foreach (DataRow primRow in primsForRegion)
|
||||
@@ -298,7 +298,7 @@ namespace OpenSim.Data.SQLite
|
||||
else
|
||||
{
|
||||
m_log.Info(
|
||||
"No shape found for prim in storage, so setting default box shape");
|
||||
"[REGION DB]: No shape found for prim in storage, so setting default box shape");
|
||||
prim.Shape = PrimitiveBaseShape.Default;
|
||||
}
|
||||
group.AddPart(prim);
|
||||
@@ -318,7 +318,7 @@ namespace OpenSim.Data.SQLite
|
||||
else
|
||||
{
|
||||
m_log.Info(
|
||||
"No shape found for prim in storage, so setting default box shape");
|
||||
"[REGION DB]: No shape found for prim in storage, so setting default box shape");
|
||||
prim.Shape = PrimitiveBaseShape.Default;
|
||||
}
|
||||
createdObjects[new LLUUID(objID)].AddPart(prim);
|
||||
@@ -331,11 +331,11 @@ namespace OpenSim.Data.SQLite
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error("[DATASTORE]: Failed create prim object, exception and data follows");
|
||||
m_log.Info("[DATASTORE]: " + e.ToString());
|
||||
m_log.Error("[REGION DB]: Failed create prim object, exception and data follows");
|
||||
m_log.Info("[REGION DB]: " + e.ToString());
|
||||
foreach (DataColumn col in prims.Columns)
|
||||
{
|
||||
m_log.Info("[DATASTORE]: Col: " + col.ColumnName + " => " + primRow[col]);
|
||||
m_log.Info("[REGION DB]: Col: " + col.ColumnName + " => " + primRow[col]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -384,7 +384,7 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
// the following is an work around for .NET. The perf
|
||||
// issues associated with it aren't as bad as you think.
|
||||
m_log.Info("[DATASTORE]: Storing terrain revision r" + revision.ToString());
|
||||
m_log.Info("[REGION DB]: Storing terrain revision r" + revision.ToString());
|
||||
String sql = "insert into terrain(RegionUUID, Revision, Heightfield)" +
|
||||
" values(:RegionUUID, :Revision, :Heightfield)";
|
||||
|
||||
@@ -448,11 +448,11 @@ namespace OpenSim.Data.SQLite
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.Info("[DATASTORE]: No terrain found for region");
|
||||
m_log.Info("[REGION DB]: No terrain found for region");
|
||||
return null;
|
||||
}
|
||||
|
||||
m_log.Info("[DATASTORE]: Loaded terrain revision r" + rev.ToString());
|
||||
m_log.Info("[REGION DB]: Loaded terrain revision r" + rev.ToString());
|
||||
}
|
||||
}
|
||||
return terret;
|
||||
@@ -988,7 +988,7 @@ namespace OpenSim.Data.SQLite
|
||||
m_conn.Close();
|
||||
m_conn.Dispose();
|
||||
|
||||
m_log.Error("[SQLITE]: The land table was recently updated. You need to restart the simulator. Exiting now.");
|
||||
m_log.Error("[REGION DB]: The land table was recently updated. You need to restart the simulator. Exiting now.");
|
||||
|
||||
System.Threading.Thread.Sleep(10000);
|
||||
|
||||
@@ -999,7 +999,7 @@ namespace OpenSim.Data.SQLite
|
||||
catch (System.Exception)
|
||||
{
|
||||
// ICK! but it's better then A thousand red SQLITE error messages!
|
||||
m_log.Error("[SQLITE]: The land table was recently updated. You need to restart the simulator");
|
||||
m_log.Error("[REGION DB]: The land table was recently updated. You need to restart the simulator");
|
||||
Environment.Exit(0);
|
||||
}
|
||||
}
|
||||
@@ -1314,7 +1314,7 @@ namespace OpenSim.Data.SQLite
|
||||
if (!persistPrimInventories)
|
||||
return;
|
||||
|
||||
m_log.InfoFormat("[DATASTORE]: Entered StorePrimInventory with prim ID {0}", primID);
|
||||
m_log.InfoFormat("[REGION DB]: Entered StorePrimInventory with prim ID {0}", primID);
|
||||
|
||||
DataTable dbItems = ds.Tables["primitems"];
|
||||
|
||||
@@ -1555,7 +1555,7 @@ namespace OpenSim.Data.SQLite
|
||||
}
|
||||
catch (SqliteSyntaxException)
|
||||
{
|
||||
m_log.Warn("[SQLITE]: Primitives Table Already Exists");
|
||||
m_log.Warn("[REGION DB]: Primitives Table Already Exists");
|
||||
}
|
||||
|
||||
try
|
||||
@@ -1564,7 +1564,7 @@ namespace OpenSim.Data.SQLite
|
||||
}
|
||||
catch (SqliteSyntaxException)
|
||||
{
|
||||
m_log.Warn("[SQLITE]: Shapes Table Already Exists");
|
||||
m_log.Warn("[REGION DB]: Shapes Table Already Exists");
|
||||
}
|
||||
|
||||
if (persistPrimInventories)
|
||||
@@ -1575,7 +1575,7 @@ namespace OpenSim.Data.SQLite
|
||||
}
|
||||
catch (SqliteSyntaxException)
|
||||
{
|
||||
m_log.Warn("[SQLITE]: Primitives Inventory Table Already Exists");
|
||||
m_log.Warn("[REGION DB]: Primitives Inventory Table Already Exists");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1585,7 +1585,7 @@ namespace OpenSim.Data.SQLite
|
||||
}
|
||||
catch (SqliteSyntaxException)
|
||||
{
|
||||
m_log.Warn("[SQLITE]: Terrain Table Already Exists");
|
||||
m_log.Warn("[REGION DB]: Terrain Table Already Exists");
|
||||
}
|
||||
|
||||
try
|
||||
@@ -1594,7 +1594,7 @@ namespace OpenSim.Data.SQLite
|
||||
}
|
||||
catch (SqliteSyntaxException)
|
||||
{
|
||||
m_log.Warn("[SQLITE]: Land Table Already Exists");
|
||||
m_log.Warn("[REGION DB]: Land Table Already Exists");
|
||||
}
|
||||
|
||||
try
|
||||
@@ -1660,7 +1660,7 @@ namespace OpenSim.Data.SQLite
|
||||
{
|
||||
if (!tmpDS.Tables["prims"].Columns.Contains(col.ColumnName))
|
||||
{
|
||||
m_log.Info("[DATASTORE]: Missing required column:" + col.ColumnName);
|
||||
m_log.Info("[REGION DB]: Missing required column:" + col.ColumnName);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1669,7 +1669,7 @@ namespace OpenSim.Data.SQLite
|
||||
{
|
||||
if (!tmpDS.Tables["primshapes"].Columns.Contains(col.ColumnName))
|
||||
{
|
||||
m_log.Info("[DATASTORE]: Missing required column:" + col.ColumnName);
|
||||
m_log.Info("[REGION DB]: Missing required column:" + col.ColumnName);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1680,7 +1680,7 @@ namespace OpenSim.Data.SQLite
|
||||
{
|
||||
if (!tmpDS.Tables["terrain"].Columns.Contains(col.ColumnName))
|
||||
{
|
||||
m_log.Info("[DATASTORE]: Missing require column:" + col.ColumnName);
|
||||
m_log.Info("[REGION DB]: Missing require column:" + col.ColumnName);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1689,7 +1689,7 @@ namespace OpenSim.Data.SQLite
|
||||
{
|
||||
if (!tmpDS.Tables["land"].Columns.Contains(col.ColumnName))
|
||||
{
|
||||
m_log.Info("[DATASTORE]: Missing require column:" + col.ColumnName);
|
||||
m_log.Info("[REGION DB]: Missing require column:" + col.ColumnName);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace OpenSim.Data.SQLite
|
||||
}
|
||||
catch (SqliteSyntaxException)
|
||||
{
|
||||
m_log.Info("[SQLITE]: userfriends table not found, creating.... ");
|
||||
m_log.Info("[USER DB]: userfriends table not found, creating.... ");
|
||||
InitDB(conn);
|
||||
daf.Fill(ds.Tables["userfriends"]);
|
||||
}
|
||||
@@ -221,7 +221,7 @@ namespace OpenSim.Data.SQLite
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
m_log.Error("[USER]: Exception getting friends list for user: " + ex.ToString());
|
||||
m_log.Error("[USER DB]: Exception getting friends list for user: " + ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
override public void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid)
|
||||
{
|
||||
m_log.Info("[USER]: Stub UpdateUserCUrrentRegion called");
|
||||
m_log.Info("[USER DB]: Stub UpdateUserCUrrentRegion called");
|
||||
}
|
||||
|
||||
|
||||
@@ -343,7 +343,7 @@ namespace OpenSim.Data.SQLite
|
||||
DataRow row = users.Rows.Find(Util.ToRawUuidString(AgentID));
|
||||
if (row == null)
|
||||
{
|
||||
m_log.Warn("[WEBLOGIN]: Unable to store new web login key for non-existant user");
|
||||
m_log.Warn("[USER DB]: Unable to store new web login key for non-existant user");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -415,7 +415,7 @@ namespace OpenSim.Data.SQLite
|
||||
}
|
||||
}
|
||||
|
||||
m_log.Info("[SQLITE]: " +
|
||||
m_log.Info("[USER DB]: " +
|
||||
"Syncing user database: " + ds.Tables["users"].Rows.Count + " users stored");
|
||||
// save changes off to disk
|
||||
da.Update(ds, "users");
|
||||
@@ -769,7 +769,7 @@ namespace OpenSim.Data.SQLite
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
m_log.Info("[USERS]: users table already exists");
|
||||
m_log.Info("[USER DB]: users table already exists");
|
||||
}
|
||||
|
||||
try
|
||||
@@ -778,7 +778,7 @@ namespace OpenSim.Data.SQLite
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
m_log.Info("[USERS]: userfriends table already exists");
|
||||
m_log.Info("[USER DB]: userfriends table already exists");
|
||||
}
|
||||
|
||||
conn.Close();
|
||||
@@ -801,7 +801,7 @@ namespace OpenSim.Data.SQLite
|
||||
}
|
||||
catch (SqliteSyntaxException)
|
||||
{
|
||||
m_log.Info("[DATASTORE]: SQLite Database doesn't exist... creating");
|
||||
m_log.Info("[USER DB]: SQLite Database doesn't exist... creating");
|
||||
InitDB(conn);
|
||||
}
|
||||
conn.Open();
|
||||
|
||||
Reference in New Issue
Block a user