diff options
author | Geir Nøklebye | 2017-04-13 12:07:06 +0200 |
---|---|---|
committer | Michael Cerquoni | 2017-04-19 13:40:49 -0400 |
commit | fe83763c365dfa2ba77ebd902810683cedd58ffa (patch) | |
tree | 3ed653a654a41ead1a587ced23f9e56fbb3c5930 /OpenSim/Data/PGSQL/PGSQLGroupsData.cs | |
parent | update ubODE for Linux x86 and x86_64 to include lasted ODE 0.13.2 (diff) | |
download | opensim-SC_OLD-fe83763c365dfa2ba77ebd902810683cedd58ffa.zip opensim-SC_OLD-fe83763c365dfa2ba77ebd902810683cedd58ffa.tar.gz opensim-SC_OLD-fe83763c365dfa2ba77ebd902810683cedd58ffa.tar.bz2 opensim-SC_OLD-fe83763c365dfa2ba77ebd902810683cedd58ffa.tar.xz |
PGSQL: Fixed a failing query in GroupsData for deleting groups messages older than 14 days. The little known abstime function could be used for a double cast. The field TMStamp should be changed to store the data as a proper timestamp. Related to Mantis #7848. Usually this would easily be solved using the to_timestamp function, but there is no support for it in NPGSQL as there are no very close functionality in .NET
Signed-off-by: Michael Cerquoni <nebadon2025@gmail.com>
Diffstat (limited to '')
-rwxr-xr-x | OpenSim/Data/PGSQL/PGSQLGroupsData.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/OpenSim/Data/PGSQL/PGSQLGroupsData.cs b/OpenSim/Data/PGSQL/PGSQLGroupsData.cs index 6ef576b..f398256 100755 --- a/OpenSim/Data/PGSQL/PGSQLGroupsData.cs +++ b/OpenSim/Data/PGSQL/PGSQLGroupsData.cs | |||
@@ -435,7 +435,7 @@ namespace OpenSim.Data.PGSQL | |||
435 | 435 | ||
436 | using (NpgsqlCommand cmd = new NpgsqlCommand()) | 436 | using (NpgsqlCommand cmd = new NpgsqlCommand()) |
437 | { | 437 | { |
438 | cmd.CommandText = String.Format("delete from {0} where \"TMStamp\" < CURRENT_DATE - INTERVAL '2 week'", m_Realm); | 438 | cmd.CommandText = String.Format("delete from {0} where \"TMStamp\"::abstime::timestamp < now() - INTERVAL '2 week'", m_Realm); |
439 | 439 | ||
440 | ExecuteNonQuery(cmd); | 440 | ExecuteNonQuery(cmd); |
441 | } | 441 | } |
@@ -461,7 +461,7 @@ namespace OpenSim.Data.PGSQL | |||
461 | 461 | ||
462 | using (NpgsqlCommand cmd = new NpgsqlCommand()) | 462 | using (NpgsqlCommand cmd = new NpgsqlCommand()) |
463 | { | 463 | { |
464 | cmd.CommandText = String.Format("delete from {0} where \"TMStamp\" < CURRENT_DATE - INTERVAL '2 week'", m_Realm); | 464 | cmd.CommandText = String.Format("delete from {0} where \"TMStamp\"::abstime::timestamp < now() - INTERVAL '2 week'", m_Realm); |
465 | 465 | ||
466 | ExecuteNonQuery(cmd); | 466 | ExecuteNonQuery(cmd); |
467 | } | 467 | } |