[interchange-cvs] interchange - heins modified 2 files

interchange-core@icdevgroup.org interchange-core@icdevgroup.org
Fri Oct 18 03:11:01 2002


User:      heins
Date:      2002-10-18 07:10:46 GMT
Modified:  lib/Vend Scan.pm Search.pm
Log:
* Allow searching for the empty string if mv_min_string =3D 0.

* Prevent generation of bogus limit function when SQL has already done
  a "select fields from table where field =3D 'foo'".

Revision  Changes    Path
2.17      +3 -2      interchange/lib/Vend/Scan.pm


rev 2.17, prev_rev 2.16
Index: Scan.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/lib/Vend/Scan.pm,v
retrieving revision 2.16
retrieving revision 2.17
diff -u -r2.16 -r2.17
--- Scan.pm	10 Aug 2002 02:30:26 -0000	2.16
+++ Scan.pm	18 Oct 2002 07:10:46 -0000	2.17
@@ -1,6 +1,6 @@
 # Vend::Scan - Prepare searches for Interchange
 #
-# $Id: Scan.pm,v 2.16 2002/08/10 02:30:26 mheins Exp $
+# $Id: Scan.pm,v 2.17 2002/10/18 07:10:46 mheins Exp $
 #
 # Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -29,7 +29,7 @@
 			perform_search
 			);
=20
-$VERSION =3D substr(q$Revision: 2.16 $, 10);
+$VERSION =3D substr(q$Revision: 2.17 $, 10);
=20
 use strict;
 use Vend::Util;
@@ -849,6 +849,7 @@
 	my @fields;
 #::logDebug("receiving verbatim_array: " . ::uneval (\@_));
 	@fields =3D ref $_[1] ? @{$_[1]} : split /\0/, $_[1], -1;
+	@fields =3D ('') if ! @fields;
 	unshift(@fields, @{$_[2]}) if $_[2];
 	return \@fields;
 }



2.14      +6 -4      interchange/lib/Vend/Search.pm


rev 2.14, prev_rev 2.13
Index: Search.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/lib/Vend/Search.pm,v
retrieving revision 2.13
retrieving revision 2.14
diff -u -r2.13 -r2.14
--- Search.pm	10 Oct 2002 21:24:45 -0000	2.13
+++ Search.pm	18 Oct 2002 07:10:46 -0000	2.14
@@ -1,6 +1,6 @@
 # Vend::Search - Base class for search engines
 #
-# $Id: Search.pm,v 2.13 2002/10/10 21:24:45 mheins Exp $
+# $Id: Search.pm,v 2.14 2002/10/18 07:10:46 mheins Exp $
 #
 # Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -21,7 +21,7 @@
=20
 package Vend::Search;
=20
-$VERSION =3D substr(q$Revision: 2.13 $, 10);
+$VERSION =3D substr(q$Revision: 2.14 $, 10);
=20
 use strict;
 use vars qw($VERSION);
@@ -241,8 +241,8 @@
 	my $all_chars =3D $s->{mv_all_chars}[0];
=20
 	while ($i < @specs) {
-#::logDebug("i=3D$i specs=3D$#specs");
-		if($#specs and length($specs[$i]) =3D=3D 0) { # should add a switch
+#::logDebug("i=3D$i specs=3D$#specs mv_min_string=3D$s->{mv_min_string}");
+		if($#specs and length($specs[$i]) =3D=3D 0 and $s->{mv_min_string} !=3D =
0) { # should add a switch
 			if($s->{mv_coordinate}) {
 		        splice(@{$s->{mv_search_group}}, $i, 1);
 		        splice(@{$s->{mv_search_field}}, $i, 1);
@@ -289,6 +289,7 @@
 	}
=20
 #::logDebug("regex_specs=3D" . ::uneval($s->{regex_specs}));
+#::logDebug("eq_specs_sql=3D" . ::uneval($s->{eq_specs_sql}));
=20
 	if ( ! $s->{mv_exact_match} and ! $s->{mv_coordinate}) {
 		my $string =3D join ' ', @specs;
@@ -758,6 +759,7 @@
 			last DOLIMIT if $f;
 #::logDebug("do_limit past f.");
 			last DOLIMIT if $s->{mv_small_data};
+			last DOLIMIT if $s->{eq_specs_sql};
 			last DOLIMIT if (grep $_, @{$s->{mv_orsearch}});
 			last DOLIMIT if defined $s->{mv_search_relate}
 							&& $s->{mv_search_relate} =3D~ s/\bor\b/or/i;