summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorDavid Taylor <davidt@yadt.co.uk>2012-08-26 03:22:01 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2012-08-26 03:22:01 +0200
commit26066436dcb00548c6f5b09cc6cfc68f96a9f045 (patch)
tree30f216a268584fa66474c84628466bcf3c3c6fc4 /Bugzilla
parent6773f8949521744fba0c7fe1cc4bbe3016f7888f (diff)
downloadbugzilla-26066436dcb00548c6f5b09cc6cfc68f96a9f045.tar.gz
bugzilla-26066436dcb00548c6f5b09cc6cfc68f96a9f045.tar.xz
Bug 559539: [Oracle] whine.pl sets run_next incorrectly due to CURRENT_DATE
r/a=LpSolit
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/DB/Oracle.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/Bugzilla/DB/Oracle.pm b/Bugzilla/DB/Oracle.pm
index 2cbd19a82..83dc3a29a 100644
--- a/Bugzilla/DB/Oracle.pm
+++ b/Bugzilla/DB/Oracle.pm
@@ -310,8 +310,9 @@ sub adjust_statement {
my $has_from = ($part =~ m/\bFROM\b/io) if $is_select;
# Oracle recognizes CURRENT_DATE, but not CURRENT_DATE()
- $part =~ s/\bCURRENT_DATE\b\(\)/CURRENT_DATE/io;
-
+ # and its CURRENT_DATE is a date+time, so wrap in TRUNC()
+ $part =~ s/\bCURRENT_DATE\b(?:\(\))?/TRUNC(CURRENT_DATE)/io;
+
# Oracle use SUBSTR instead of SUBSTRING
$part =~ s/\bSUBSTRING\b/SUBSTR/io;
@@ -341,7 +342,8 @@ sub adjust_statement {
if ($is_select and !$has_from);
# Oracle recognizes CURRENT_DATE, but not CURRENT_DATE()
- $nonstring =~ s/\bCURRENT_DATE\b\(\)/CURRENT_DATE/io;
+ # and its CURRENT_DATE is a date+time, so wrap in TRUNC()
+ $nonstring =~ s/\bCURRENT_DATE\b(?:\(\))?/TRUNC(CURRENT_DATE)/io;
# Oracle use SUBSTR instead of SUBSTRING
$nonstring =~ s/\bSUBSTRING\b/SUBSTR/io;