patch not working from November 19

Jeremy Davis jeremy at manageisp.com
Mon Dec 15 07:29:10 PST 2003


On Wed, Nov 19, 2003 at 05:39:30PM +1100, Bob Purdon wrote:
> Cannot specify both sql_type and pg_type at
> /usr/local/lib/perl5/site_perl/5.6.1/FS/Record.pm line 272.

I got the same error as this gentleman did.  I applied the patch, I first
tried the changes manual after researching your/Ivan's post to the author of
DBD::Pg on the 19th then happened to stumble across the post at the bottom.
Either way I applied the patch and now instead of Cannot specify both
sql_type and pg_type, I get:

 DBI::st=HASH(0x848afc8)->bind_param(...): attribute parameter '4' is not a
hash ref at /usr/lib/perl5/site_perl/5.8.0/FS/Record.pm line 272

What should I do?  I attempted to downgrade to 1.21 but it created problems
at first.  I didn't dig to deep into the later.  Any advice would be greatly
appreciated.

Sincerely,

Jeremy Davis


This is a bug in DBD::Pg 1.31.  The following patch should work around
the problem:

diff -u -r1.76 Record.pm
--- Record.pm   4 Nov 2003 10:57:05 -0000       1.76
+++ Record.pm   19 Nov 2003 18:09:38 -0000
@@ -313,9 +313,9 @@
     if ( $record->{$field} =~ /^\d+(\.\d+)?$/
          && $dbdef->table($table)->column($field)->type =~ /(int|serial)/i
     ) {
-      $sth->bind_param($bind++, $record->{$field}, { TYPE =>
SQL_INTEGER } );
+      $sth->bind_param($bind++, $record->{$field}, SQL_INTEGER );
     } else {
-      $sth->bind_param($bind++, $record->{$field}, { TYPE =>
SQL_VARCHAR } );
+      $sth->bind_param($bind++, $record->{$field}, SQL_VARCHAR );
     }
   }




More information about the freeside-users mailing list