[interchange-cvs] interchange - jon modified lib/Vend/Table/DBI.pm

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Fri Sep 30 16:56:59 EDT 2005


User:      jon
Date:      2005-09-30 20:56:58 GMT
Modified:  lib/Vend/Table DBI.pm
Log:
Use more generic SQL_NUMERIC instead of SQL_INTEGER to bind numeric
parameters.

This fixes a problem on PostgreSQL >= 7.4 and recent versions of DBD::Pg
that now use server-side prepared statements and binding instead of
binding in the DBD itself. The PostgreSQL server was rejecting numbers
with decimals when binding to SQL_INTEGER, because, well, they're not
integers.

Tested on MySQL 3.23, PostgreSQL 8.0, and Oracle 8i.

Revision  Changes    Path
2.66      +3 -3      interchange/lib/Vend/Table/DBI.pm


rev 2.66, prev_rev 2.65
Index: DBI.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Table/DBI.pm,v
retrieving revision 2.65
retrieving revision 2.66
diff -u -u -r2.65 -r2.66
--- DBI.pm	14 Sep 2005 02:01:14 -0000	2.65
+++ DBI.pm	30 Sep 2005 20:56:58 -0000	2.66
@@ -1,6 +1,6 @@
 # Vend::Table::DBI - Access a table stored in an DBI/DBD database
 #
-# $Id: DBI.pm,v 2.65 2005/09/14 02:01:14 jon Exp $
+# $Id: DBI.pm,v 2.66 2005/09/30 20:56:58 jon 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.65 $, 10);
+$VERSION = substr(q$Revision: 2.66 $, 10);
 
 use strict;
 no warnings qw(uninitialized numeric);
@@ -1769,7 +1769,7 @@
 			}
 		};
 	}
-	my @num = map { exists $config->{NUMERIC}{$_} ? DBI::SQL_INTEGER : undef } @fld;
+	my @num = map { exists $config->{NUMERIC}{$_} ? DBI::SQL_NUMERIC : undef } @fld;
 	$config->{_Numeric_ary} = \@num;
 	if($config->{UPPERCASE}) {
 		@fld = map { lc $_ } @fld;








More information about the interchange-cvs mailing list