Re: [HACKERS] Bug in DBD::Pg v0.69?

From: Edmund Mergl <E(dot)Mergl(at)bawue(dot)de>
To: Michael J Schout <mschout(at)mail(dot)gkg-com(dot)com>
Cc: questions(at)postgreSQL(dot)org, hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Bug in DBD::Pg v0.69?
Date: 1998-03-20 06:23:23
Message-ID: 35120B5B.5CBFC418@bawue.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael J Schout wrote:
>
> Hi.
>
> Im running Postgresql v6.2, perl5.004_04, the latest DBI, and the latest
> DBD::Pg (0.69). I have a script that just executes a query, and tries to
> get the results, and it seems that this particular query doesnt work. Here
> is the code that does not work with DBD::Pg.
>
> use strict;
> use DBI;
>
> my $dbh = DBI->connect("dbi:Pg:dbname=gkgis");
>
> my $query;
> $query = "SELECT project, user, created, ";
> $query .= " 'now'::datetime-datetime(created) AS otime ";
> $query .= "FROM project_todo ";
> $query .= "WHERE openincident='TRUE' ";
> $query .= "ORDER BY created";
>
> print "QUERY : $query";
> my $sth = $dbh->prepare($query);
> my $rc = $sth->execute();
>
> This produces no accessible results! I know the query is okay because I
> can cut and paste teh query (that the script prints) into a psql session
> and it dumps out the results.
>
> What makes me think its a bug in DBD is that if I change the above script
> to have:
>
> my $query = "SELECT * FROM project_todo";
> ...
>
> instead of the long query above, it produces results. So the connection
> part is okay (ie access is granted etc). If I use Pg instead of DBI the
> long query works, but I would prefer to use DBI. Does anyone have any
> ideas what would cause this? Its a quite strange problem, adn I dont know
> how to debug DBD::Pg :)
>
> Mike

this is a bug in the scanner, which parses the statement for
placeholders.
It recognizes the following styles as placeholders: '?', ':1', ':foo',
but it does not distiniguish between ':' and '::'.
I'll fix that in the next release.

Edmund
--
Edmund Mergl mailto:E(dot)Mergl(at)bawue(dot)de
Im Haldenhau 9 http://www.bawue.de/~mergl
70565 Stuttgart fon: +49 711 747503
Germany gsm: +49 171 2645325

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Brett McCormick 1998-03-20 08:07:03 expr ? trueval : falseval
Previous Message The Hermit Hacker 1998-03-20 06:18:43 Re: [HACKERS] Buffer overuns with the Electric fence debugging library