[Rt-commit] r17350 - rt/3.8/trunk/lib/RT

ruz at bestpractical.com ruz at bestpractical.com
Thu Dec 25 00:57:38 EST 2008


Author: ruz
Date: Thu Dec 25 00:57:38 2008
New Revision: 17350

Modified:
   rt/3.8/trunk/lib/RT/Tickets_Overlay.pm

Log:
* string limits in oracle are wierd. NULLs are stored instead
  of empty strings, but "column = ''" founds no rows.
  May be it's better to fix in SB, but at this point it's easier
  here.

Modified: rt/3.8/trunk/lib/RT/Tickets_Overlay.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/Tickets_Overlay.pm	(original)
+++ rt/3.8/trunk/lib/RT/Tickets_Overlay.pm	Thu Dec 25 00:57:38 2008
@@ -570,6 +570,14 @@
     # FIXME:
     # Valid Operators:
     #  =, !=, LIKE, NOT LIKE
+    if ( (!defined $value || !length $value)
+        && lc($op) ne 'is' && lc($op) ne 'is not'
+        && RT->Config->Get('DatabaseType') eq 'Oracle'
+    ) {
+        my $negative = 1 if $op eq '!=' || $op =~ /^NOT\s/;
+        $op = $negative? 'IS NOT': 'IS';
+        $value = 'NULL';
+    }
 
     $sb->_SQLLimit(
         FIELD         => $field,


More information about the Rt-commit mailing list