Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: a.solovey [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 1.45
  • 1.47
Fixed in: 1.48



Subject: Error in do() using server-side $ placeholders
After upgrading to 1.47, the code below (also attached) gives an error: $dbh->do(q{SET search_path TO ?}, undef, 'public'); ERROR: syntax error at or near "$1" at character 20 Note that there is no $$ placeholders in the code above. Trace shows that do() tries to execute PQexecParams with ( SET search_path = $1 ) which, for some reason, fails. The same code works in 1.43 without any problem. I also tried 1.45 and it fails so the problem was introduced between 1.43 and 1.45. ----- System details: Perl v5.8.7 built for i386-freebsd-64int FreeBSD 6.0-RELEASE
Subject: a.plx
Download a.plx
application/octet-stream 130b

Message body not shown because it is not plain text.

CC: bug-DBD-Pg [...] rt.cpan.org,
CC: bug-DBD-Pg [...] rt.cpan.org,
Subject: Re: [Dbdpg-general] [rt.cpan.org #18258] Error in do() using server-side $ placeholders
Date: Mon, 3 Apr 2006 12:59:19 -0000
To: dbdpg-general [...] gborg.postgresql.org
From: "Greg Sabino Mullane" <greg [...] turnstep.com>
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Show quoted text
> After upgrading to 1.47, the code below (also attached) gives an error: > > $dbh->do(q{SET search_path TO ?}, undef, 'public'); > > ERROR: syntax error at or near "$1" at character 20 > > Note that there is no $$ placeholders in the code above. Trace shows > that do() tries to execute PQexecParams with ( SET search_path = $1 ) > which, for some reason, fails.
Apparently PQexecParams doesn't like anything but strict DML in it's calls. I've made modifications to the code in cvs to fix this, it will be a part of the soon-to-be-released version 1.48 of DBD::Pg. Thanks for the report. - -- Greg Sabino Mullane greg@turnstep.com PGP Key: 0x14964AC8 200604030855 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -----BEGIN PGP SIGNATURE----- iD8DBQFEMRtEvJuQZxSWSsgRArfKAKD+vgycrBb+Zrv45/0BQ3sNvkd7sACcCpEq KbOEjmgcmnpHuhc8Wt7QiYw= =1DB0 -----END PGP SIGNATURE-----