Skip Menu |
 

This queue is for tickets about the DBD-Pg CPAN distribution.

Report information
The Basics
Id: 12870
Status: resolved
Priority: 0/
Queue: DBD-Pg

People
Owner: Nobody in particular
Requestors: felix.klee [...] inka.de
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.41
Fixed in: 1.42



Subject: Question mark strings is wrongly treated as placeholder
Platforms that are affected by this bug: * Slackware 9.1 (kernel 2.4.24), Perl 5.8.0 built for i486-linux, DBI 1.43, DBD::Pg 1.41_1, PostgreSQL 7.4.2 * Debian 3.1 (kernel 2.4.27), Perl v5.8.4 built for i386-linux-thread- multi, DBI 1.46, DBD::Pg 1.41, PostgreSQL 7.4.7 Description of the problem: If I execute the following code in one of the above environments, then I get the error message "DBD::Pg::db do failed: execute called with an unbound placeholder at test.pl line 10.". Note that lines 8 and 9 cause no trouble. use DBI; $dbh = DBI->connect(undef, undef, undef, {RaiseError => 1, AutoCommit => 1, PrintError => 0}) or die "Cannot connect to database: $DBI::errstr"; $dbh->do("SET client_encoding TO 'Latin1'"); eval { $dbh->do("DROP TABLE ptest"); }; $dbh->do("CREATE TABLE ptest(txt varchar(8))"); $dbh->do("INSERT INTO ptest VALUES('?')"); $dbh->do("INSERT INTO ptest VALUES('\\'')"); $dbh->do("INSERT INTO ptest VALUES('\\'?')"); # Line 10 $dbh->do("INSERT INTO ptest VALUES(?)", undef, "'?"); # Workaround $dbh->disconnect; Workaround: See line 11.
From: Felix E. Klee <felix.klee [...] inka.de>
Download (untitled) / with headers
text/plain 261b
[guest - Wed May 18 07:43:16 2005]: Show quoted text
> * Slackware 9.1 (kernel 2.4.24), Perl 5.8.0 built for i486-linux, DBI > 1.43, > DBD::Pg 1.41_1, PostgreSQL 7.4.2
I forgot to mention: If DBD::Pg 1.32 is used instead of DBD::Pg 1.41_1, then the bug is not triggered.
From: Felix E. Klee <felix.klee [...] inka.de>
Download (untitled) / with headers
text/plain 294b
[guest - Wed May 18 07:43:16 2005]: Show quoted text
> * Slackware 9.1 (kernel 2.4.24), Perl 5.8.0 built for i486-linux, DBI > 1.43, > DBD::Pg 1.41_1, PostgreSQL 7.4.2
I just tried my example script with the above configuration and DBD::Pg 1.41_2, and I'm happy to report that the bug seems to be fixed.
Download (untitled) / with headers
text/plain 352b
On Thu May 19 08:30:33 2005, guest wrote: Show quoted text
> [guest - Wed May 18 07:43:16 2005]:
> > * Slackware 9.1 (kernel 2.4.24), Perl 5.8.0 built for i486-linux, DBI > > 1.43, > > DBD::Pg 1.41_1, PostgreSQL 7.4.2
> > I just tried my example script with the above configuration and DBD::Pg > 1.41_2, and I'm happy to report that the bug seems to be fixed.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.