[interchange-cvs] interchange - racke modified lib/Vend/Table/DBI_CompositeKey.pm

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Thu Aug 2 06:37:03 EDT 2007


User:      racke
Date:      2007-08-02 10:37:02 GMT
Modified:  lib/Vend/Table DBI_CompositeKey.pm
Log:
set_slice: skip updates on existing records when we have only key columns

Revision  Changes    Path
1.10      +6 -2      interchange/lib/Vend/Table/DBI_CompositeKey.pm


rev 1.10, prev_rev 1.9
Index: DBI_CompositeKey.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Table/DBI_CompositeKey.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- DBI_CompositeKey.pm	30 Mar 2007 11:39:54 -0000	1.9
+++ DBI_CompositeKey.pm	2 Aug 2007 10:37:02 -0000	1.10
@@ -1,6 +1,6 @@
 # Vend::Table::DBI - Access a table stored in an DBI/DBD database
 #
-# $Id: DBI_CompositeKey.pm,v 1.9 2007/03/30 11:39:54 pajamian Exp $
+# $Id: DBI_CompositeKey.pm,v 1.10 2007/08/02 10:37:02 racke Exp $
 #
 # Copyright (C) 2002-2005 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -21,7 +21,7 @@
 # MA  02110-1301  USA.
 
 package Vend::Table::DBI_CompositeKey;
-$VERSION = substr(q$Revision: 1.9 $, 10);
+$VERSION = substr(q$Revision: 1.10 $, 10);
 
 use strict;
 
@@ -404,6 +404,10 @@
     }
 
 	if ( $exists ) {
+		unless (@$fary) {
+			# as there are no data columns, we can safely skip the update
+			return $key;
+		}
 		my $fstring = join ",", map { "$_=?" } @$fary;
 		$sql = "update $s->[$TABLE] SET $fstring $s->[$CONFIG]{_Key_where}";
 	}








More information about the interchange-cvs mailing list