[interchange-cvs] interchange - heins modified 2 files

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Thu Jun 9 15:27:01 EDT 2005


User:      heins
Date:      2005-06-09 19:27:01 GMT
Modified:  lib/Vend/Table Common.pm DBI.pm
Log:
* Allow different sorting options for different indexed fields. This
  only affects people using fast binary search, usually that means
  me. 8-)

Revision  Changes    Path
2.41      +11 -2     interchange/lib/Vend/Table/Common.pm


rev 2.41, prev_rev 2.40
Index: Common.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Table/Common.pm,v
retrieving revision 2.40
retrieving revision 2.41
diff -u -r2.40 -r2.41
--- Common.pm	30 Apr 2005 15:09:59 -0000	2.40
+++ Common.pm	9 Jun 2005 19:27:01 -0000	2.41
@@ -1,6 +1,6 @@
 # Vend::Table::Common - Common access methods for Interchange databases
 #
-# $Id: Common.pm,v 2.40 2005/04/30 15:09:59 mheins Exp $
+# $Id: Common.pm,v 2.41 2005/06/09 19:27:01 mheins Exp $
 #
 # Copyright (C) 2002-2003 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -23,7 +23,7 @@
 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA  02111-1307  USA.
 
-$VERSION = substr(q$Revision: 2.40 $, 10);
+$VERSION = substr(q$Revision: 2.41 $, 10);
 use strict;
 
 package Vend::Table::Common;
@@ -1185,6 +1185,10 @@
 				my $option = $1;
 				push @o, $1;
 			}
+			elsif (exists $options->{INDEX_OPTIONS}{$f}) {
+
+				push @o, $options->{INDEX_OPTIONS}{$f};
+			}
 			else {
 				push @o, '';
 			}
@@ -1219,6 +1223,11 @@
 				if($o[$i] =~ s/c//) {
 					$index .= <<EndOfIndex;
 			map { print { \$fh[$i] } "\$_\\t\$fields[0]\\n" } split /\\s*,\\s*/, \$fields[$fnum];
+EndOfIndex
+				}
+				elsif($o[$i] =~ s/s//) {
+					$index .= <<EndOfIndex;
+			map { print { \$fh[$i] } "\$_\\t\$fields[0]\\n" } split /\\s*;\\s*/, \$fields[$fnum];
 EndOfIndex
 				}
 				else {



2.63      +4 -3      interchange/lib/Vend/Table/DBI.pm


rev 2.63, prev_rev 2.62
Index: DBI.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Table/DBI.pm,v
retrieving revision 2.62
retrieving revision 2.63
diff -u -r2.62 -r2.63
--- DBI.pm	30 Apr 2005 15:09:59 -0000	2.62
+++ DBI.pm	9 Jun 2005 19:27:01 -0000	2.63
@@ -1,6 +1,6 @@
 # Vend::Table::DBI - Access a table stored in an DBI/DBD database
 #
-# $Id: DBI.pm,v 2.62 2005/04/30 15:09:59 mheins Exp $
+# $Id: DBI.pm,v 2.63 2005/06/09 19:27:01 mheins Exp $
 #
 # Copyright (C) 2002-2004 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -21,7 +21,7 @@
 # MA  02111-1307  USA.
 
 package Vend::Table::DBI;
-$VERSION = substr(q$Revision: 2.62 $, 10);
+$VERSION = substr(q$Revision: 2.63 $, 10);
 
 use strict;
 no warnings qw(uninitialized numeric);
@@ -439,7 +439,8 @@
 		for my $def (@{$config->{INDEX}}) {
 			my $uniq = '';
 			$uniq = 'UNIQUE' if $def =~ s/^\s*unique\s+//i;
-			$def =~ s/:\w+//g;
+			$def =~ s/:(\w+)//g
+				and $config->{INDEX_OPTIONS}{$def} = $1;
 			my $col = $def;
 			$col =~ s/\W.*//s;
 			$key_index_found = 1 if lc($col) eq lc($key);








More information about the interchange-cvs mailing list