diff options
author | Sean Dague | 2008-05-28 15:02:04 +0000 |
---|---|---|
committer | Sean Dague | 2008-05-28 15:02:04 +0000 |
commit | 7ddf183da4854a4c9f56906b0cdc64badf97660f (patch) | |
tree | 99d9b1fcba29629b84f2c41332245b6d723b70bc /OpenSim/Data/MySQL/MySQLDataStore.cs | |
parent | remove an erroneous line to fetch the terrain table in a way that (diff) | |
download | opensim-SC-7ddf183da4854a4c9f56906b0cdc64badf97660f.zip opensim-SC-7ddf183da4854a4c9f56906b0cdc64badf97660f.tar.gz opensim-SC-7ddf183da4854a4c9f56906b0cdc64badf97660f.tar.bz2 opensim-SC-7ddf183da4854a4c9f56906b0cdc64badf97660f.tar.xz |
remove terrain bloat, only keep last terrain revision
for mysql. For active terraformers this should return
a lot of database space.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLDataStore.cs | 6 |
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))); |