[Rt-commit] [svn] r1285 - DBIx-SearchBuilder/trunk rt/branches/3.2-RELEASE/lib/RT

robert at pallas.eruditorum.org robert at pallas.eruditorum.org
Mon Jul 26 15:08:00 EDT 2004


Author: robert
Date: Mon Jul 26 15:07:58 2004
New Revision: 1285

Modified:
   /   (props changed)
   DBIx-SearchBuilder/trunk/SearchBuilder.pm
   rt/branches/3.2-RELEASE/lib/RT/Tickets_Overlay.pm
Log:
 ----------------------------------------------------------------------
 r1287 at dog:  rspier | 2004-07-26T18:56:48.690023Z
 
 [fsck.com #5879] - DBIx::SearchBuilder should treat 'IS' as case insensitive, since most databases do too.
 ----------------------------------------------------------------------
 r1288 at dog:  rspier | 2004-07-26T19:00:50.217330Z
 
 MicroOptimizations:
 	- if we're doing an IS NULL search already, there's no reason to do a $null_columns_ok
 	- use || instead of 'or' so we can short-circuit
 ----------------------------------------------------------------------
 r1289 at dog:  rspier | 2004-07-26T19:06:54.604573Z
 
 MicroOptimization/Cleanup:
 	- get rid of $null_columns_ok flag
 	- clean up logic, and use string compare instead of regexp
 ----------------------------------------------------------------------


Modified: DBIx-SearchBuilder/trunk/SearchBuilder.pm
==============================================================================
--- DBIx-SearchBuilder/trunk/SearchBuilder.pm	(original)
+++ DBIx-SearchBuilder/trunk/SearchBuilder.pm	Mon Jul 26 15:07:58 2004
@@ -638,7 +638,7 @@
         #if we're explicitly told not to to quote the value or
         # we're doing an IS or IS NOT (null), don't quote the operator.
 
-        if ( $args{'QUOTEVALUE'} && $args{'OPERATOR'} !~ /IS/ ) {
+        if ( $args{'QUOTEVALUE'} && $args{'OPERATOR'} !~ /IS/i ) {
             my $tmp = $self->_Handle->dbh->quote( $args{'VALUE'} );
 
             # Accomodate DBI drivers that don't understand UTF8

Modified: rt/branches/3.2-RELEASE/lib/RT/Tickets_Overlay.pm
==============================================================================
--- rt/branches/3.2-RELEASE/lib/RT/Tickets_Overlay.pm	(original)
+++ rt/branches/3.2-RELEASE/lib/RT/Tickets_Overlay.pm	Mon Jul 26 15:07:58 2004
@@ -768,10 +768,6 @@
 
   die "No custom field named $field found\n" unless $cfid;
 
-
-
-  my $null_columns_ok;
-
   my $TicketCFs;
   # Perform one Join per CustomField
   if ($self->{_sql_keywordalias}{$cfid}) {
@@ -798,12 +794,9 @@
    # If we're trying to find custom fields that don't match something, we want tickets
    # where the custom field has no value at all
 
-  if (   ($op =~ /^IS$/i) or ($op =~ /^NOT LIKE$/i) or ( $op eq '!=' ) ) {
-    $null_columns_ok = 1;
-  }
-    
-
-  if ( $null_columns_ok) {
+  if ( (uc $op eq "IS NOT"  && uc $value ne "NULL")
+       || uc $op eq "NOT LIKE"
+       || $op eq '!=' ) {
     $self->_SQLLimit( ALIAS           => $TicketCFs,
 		      FIELD           => 'Content',
 		      OPERATOR        => 'IS',


More information about the Rt-commit mailing list