Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id B7D5B4A7475 for ; Tue, 8 Nov 2011 23:48:53 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 94503-01 for ; Wed, 9 Nov 2011 03:48:47 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34]) by mail.postgresql.org (Postfix) with SMTP id 196E14A7474 for ; Tue, 8 Nov 2011 23:48:46 -0400 (AST) Received: (qmail 6371 invoked by uid 512); 9 Nov 2011 03:48:44 -0000 Received: from unknown (HELO ?100.0.32.108?) (100.0.32.108) by sd2.tpf-fw-c.co.jp with SMTP; 9 Nov 2011 03:48:44 -0000 Message-ID: <4EB9F81C.6000108@tpf.co.jp> Date: Wed, 09 Nov 2011 12:48:44 +0900 From: Hiroshi Inoue User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; ja; rv:1.9.2.23) Gecko/20110920 Thunderbird/3.1.15 MIME-Version: 1.0 To: Marten Lehmann CC: pgsql-odbc@postgresql.org Subject: Re: SQLDescribeParam / SUPPORT_DESCRIBE_PARAM References: <4EB9DA9C.7040800@cnm.de> In-Reply-To: <4EB9DA9C.7040800@cnm.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-3.101 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-1.201 X-Spam-Level: X-Archive-Number: 201111/19 X-Sequence-Number: 10737 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