[interchange-cvs] interchange - jon modified 2 files

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Sun May 18 02:50:22 UTC 2008


User:      jon
Date:      2008-05-18 02:50:22 GMT
Modified:  .        UPGRADE
Modified:  lib/Vend/Table DBI_CompositeKey.pm
Log:
Fix regression in composite primary key DBI module.

Unit test 154 broke due to a hashref being modified directly instead of
copied.

Also note incompatible change in UPGRADE document.

Revision  Changes    Path
2.30                 interchange/UPGRADE


rev 2.30, prev_rev 2.29
Index: UPGRADE
===================================================================
RCS file: /var/cvs/interchange/UPGRADE,v
retrieving revision 2.29
retrieving revision 2.30
diff -u -u -r2.29 -r2.30
--- UPGRADE	17 May 2008 14:35:39 -0000	2.29
+++ UPGRADE	18 May 2008 02:50:21 -0000	2.30
@@ -94,8 +94,8 @@
 
 KNOWN ISSUES UPGRADING FROM 5.5.2
 
-Several old versions of CPAN modules were distributed in the extra/ directory
-but have been removed:
+1. Several old versions of CPAN modules were distributed in the extra/
+directory but have been removed:
 
     Business::UPS - part of Bundle::InterchangeKitchenSink
     File::Spec - now distributed with Perl itself
@@ -105,7 +105,18 @@
 If you find Interchange won't start up, check to make sure you have all the
 necessary Perl modules.
 
-The syntax of the custom SQL function for counters has changed. At the time
+2. We have removed the option available in some polymorphs of the
+database abstraction layer's set_slice() routine that allowed key/value
+pairs to be passed in as a simple array. For example, this will no longer
+work:
+
+    $db->set_slice($key, $field1, $value1)
+
+But it can be rewritten as this, which has long worked:
+
+    $db->set_slice($key, [$field1], [$value1])
+
+3. The syntax of the custom SQL function for counters has changed. At the time
 of the feature's introduction on 2007-11-17, the syntax was e.g.:
 
     UserDB  default   sql_counter  "userdb:custom_counter('userdb_username_seq')"



1.14                 interchange/lib/Vend/Table/DBI_CompositeKey.pm


rev 1.14, prev_rev 1.13
Index: DBI_CompositeKey.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Table/DBI_CompositeKey.pm,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -u -r1.13 -r1.14
--- DBI_CompositeKey.pm	6 May 2008 20:42:59 -0000	1.13
+++ DBI_CompositeKey.pm	18 May 2008 02:50:21 -0000	1.14
@@ -1,8 +1,8 @@
 # Vend::Table::DBI - Access a table stored in an DBI/DBD database
 #
-# $Id: DBI_CompositeKey.pm,v 1.13 2008-05-06 20:42:59 markj Exp $
+# $Id: DBI_CompositeKey.pm,v 1.14 2008-05-18 02:50:21 jon Exp $
 #
-# Copyright (C) 2002-2007 Interchange Development Group
+# Copyright (C) 2002-2008 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -21,7 +21,7 @@
 # MA  02110-1301  USA.
 
 package Vend::Table::DBI_CompositeKey;
-$VERSION = substr(q$Revision: 1.13 $, 10);
+$VERSION = substr(q$Revision: 1.14 $, 10);
 
 use strict;
 
@@ -340,19 +340,20 @@
 		$fary = [@$fin];
 		$vary = [@$vin];
 	}
-	else {
+	elsif (ref $fin eq 'HASH') {
+		my $href = { %$fin };
 
 		if(! $key) {
 			@key = ();
 			for( @{$s->[$CONFIG]{_Key_columns}} ) {
-				push @key, delete $fin->{$_};
+				push @key, delete $href->{$_};
 			}
 			$key = \@key;
 			$exists = $s->record_exists(\@key);
 		}
 
-		$vary = [ values %$fin ];
-		$fary = [ keys   %$fin ];
+		$vary = [ values %$href ];
+		$fary = [ keys   %$href ];
 	}
 
 	if(! $key) {







More information about the interchange-cvs mailing list