From: Hiroshi Inoue <inoue@tpf.co.jp>
To: Marten Lehmann <lehmann@cnm.de>
Cc: pgsql-odbc@postgresql.org
Subject: Re: SQLDescribeParam / SUPPORT_DESCRIBE_PARAM
Date: Wed, 09 Nov 2011 12:48:44 +0900
Message-ID: <4EB9F81C.6000108@tpf.co.jp> (raw)
In-Reply-To: <4EB9DA9C.7040800@cnm.de>
References: <4EB9DA9C.7040800@cnm.de>
Hi Marten,
(2011/11/09 10:42), Marten Lehmann wrote:
> Hello,
>
> I noticed that unixODBC logs IM001 SQL_ERRORs for SQLDescribeParam in
> its tracefile. Actually, I first noticed the problem when I tried to use
> a prepared statement in PHP 5.3.8 with a PostgreSQL 9.1 database and I
> got error messages at odbc_execute() due to the SQLDescribeParam error.
>
> First I thought that the problem is in PHPs ODBC extension because it
> worked fine back in PHP-5.3.3. But digging into the sources of PHP I
> found out, that the return value of SQLDescribeParam simply wasn't
> validated before 5.3.5 (and there as no 5.3.4 release), but it returned
> an IM001 SQL_ERROR ever since.
>
> So following the chain I looked at the source of psqlodbc and noticed,
> that the library is prepared for a database connection that supports
> SQLDescribeParam and this is verified by SUPPORT_DESCRIBE_PARAM().
>
> But what does it depend on, whether the connection supports it? psqlodbc
> is for PostgreSQL only. I built the latest PostgreSQL library, compiled
> the latest psqlodbc against it and SQLDescribeParam still threw the
> IM001 SQL_ERROR.
>
> As a quick fix just created a patch for PHP for my internal use, which
> removes checking of the return values of SQLDescribeParam. But that
> seems very odd. I'd really like to understand what's behind this issue.
Please check the *Server side prepare* option of your datasource or
add UseServerSidePrepare=1 to your connection string.
regards,
Inoue, Hiroshi
> Kind regards
> Marten Lehmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: inoue@tpf.co.jp, lehmann@cnm.de
Subject: Re: SQLDescribeParam / SUPPORT_DESCRIBE_PARAM
In-Reply-To: <4EB9F81C.6000108@tpf.co.jp>
References: <4EB9DA9C.7040800@cnm.de> <4EB9F81C.6000108@tpf.co.jp>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox