perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Terrence Brannon <>
Subject DBIx::Recordset : DBD::Pg 1.39 bind_param issues
Date Sun, 28 Dec 2003 19:27:05 GMT
It looks like we are in some sort of (painful?) symbiotic relationship 
here. As I update my drivers to make sure that Recordset works before 
release, I keep having problems.

This time, I tried to do the following code which is part of Recordset:

my @bind_param = ($i+1, $bind_values -> [$i], (defined ($bt) && $bt <= 
DBI::SQL_CHAR())?{TYPE => $bt}:undef ) ;
warn Dumper(\@bind_param);
$sth -> bind_param (@bind_param);

which yields this debug output:

DB:  'SELECT * FROM dbixrs1 WHERE   (  (name = ?))     ' 
bind_values=<Third Name> bind_types=<1>
WARN: $VAR1 = [
          'Third Name',
            'TYPE' => 1

Cannot specify both sql_type and pg_type at blib/lib/DBIx/ 
line 1377.

which shows two things about dbdimp.c in DBD::Pg's latest distro:

(a) it should say DBD::Pg where it currently says DBD::ChurlPg:

if ((svp = hv_fetch((HV*)SvRV(attribs),"pg_type", 7, 0))==NULL)
            croak("DBD::ChurlPg only knows about the pg_type attribute");

(b) the call to bind_param in the format used by Recordset is not 
supported, but should be per the DBI and DBD::Pg docs?

dbdimp.c in DBD::Pg 1.39 distro says:

 /* // XXX this is broken: bind_param(1,1,{TYPE=>SQL_INTEGER}); */
    if (attribs) {
        if (sql_type)
            croak ("Cannot specify both sql_type and pg_type");

but perldoc DBD::Pg says:

=item B<bind_param>

  $rv = $sth->bind_param($param_num, $bind_value, \%attr);

Supported by the driver as proposed by DBI.

Any suggestions for fixing this are welcome!

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message