aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Data.MySQL/MySQLGridData.cs
diff options
context:
space:
mode:
authorTeravus Ovares2007-12-12 01:23:15 +0000
committerTeravus Ovares2007-12-12 01:23:15 +0000
commit83f727bb7c1da0f49ccf727bea8384ea4ebdd7d1 (patch)
tree0e725f6386e934a4d4a5dca88d0855e6109fbb18 /OpenSim/Framework/Data.MySQL/MySQLGridData.cs
parent* Temporarily sisabled neighbour cache for regions in the SceneCommunicationS... (diff)
downloadopensim-SC-83f727bb7c1da0f49ccf727bea8384ea4ebdd7d1.zip
opensim-SC-83f727bb7c1da0f49ccf727bea8384ea4ebdd7d1.tar.gz
opensim-SC-83f727bb7c1da0f49ccf727bea8384ea4ebdd7d1.tar.bz2
opensim-SC-83f727bb7c1da0f49ccf727bea8384ea4ebdd7d1.tar.xz
* Patch from justincc to fix Inconsistent automatic mysql table creation - see bug 169
Diffstat (limited to 'OpenSim/Framework/Data.MySQL/MySQLGridData.cs')
-rw-r--r--OpenSim/Framework/Data.MySQL/MySQLGridData.cs34
1 files changed, 34 insertions, 0 deletions
diff --git a/OpenSim/Framework/Data.MySQL/MySQLGridData.cs b/OpenSim/Framework/Data.MySQL/MySQLGridData.cs
index bb0e8b3..ac3d849 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLGridData.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLGridData.cs
@@ -62,8 +62,42 @@ namespace OpenSim.Framework.Data.MySQL
62 database = 62 database =
63 new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, 63 new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling,
64 settingPort); 64 settingPort);
65
66 TestTables();
65 } 67 }
66 68
69 #region Test and initialization code
70
71 /// <summary>
72 /// Ensure that the user related tables exists and are at the latest version
73 /// </summary>
74 private void TestTables()
75 {
76 Dictionary<string, string> tableList = new Dictionary<string, string>();
77
78 tableList["regions"] = null;
79 database.GetTableVersion(tableList);
80
81 UpgradeRegionsTable(tableList["regions"]);
82 }
83
84 /// <summary>
85 /// Create or upgrade the table if necessary
86 /// </summary>
87 /// <param name="oldVersion">A null indicates that the table does not
88 /// currently exist</param>
89 private void UpgradeRegionsTable(string oldVersion)
90 {
91 // null as the version, indicates that the table didn't exist
92 if (oldVersion == null)
93 {
94 database.ExecuteResourceSql("CreateRegionsTable.sql");
95 return;
96 }
97 }
98
99 #endregion
100
67 /// <summary> 101 /// <summary>
68 /// Shuts down the grid interface 102 /// Shuts down the grid interface
69 /// </summary> 103 /// </summary>