aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-05-01 13:27:40 +0000
committerJustin Clarke Casey2008-05-01 13:27:40 +0000
commitd72bdf432a622f237b3030c1da9d1bccca20f83c (patch)
tree80b72df740a2858ac9ca8c3707ef45ff81488f67 /OpenSim/Data/MySQL
parent* Change mysql inventory items table version 3 upgrade sql to provide explici... (diff)
downloadopensim-SC_OLD-d72bdf432a622f237b3030c1da9d1bccca20f83c.zip
opensim-SC_OLD-d72bdf432a622f237b3030c1da9d1bccca20f83c.tar.gz
opensim-SC_OLD-d72bdf432a622f237b3030c1da9d1bccca20f83c.tar.bz2
opensim-SC_OLD-d72bdf432a622f237b3030c1da9d1bccca20f83c.tar.xz
* 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
Diffstat (limited to 'OpenSim/Data/MySQL')
-rw-r--r--OpenSim/Data/MySQL/MySQLAssetData.cs6
-rw-r--r--OpenSim/Data/MySQL/MySQLDataStore.cs46
-rw-r--r--OpenSim/Data/MySQL/MySQLGridData.cs2
-rw-r--r--OpenSim/Data/MySQL/MySQLManager.cs2
-rw-r--r--OpenSim/Data/MySQL/MySQLUserData.cs2
-rw-r--r--OpenSim/Data/MySQL/Resources/CreateItemsTable.sql12
-rw-r--r--OpenSim/Data/MySQL/Resources/UpgradeItemsTableToVersion3.sql2
7 files changed, 36 insertions, 36 deletions
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs
index b4a9191..efcf59e 100644
--- a/OpenSim/Data/MySQL/MySQLAssetData.cs
+++ b/OpenSim/Data/MySQL/MySQLAssetData.cs
@@ -49,7 +49,7 @@ namespace OpenSim.Data.MySQL
49 // null as the version, indicates that the table didn't exist 49 // null as the version, indicates that the table didn't exist
50 if (oldVersion == null) 50 if (oldVersion == null)
51 { 51 {
52 m_log.Info("[ASSETS]: Creating new database tables"); 52 m_log.Info("[ASSETS DB]: Creating new database tables");
53 _dbConnection.ExecuteResourceSql("CreateAssetsTable.sql"); 53 _dbConnection.ExecuteResourceSql("CreateAssetsTable.sql");
54 return; 54 return;
55 } 55 }
@@ -102,7 +102,7 @@ namespace OpenSim.Data.MySQL
102 catch (Exception e) 102 catch (Exception e)
103 { 103 {
104 m_log.ErrorFormat( 104 m_log.ErrorFormat(
105 "[ASSETS]: MySql failure fetching asset {0}" + Environment.NewLine + e.ToString() 105 "[ASSETS DB]: MySql failure fetching asset {0}" + Environment.NewLine + e.ToString()
106 + Environment.NewLine + "Attempting reconnection", assetID); 106 + Environment.NewLine + "Attempting reconnection", assetID);
107 _dbConnection.Reconnect(); 107 _dbConnection.Reconnect();
108 } 108 }
@@ -141,7 +141,7 @@ namespace OpenSim.Data.MySQL
141 catch (Exception e) 141 catch (Exception e)
142 { 142 {
143 m_log.ErrorFormat( 143 m_log.ErrorFormat(
144 "[ASSETS]: " + 144 "[ASSETS DB]: " +
145 "MySql failure creating asset {0} with name {1}" + Environment.NewLine + e.ToString() 145 "MySql failure creating asset {0} with name {1}" + Environment.NewLine + e.ToString()
146 + Environment.NewLine + "Attempting reconnection", asset.FullID, asset.Name); 146 + Environment.NewLine + "Attempting reconnection", asset.FullID, asset.Name);
147 _dbConnection.Reconnect(); 147 _dbConnection.Reconnect();
diff --git a/OpenSim/Data/MySQL/MySQLDataStore.cs b/OpenSim/Data/MySQL/MySQLDataStore.cs
index 1f9ea70..33981de 100644
--- a/OpenSim/Data/MySQL/MySQLDataStore.cs
+++ b/OpenSim/Data/MySQL/MySQLDataStore.cs
@@ -88,7 +88,7 @@ namespace OpenSim.Data.MySQL
88 m_dataSet = new DataSet(); 88 m_dataSet = new DataSet();
89 this.persistPrimInventories = persistPrimInventories; 89 this.persistPrimInventories = persistPrimInventories;
90 90
91 m_log.Info("[DATASTORE]: MySql - connecting: " + connectionstring); 91 m_log.Info("[REGION DB]: MySql - connecting: " + connectionstring);
92 m_connection = new MySqlConnection(connectionstring); 92 m_connection = new MySqlConnection(connectionstring);
93 93
94 TestTablesVersionable(m_connection); 94 TestTablesVersionable(m_connection);
@@ -256,7 +256,7 @@ namespace OpenSim.Data.MySQL
256 { 256 {
257 if ((prim.GetEffectiveObjectFlags() & (uint) LLObject.ObjectFlags.Physics) == 0) 257 if ((prim.GetEffectiveObjectFlags() & (uint) LLObject.ObjectFlags.Physics) == 0)
258 { 258 {
259 m_log.Info("[DATASTORE]: Adding obj: " + obj.UUID + " to region: " + regionUUID); 259 m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID);
260 addPrim(prim, obj.UUID, regionUUID); 260 addPrim(prim, obj.UUID, regionUUID);
261 } 261 }
262 else 262 else
@@ -270,7 +270,7 @@ namespace OpenSim.Data.MySQL
270 270
271 public void RemoveObject(LLUUID obj, LLUUID regionUUID) 271 public void RemoveObject(LLUUID obj, LLUUID regionUUID)
272 { 272 {
273 m_log.InfoFormat("[DATASTORE]: Removing obj: {0} from region: {1}", obj.UUID, regionUUID); 273 m_log.InfoFormat("[REGION DB]: Removing obj: {0} from region: {1}", obj.UUID, regionUUID);
274 274
275 DataTable prims = m_primTable; 275 DataTable prims = m_primTable;
276 DataTable shapes = m_shapeTable; 276 DataTable shapes = m_shapeTable;
@@ -334,7 +334,7 @@ namespace OpenSim.Data.MySQL
334 lock (m_dataSet) 334 lock (m_dataSet)
335 { 335 {
336 DataRow[] primsForRegion = prims.Select(byRegion, orderByParent); 336 DataRow[] primsForRegion = prims.Select(byRegion, orderByParent);
337 m_log.Info("[DATASTORE]: " + 337 m_log.Info("[REGION DB]: " +
338 "Loaded " + primsForRegion.Length + " prims for region: " + regionUUID); 338 "Loaded " + primsForRegion.Length + " prims for region: " + regionUUID);
339 339
340 foreach (DataRow primRow in primsForRegion) 340 foreach (DataRow primRow in primsForRegion)
@@ -390,11 +390,11 @@ namespace OpenSim.Data.MySQL
390 } 390 }
391 catch (Exception e) 391 catch (Exception e)
392 { 392 {
393 m_log.Error("[DATASTORE]: Failed create prim object, exception and data follows"); 393 m_log.Error("[REGION DB]: Failed create prim object, exception and data follows");
394 m_log.Info("[DATASTORE]: " + e.ToString()); 394 m_log.Info("[REGION DB]: " + e.ToString());
395 foreach (DataColumn col in prims.Columns) 395 foreach (DataColumn col in prims.Columns)
396 { 396 {
397 m_log.Info("[DATASTORE]: Col: " + col.ColumnName + " => " + primRow[col]); 397 m_log.Info("[REGION DB]: Col: " + col.ColumnName + " => " + primRow[col]);
398 } 398 }
399 } 399 }
400 } 400 }
@@ -438,7 +438,7 @@ namespace OpenSim.Data.MySQL
438 public void StoreTerrain(double[,] ter, LLUUID regionID) 438 public void StoreTerrain(double[,] ter, LLUUID regionID)
439 { 439 {
440 int revision = Util.UnixTimeSinceEpoch(); 440 int revision = Util.UnixTimeSinceEpoch();
441 m_log.Info("[DATASTORE]: Storing terrain revision r" + revision.ToString()); 441 m_log.Info("[REGION DB]: Storing terrain revision r" + revision.ToString());
442 442
443 DataTable terrain = m_dataSet.Tables["terrain"]; 443 DataTable terrain = m_dataSet.Tables["terrain"];
444 lock (m_dataSet) 444 lock (m_dataSet)
@@ -493,11 +493,11 @@ namespace OpenSim.Data.MySQL
493 } 493 }
494 else 494 else
495 { 495 {
496 m_log.Info("[DATASTORE]: No terrain found for region"); 496 m_log.Info("[REGION DB]: No terrain found for region");
497 return null; 497 return null;
498 } 498 }
499 499
500 m_log.Info("[DATASTORE]: Loaded terrain revision r" + rev.ToString()); 500 m_log.Info("[REGION DB]: Loaded terrain revision r" + rev.ToString());
501 } 501 }
502 } 502 }
503 return terret; 503 return terret;
@@ -1329,7 +1329,7 @@ namespace OpenSim.Data.MySQL
1329 if (!persistPrimInventories) 1329 if (!persistPrimInventories)
1330 return; 1330 return;
1331 1331
1332 m_log.InfoFormat("[DATASTORE]: Persisting Prim Inventory with prim ID {0}", primID); 1332 m_log.InfoFormat("[REGION DB]: Persisting Prim Inventory with prim ID {0}", primID);
1333 1333
1334 // For now, we're just going to crudely remove all the previous inventory items 1334 // For now, we're just going to crudely remove all the previous inventory items
1335 // no matter whether they have changed or not, and replace them with the current set. 1335 // no matter whether they have changed or not, and replace them with the current set.
@@ -1341,7 +1341,7 @@ namespace OpenSim.Data.MySQL
1341 foreach (TaskInventoryItem newItem in items) 1341 foreach (TaskInventoryItem newItem in items)
1342 { 1342 {
1343// m_log.InfoFormat( 1343// m_log.InfoFormat(
1344// "[DATASTORE]: " + 1344// "[REGION DB]: " +
1345// "Adding item {0}, {1} to prim ID {2}", 1345// "Adding item {0}, {1} to prim ID {2}",
1346// newItem.Name, newItem.ItemID, newItem.ParentPartID); 1346// newItem.Name, newItem.ItemID, newItem.ParentPartID);
1347 1347
@@ -1572,8 +1572,8 @@ namespace OpenSim.Data.MySQL
1572 } 1572 }
1573 catch (Exception ex) 1573 catch (Exception ex)
1574 { 1574 {
1575 m_log.Error("[MySql]: Error connecting to MySQL server: " + ex.Message); 1575 m_log.Error("[REGION DB]: Error connecting to MySQL server: " + ex.Message);
1576 m_log.Error("[MySql]: Application is terminating!"); 1576 m_log.Error("[REGION DB]: Application is terminating!");
1577 Thread.CurrentThread.Abort(); 1577 Thread.CurrentThread.Abort();
1578 } 1578 }
1579 } 1579 }
@@ -1584,7 +1584,7 @@ namespace OpenSim.Data.MySQL
1584 } 1584 }
1585 catch (MySqlException e) 1585 catch (MySqlException e)
1586 { 1586 {
1587 m_log.WarnFormat("[MySql]: Primitives Table Already Exists: {0}", e); 1587 m_log.WarnFormat("[REGION DB]: Primitives Table Already Exists: {0}", e);
1588 } 1588 }
1589 1589
1590 try 1590 try
@@ -1593,7 +1593,7 @@ namespace OpenSim.Data.MySQL
1593 } 1593 }
1594 catch (MySqlException e) 1594 catch (MySqlException e)
1595 { 1595 {
1596 m_log.WarnFormat("[MySql]: Shapes Table Already Exists: {0}", e); 1596 m_log.WarnFormat("[REGION DB]: Shapes Table Already Exists: {0}", e);
1597 } 1597 }
1598 1598
1599 try 1599 try
@@ -1602,7 +1602,7 @@ namespace OpenSim.Data.MySQL
1602 } 1602 }
1603 catch (MySqlException e) 1603 catch (MySqlException e)
1604 { 1604 {
1605 m_log.WarnFormat("[MySql]: Items Table Already Exists: {0}", e); 1605 m_log.WarnFormat("[REGION DB]: Items Table Already Exists: {0}", e);
1606 } 1606 }
1607 1607
1608 try 1608 try
@@ -1611,7 +1611,7 @@ namespace OpenSim.Data.MySQL
1611 } 1611 }
1612 catch (MySqlException e) 1612 catch (MySqlException e)
1613 { 1613 {
1614 m_log.WarnFormat("[MySql]: Terrain Table Already Exists: {0}", e); 1614 m_log.WarnFormat("[REGION DB]: Terrain Table Already Exists: {0}", e);
1615 } 1615 }
1616 1616
1617 //try 1617 //try
@@ -1629,7 +1629,7 @@ namespace OpenSim.Data.MySQL
1629 } 1629 }
1630 catch (MySqlException e) 1630 catch (MySqlException e)
1631 { 1631 {
1632 m_log.WarnFormat("[MySql]: LandAccessList Table Already Exists: {0}", e); 1632 m_log.WarnFormat("[REGION DB]: LandAccessList Table Already Exists: {0}", e);
1633 } 1633 }
1634 conn.Close(); 1634 conn.Close();
1635 } 1635 }
@@ -1682,7 +1682,7 @@ namespace OpenSim.Data.MySQL
1682 { 1682 {
1683 if (!tmpDS.Tables["prims"].Columns.Contains(col.ColumnName)) 1683 if (!tmpDS.Tables["prims"].Columns.Contains(col.ColumnName))
1684 { 1684 {
1685 m_log.Info("[DATASTORE]: Missing required column:" + col.ColumnName); 1685 m_log.Info("[REGION DB]: Missing required column:" + col.ColumnName);
1686 return false; 1686 return false;
1687 } 1687 }
1688 } 1688 }
@@ -1691,7 +1691,7 @@ namespace OpenSim.Data.MySQL
1691 { 1691 {
1692 if (!tmpDS.Tables["primshapes"].Columns.Contains(col.ColumnName)) 1692 if (!tmpDS.Tables["primshapes"].Columns.Contains(col.ColumnName))
1693 { 1693 {
1694 m_log.Info("[DATASTORE]: Missing required column:" + col.ColumnName); 1694 m_log.Info("[REGION DB]: Missing required column:" + col.ColumnName);
1695 return false; 1695 return false;
1696 } 1696 }
1697 } 1697 }
@@ -1702,7 +1702,7 @@ namespace OpenSim.Data.MySQL
1702 { 1702 {
1703 if (!tmpDS.Tables["terrain"].Columns.Contains(col.ColumnName)) 1703 if (!tmpDS.Tables["terrain"].Columns.Contains(col.ColumnName))
1704 { 1704 {
1705 m_log.Info("[DATASTORE]: Missing require column:" + col.ColumnName); 1705 m_log.Info("[REGION DB]: Missing require column:" + col.ColumnName);
1706 return false; 1706 return false;
1707 } 1707 }
1708 } 1708 }
@@ -1711,7 +1711,7 @@ namespace OpenSim.Data.MySQL
1711 { 1711 {
1712 if (!tmpDS.Tables["land"].Columns.Contains(col.ColumnName)) 1712 if (!tmpDS.Tables["land"].Columns.Contains(col.ColumnName))
1713 { 1713 {
1714 m_log.Info("[DATASTORE]: Missing require column:" + col.ColumnName); 1714 m_log.Info("[REGION DB]: Missing require column:" + col.ColumnName);
1715 return false; 1715 return false;
1716 } 1716 }
1717 } 1717 }
diff --git a/OpenSim/Data/MySQL/MySQLGridData.cs b/OpenSim/Data/MySQL/MySQLGridData.cs
index b6274d4..df52ae0 100644
--- a/OpenSim/Data/MySQL/MySQLGridData.cs
+++ b/OpenSim/Data/MySQL/MySQLGridData.cs
@@ -284,7 +284,7 @@ namespace OpenSim.Data.MySQL
284 } 284 }
285 else 285 else
286 { 286 {
287 m_log.Error("[DATABASE]: Searched for a Region Name shorter then 3 characters"); 287 m_log.Error("[GRID DB]: Searched for a Region Name shorter then 3 characters");
288 return null; 288 return null;
289 } 289 }
290 } 290 }
diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs
index d522b78..c62cfa7 100644
--- a/OpenSim/Data/MySQL/MySQLManager.cs
+++ b/OpenSim/Data/MySQL/MySQLManager.cs
@@ -89,7 +89,7 @@ namespace OpenSim.Data.MySQL
89 } 89 }
90 catch(Exception e) 90 catch(Exception e)
91 { 91 {
92 throw new Exception( "Connection error while using connection string ["+connectionString+"]", e ); 92 throw new Exception("Connection error while using connection string ["+connectionString+"]", e);
93 } 93 }
94 94
95 m_log.Info("[MYSQL]: Connection established"); 95 m_log.Info("[MYSQL]: Connection established");
diff --git a/OpenSim/Data/MySQL/MySQLUserData.cs b/OpenSim/Data/MySQL/MySQLUserData.cs
index 66b65dc..382d69c 100644
--- a/OpenSim/Data/MySQL/MySQLUserData.cs
+++ b/OpenSim/Data/MySQL/MySQLUserData.cs
@@ -346,7 +346,7 @@ namespace OpenSim.Data.MySQL
346 346
347 override public void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid) 347 override public void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid)
348 { 348 {
349 m_log.Info("[USER]: Stub UpdateUserCUrrentRegion called"); 349 m_log.Info("[USER DB]: Stub UpdateUserCUrrentRegion called");
350 } 350 }
351 351
352 override public List<AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query) 352 override public List<AvatarPickerAvatar> GeneratePickerResults(LLUUID queryID, string query)
diff --git a/OpenSim/Data/MySQL/Resources/CreateItemsTable.sql b/OpenSim/Data/MySQL/Resources/CreateItemsTable.sql
index 24ebccd..ffdbe17 100644
--- a/OpenSim/Data/MySQL/Resources/CreateItemsTable.sql
+++ b/OpenSim/Data/MySQL/Resources/CreateItemsTable.sql
@@ -12,12 +12,12 @@ CREATE TABLE `inventoryitems` (
12 `creatorID` varchar(36) default NULL, 12 `creatorID` varchar(36) default NULL,
13 `inventoryBasePermissions` int(10) unsigned NOT NULL default 0, 13 `inventoryBasePermissions` int(10) unsigned NOT NULL default 0,
14 `inventoryEveryOnePermissions` int(10) unsigned NOT NULL default 0, 14 `inventoryEveryOnePermissions` int(10) unsigned NOT NULL default 0,
15 `salePrice` int(11) default NULL, 15 `salePrice` int(11) NOT NULL default 0,
16 `saleType` tinyint(4) default NULL, 16 `saleType` tinyint(4) NOT NULL default 0,
17 `creationDate` int(11) default NULL, 17 `creationDate` int(11) NOT NULL default 0,
18 `groupID` varchar(36) default NULL, 18 `groupID` varchar(36) NOT NULL default '00000000-0000-0000-0000-000000000000',
19 `groupOwned` tinyint(4) default NULL, 19 `groupOwned` tinyint(4) NOT NULL default 0,
20 `flags` int(11) unsigned default NULL, 20 `flags` int(11) unsigned NOT NULL default 0,
21 PRIMARY KEY (`inventoryID`), 21 PRIMARY KEY (`inventoryID`),
22 KEY `owner` (`avatarID`), 22 KEY `owner` (`avatarID`),
23 KEY `folder` (`parentFolderID`) 23 KEY `folder` (`parentFolderID`)
diff --git a/OpenSim/Data/MySQL/Resources/UpgradeItemsTableToVersion3.sql b/OpenSim/Data/MySQL/Resources/UpgradeItemsTableToVersion3.sql
index 5bd6994..b4108ab 100644
--- a/OpenSim/Data/MySQL/Resources/UpgradeItemsTableToVersion3.sql
+++ b/OpenSim/Data/MySQL/Resources/UpgradeItemsTableToVersion3.sql
@@ -1,7 +1,7 @@
1ALTER TABLE `inventoryitems` 1ALTER TABLE `inventoryitems`
2 ADD COLUMN `salePrice` int(11) NOT NULL default 0, 2 ADD COLUMN `salePrice` int(11) NOT NULL default 0,
3 ADD COLUMN `saleType` tinyint(4) NOT NULL default 0, 3 ADD COLUMN `saleType` tinyint(4) NOT NULL default 0,
4 ADD COLUMN `creationDate` int(11) NOT NULL default 3000, 4 ADD COLUMN `creationDate` int(11) NOT NULL default 0,
5 ADD COLUMN `groupID` varchar(36) NOT NULL default '00000000-0000-0000-0000-000000000000', 5 ADD COLUMN `groupID` varchar(36) NOT NULL default '00000000-0000-0000-0000-000000000000',
6 ADD COLUMN `groupOwned` tinyint(4) NOT NULL default 0, 6 ADD COLUMN `groupOwned` tinyint(4) NOT NULL default 0,
7 ADD COLUMN `flags` int(11) unsigned NOT NULL default 0, 7 ADD COLUMN `flags` int(11) unsigned NOT NULL default 0,