Permalink
Browse files

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.
  • Loading branch information...
1 parent 10a3769 commit 6361aea8317eab5b2468ab93115ef012698d53bc @jonjensen jonjensen committed May 18, 2008
Showing with 22 additions and 10 deletions.
  1. +14 −3 UPGRADE
  2. +8 −7 lib/Vend/Table/DBI_CompositeKey.pm
View
17 UPGRADE
@@ -94,8 +94,8 @@ This issue does not affect earlier versions of PostgreSQL.
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 @@ but have been removed:
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,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 @@ sub set_slice {
$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) {

0 comments on commit 6361aea

Please sign in to comment.