web/modules/rhn/RHN/DB/TinyURL.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit a90759c165d70ba9fe8e40347c4b872a96dc3a9d
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Jul 19 15:41:40 2011 +0200
Sysdate replaced with current_timestamp
In situations WHERE col < sysdate we can replace this with
current_timestamp. This function exists in both Oracle and PostgreSQL
and since there is no arithmetics in this statement the comparsion (or
any other operator) works well.
Under Oracle we use DATE type and in PostgreSQL we use TIMESTAMP WITH
TIMEZONE.
diff --git a/web/modules/rhn/RHN/DB/TinyURL.pm b/web/modules/rhn/RHN/DB/TinyURL.pm
index bf77071..785ae69 100644
--- a/web/modules/rhn/RHN/DB/TinyURL.pm
+++ b/web/modules/rhn/RHN/DB/TinyURL.pm
@@ -35,7 +35,7 @@ sub lookup {
my $sth = $dbh->prepare(<<EOS);
SELECT url FROM rhnTinyURL
WHERE token = :token
- AND expires > sysdate
+ AND expires > current_timestamp
AND enabled = 'Y'
EOS
$sth->execute_h(token => $token);
Show replies by date