From a4fa0a4309ab2da12e73ec86fb0a6951fc02f5ea Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" Date: Sun, 26 Aug 2012 01:30:56 +0000 Subject: [PATCH] Bug 559539: [Oracle] whine.pl sets run_next incorrectly due to CURRENT_DATE r/a=LpSolit git-svn-id: svn://10.0.0.236/trunk@264159 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/.bzrrev | 2 +- mozilla/webtools/bugzilla/Bugzilla/DB/Oracle.pm | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/mozilla/webtools/bugzilla/.bzrrev b/mozilla/webtools/bugzilla/.bzrrev index af1ab39fd95..4660b4c4993 100644 --- a/mozilla/webtools/bugzilla/.bzrrev +++ b/mozilla/webtools/bugzilla/.bzrrev @@ -1 +1 @@ -8356 \ No newline at end of file +8357 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/Bugzilla/DB/Oracle.pm b/mozilla/webtools/bugzilla/Bugzilla/DB/Oracle.pm index 3022e3b343e..d7ff086769e 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/DB/Oracle.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/DB/Oracle.pm @@ -294,6 +294,9 @@ sub adjust_statement { my $is_select = ($part =~ m/^\s*SELECT\b/io); my $has_from = ($part =~ m/\bFROM\b/io) if $is_select; + # Oracle includes the time in CURRENT_DATE. + $part =~ s/\bCURRENT_DATE\b/TRUNC(CURRENT_DATE)/io; + # Oracle use SUBSTR instead of SUBSTRING $part =~ s/\bSUBSTRING\b/SUBSTR/io; @@ -322,6 +325,9 @@ sub adjust_statement { $has_from = ($nonstring =~ m/\bFROM\b/io) if ($is_select and !$has_from); + # Oracle includes the time in CURRENT_DATE. + $nonstring =~ s/\bCURRENT_DATE\b/TRUNC(CURRENT_DATE)/io; + # Oracle use SUBSTR instead of SUBSTRING $nonstring =~ s/\bSUBSTRING\b/SUBSTR/io;