[interchange-cvs] interchange - jon modified lib/Vend/Table/DBI.pm
interchange-core@interchange.redhat.com
interchange-core@interchange.redhat.com
Mon Mar 4 14:51:01 2002
User: jon
Date: 2002-03-04 19:50:02 GMT
Modified: lib/Vend/Table DBI.pm
Log:
Store number of rows in search result in value mv_search_match_count,
as is done for Interchange-native searches.
Remove a few outdated comments.
Revision Changes Path
2.14 +6 -10 interchange/lib/Vend/Table/DBI.pm
rev 2.14, prev_rev 2.13
Index: DBI.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Table/DBI.pm,v
retrieving revision 2.13
retrieving revision 2.14
diff -u -u -r2.13 -r2.14
--- DBI.pm 4 Feb 2002 08:25:54 -0000 2.13
+++ DBI.pm 4 Mar 2002 19:50:02 -0000 2.14
@@ -1,6 +1,6 @@
# Vend::Table::DBI - Access a table stored in an DBI/DBD database
#
-# $Id: DBI.pm,v 2.13 2002/02/04 08:25:54 mheins Exp $
+# $Id: DBI.pm,v 2.14 2002/03/04 19:50:02 jon Exp $
#
# Copyright (C) 1996-2001 Red Hat, Inc. <interchange@redhat.com>
#
@@ -20,7 +20,7 @@
# MA 02111-1307 USA.
package Vend::Table::DBI;
-$VERSION = substr(q$Revision: 2.13 $, 10);
+$VERSION = substr(q$Revision: 2.14 $, 10);
use strict;
@@ -1457,10 +1457,6 @@
return \@fld;
}
-# OLDSQL
-
-# END OLDSQL
-
sub touch {
return ''
}
@@ -1586,7 +1582,6 @@
#::logDebug("\$db->query=$opt->{query}");
if(defined $opt->{values}) {
- # do nothing
@arg = $opt->{values} =~ /['"]/
? ( Text::ParseWords::shellwords($opt->{values}) )
: (grep /\S/, split /\s+/, $opt->{values});
@@ -1760,10 +1755,11 @@
} # MVSEARCH
#::logDebug("finished query, rc=$rc ref=$ref arrayref=$opt->{arrayref} Tmp=$Vend::Interpolate::Tmp->{$opt->{arrayref}}");
+ if ($rc < 1 and CORE::ref($ref) and scalar(@$ref) ) {
+ $rc = scalar(@$ref);
+ $::Values->{mv_search_match_count} = $rc;
+ }
if ($opt->{row_count}) {
- if($rc < 1 and CORE::ref($ref) and scalar(@$ref) ) {
- $rc = scalar(@$ref);
- }
return $rc unless $opt->{list};
$ref = [ [ $rc ] ];
@na = [ 'row_count' ];