]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 559539: [Oracle] whine.pl sets run_next incorrectly due to CURRENT_DATE
authorDavid Taylor <davidt@yadt.co.uk>
Sun, 26 Aug 2012 01:19:57 +0000 (03:19 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Sun, 26 Aug 2012 01:19:57 +0000 (03:19 +0200)
r/a=LpSolit

Bugzilla/DB/Oracle.pm

index 3022e3b343e9b44b86f5b605e2601abdbedd2b5d..d7ff086769eefba3f597e3a5d4c854bbe16e5434 100644 (file)
@@ -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;