Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 457C73011AD for ; Tue, 8 Nov 2011 22:01:46 -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 10214-09 for ; Wed, 9 Nov 2011 02:01:40 +0000 (UTC) X-Greylist: delayed 00:18:39.390331 by SQLgrey-1.8.0-rc2 Received: from relay2.mail.vrmd.de (relay2.mail.vrmd.de [81.28.224.28]) by mail.postgresql.org (Postfix) with ESMTP id 0B0F73011AC for ; Tue, 8 Nov 2011 22:01:40 -0400 (AST) Received: from [217.248.216.115] (helo=[192.168.0.109]) by relay2.mail.vrmd.de with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1RNxBp-0006T0-9e for pgsql-odbc@postgresql.org; Wed, 09 Nov 2011 02:42:57 +0100 Message-ID: <4EB9DA9C.7040800@cnm.de> Date: Wed, 09 Nov 2011 02:42:52 +0100 From: Marten Lehmann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: pgsql-odbc@postgresql.org Subject: SQLDescribeParam / SUPPORT_DESCRIBE_PARAM Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Relay-User: lehmann@variomedia.de X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201111/18 X-Sequence-Number: 10736 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. Kind regards Marten Lehmann