[interchange-cvs] interchange - markj modified 4 files

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Tue May 6 20:42:59 UTC 2008


User:      markj
Date:      2008-05-06 20:42:59 GMT
Modified:  dist/standard catalog.cfg
Modified:  lib/Vend/Table Common.pm DBI.pm DBI_CompositeKey.pm
Log:
* Added commented-out description and pragma usage for new dml pragma
  in catalog.cfg from Mike.

* Removed the option available in some polymorphs of set_slice that allowed
  key/value pairs to be passed in as a simple array.

Revision  Changes    Path
1.23                 interchange/dist/standard/catalog.cfg


rev 1.23, prev_rev 1.22
Index: catalog.cfg
===================================================================
RCS file: /var/cvs/interchange/dist/standard/catalog.cfg,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- catalog.cfg	24 Mar 2008 15:30:10 -0000	1.22
+++ catalog.cfg	6 May 2008 20:42:59 -0000	1.23
@@ -195,6 +195,23 @@
 # Don't allow <!--[itl tag]-->
 Pragma  no_html_comment_embed
 
+## DATA INSERTION PRAGMAS for form database inserts or updates
+
+## Restricts inserts to insert-only, but allows the fall-through
+## behavior from update to insert. No existing data will be clobbered.
+# Pragma dml=preserve
+
+## Pragma 'dml=strict' forces update or insert to only perform the
+## requested action.
+# Pragma dml=strict
+
+## Pragma 'dml=upsert' (the default) preserves Interchange's original
+## method of doing an update if the record exists, otherwise doing an
+## insert. This can clobber an existing key.
+# Pragma dml=upsert
+
+## END DATA INSERTION PRAGMAS
+
 #==========================================================================#
 
 # User session related settings.



2.50                 interchange/lib/Vend/Table/Common.pm


rev 2.50, prev_rev 2.49
Index: Common.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Table/Common.pm,v
retrieving revision 2.49
retrieving revision 2.50
diff -u -r2.49 -r2.50
--- Common.pm	5 May 2008 15:14:00 -0000	2.49
+++ Common.pm	6 May 2008 20:42:59 -0000	2.50
@@ -1,6 +1,6 @@
 # Vend::Table::Common - Common access methods for Interchange databases
 #
-# $Id: Common.pm,v 2.49 2008-05-05 15:14:00 markj Exp $
+# $Id: Common.pm,v 2.50 2008-05-06 20:42:59 markj Exp $
 #
 # Copyright (C) 2002-2008 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -23,7 +23,7 @@
 # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
 # MA  02110-1301  USA.
 
-$VERSION = substr(q$Revision: 2.49 $, 10);
+$VERSION = substr(q$Revision: 2.50 $, 10);
 use strict;
 
 package Vend::Table::Common;
@@ -416,9 +416,6 @@
 
 	if(ref $fary ne 'ARRAY') {
 		my $href = $fary;
-		if(ref $href ne 'HASH') {
-			$href = { $fary, $vary, @_ }
-		}
 		$vary = [ values %$href ];
 		$fary = [ keys   %$href ];
 	}



2.86                 interchange/lib/Vend/Table/DBI.pm


rev 2.86, prev_rev 2.85
Index: DBI.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Table/DBI.pm,v
retrieving revision 2.85
retrieving revision 2.86
diff -u -r2.85 -r2.86
--- DBI.pm	5 May 2008 15:14:00 -0000	2.85
+++ DBI.pm	6 May 2008 20:42:59 -0000	2.86
@@ -1,6 +1,6 @@
 # Vend::Table::DBI - Access a table stored in an DBI/DBD database
 #
-# $Id: DBI.pm,v 2.85 2008-05-05 15:14:00 markj Exp $
+# $Id: DBI.pm,v 2.86 2008-05-06 20:42:59 markj Exp $
 #
 # Copyright (C) 2002-2008 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -21,7 +21,7 @@
 # MA  02110-1301  USA.
 
 package Vend::Table::DBI;
-$VERSION = substr(q$Revision: 2.85 $, 10);
+$VERSION = substr(q$Revision: 2.86 $, 10);
 
 use strict;
 no warnings qw(uninitialized numeric);
@@ -1232,12 +1232,8 @@
 		$vary = [@$vin];
 	}
 	else {
-		my $href = $fin;
-		if(ref $href ne 'HASH') {
-			$href = { splice (@_, 2) };
-		}
-		$vary = [ values %$href ];
-		$fary = [ keys   %$href ];
+		$vary = [ values %$fin ];
+		$fary = [ keys   %$fin ];
 	}
 
 	if ($s->[$CONFIG]->{PREFER_NULL}) {



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


rev 1.13, prev_rev 1.12
Index: DBI_CompositeKey.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Table/DBI_CompositeKey.pm,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- DBI_CompositeKey.pm	5 May 2008 15:14:00 -0000	1.12
+++ DBI_CompositeKey.pm	6 May 2008 20:42:59 -0000	1.13
@@ -1,6 +1,6 @@
 # Vend::Table::DBI - Access a table stored in an DBI/DBD database
 #
-# $Id: DBI_CompositeKey.pm,v 1.12 2008-05-05 15:14:00 markj Exp $
+# $Id: DBI_CompositeKey.pm,v 1.13 2008-05-06 20:42:59 markj Exp $
 #
 # Copyright (C) 2002-2007 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.12 $, 10);
+$VERSION = substr(q$Revision: 1.13 $, 10);
 
 use strict;
 
@@ -341,25 +341,18 @@
 		$vary = [@$vin];
 	}
 	else {
-		my $href = $fin;
-		if(ref $href eq 'HASH') {
-			$href = { %$href };
-		}
-		else {
-			$href = { splice (@_, 2) };
-		}
 
 		if(! $key) {
 			@key = ();
 			for( @{$s->[$CONFIG]{_Key_columns}} ) {
-				push @key, delete $href->{$_};
+				push @key, delete $fin->{$_};
 			}
 			$key = \@key;
 			$exists = $s->record_exists(\@key);
 		}
 
-		$vary = [ values %$href ];
-		$fary = [ keys   %$href ];
+		$vary = [ values %$fin ];
+		$fary = [ keys   %$fin ];
 	}
 
 	if(! $key) {







More information about the interchange-cvs mailing list