aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorSean Dague2008-05-28 15:02:04 +0000
committerSean Dague2008-05-28 15:02:04 +0000
commit7ddf183da4854a4c9f56906b0cdc64badf97660f (patch)
tree99d9b1fcba29629b84f2c41332245b6d723b70bc
parentremove an erroneous line to fetch the terrain table in a way that (diff)
downloadopensim-SC_OLD-7ddf183da4854a4c9f56906b0cdc64badf97660f.zip
opensim-SC_OLD-7ddf183da4854a4c9f56906b0cdc64badf97660f.tar.gz
opensim-SC_OLD-7ddf183da4854a4c9f56906b0cdc64badf97660f.tar.bz2
opensim-SC_OLD-7ddf183da4854a4c9f56906b0cdc64badf97660f.tar.xz
remove terrain bloat, only keep last terrain revision
for mysql. For active terraformers this should return a lot of database space.
-rw-r--r--OpenSim/Data/MySQL/MySQLDataStore.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/OpenSim/Data/MySQL/MySQLDataStore.cs b/OpenSim/Data/MySQL/MySQLDataStore.cs
index 7ee625d..9a44fbd 100644
--- a/OpenSim/Data/MySQL/MySQLDataStore.cs
+++ b/OpenSim/Data/MySQL/MySQLDataStore.cs
@@ -442,15 +442,19 @@ namespace OpenSim.Data.MySQL
442 442
443 public void StoreTerrain(double[,] ter, LLUUID regionID) 443 public void StoreTerrain(double[,] ter, LLUUID regionID)
444 { 444 {
445 int revision = Util.UnixTimeSinceEpoch(); 445 int revision = 1;
446 m_log.Info("[REGION DB]: Storing terrain revision r" + revision.ToString()); 446 m_log.Info("[REGION DB]: Storing terrain revision r" + revision.ToString());
447 447
448 lock (m_dataSet) 448 lock (m_dataSet)
449 { 449 {
450 MySqlCommand delete = new MySqlCommand("delete from terrain where RegionUUID=?RegionUUID", m_connection);
450 MySqlCommand cmd = new MySqlCommand("insert into terrain(RegionUUID, Revision, Heightfield)" + 451 MySqlCommand cmd = new MySqlCommand("insert into terrain(RegionUUID, Revision, Heightfield)" +
451 " values(?RegionUUID, ?Revision, ?Heightfield)", m_connection); 452 " values(?RegionUUID, ?Revision, ?Heightfield)", m_connection);
452 using (cmd) 453 using (cmd)
453 { 454 {
455 delete.Parameters.Add(new MySqlParameter("?RegionUUID", Util.ToRawUuidString(regionID)));
456 delete.ExecuteNonQuery();
457
454 cmd.Parameters.Add(new MySqlParameter("?RegionUUID", Util.ToRawUuidString(regionID))); 458 cmd.Parameters.Add(new MySqlParameter("?RegionUUID", Util.ToRawUuidString(regionID)));
455 cmd.Parameters.Add(new MySqlParameter("?Revision", revision)); 459 cmd.Parameters.Add(new MySqlParameter("?Revision", revision));
456 cmd.Parameters.Add(new MySqlParameter("?Heightfield", serializeTerrain(ter))); 460 cmd.Parameters.Add(new MySqlParameter("?Heightfield", serializeTerrain(ter)));