Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 648D8185C94F for ; Sat, 14 Jul 2012 18:50:55 -0300 (ADT) Received: from sd.tpf.co.jp ([210.161.239.34]) by makus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1SqAEm-0006X0-Hi for pgsql-odbc@postgresql.org; Sat, 14 Jul 2012 21:50:54 +0000 Received: (qmail 10541 invoked by uid 512); 14 Jul 2012 21:50:37 -0000 X-Authentication: inoue was authenticated by sd.tpf.co.jp at 14 Jul 2012 21:50:37 -0000 Received: from unknown (HELO ?192.168.2.101?) (183.76.21.62) by sd.tpf.co.jp with SMTP; 14 Jul 2012 21:50:37 -0000 Message-ID: <5001E9A3.6070707@tpf.co.jp> Date: Sun, 15 Jul 2012 06:50:27 +0900 From: Hiroshi Inoue User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 To: Lionel Elie Mamane CC: Terrence Enger , pgsql-odbc@postgresql.org Subject: Re: segfault in SQLSpecialColumns when table name is null string References: <1341922972.25065.19.camel@cougar-natty> <20120710142707.GB26793@capsaicin.mamane.lu> In-Reply-To: <20120710142707.GB26793@capsaicin.mamane.lu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201207/5 X-Sequence-Number: 10899 Hi、 (2012/07/10 23:27), Lionel Elie Mamane wrote: > On Tue, Jul 10, 2012 at 08:22:52AM -0400, Terrence Enger wrote: > >> Working with PostgreSQL version 8.4.12-0ubuntu11.04 and with ODBC >> driver versions 1:08.03.0200-1.2 (supplied with ubuntu-natty (11.04)) >> and pgsqlodbc-09.01.0100 (built locally), I have managed to provoke a >> segfault by calling SQLSpecialColumns with a null string for the table >> name. This call is, of course, a strange thing to do, and I cannot >> imagine any good result. Still, a segfault seems a disproportionate >> punishment for doing something silly. > > Also, the ultimate reason for this "strange thing" is that > > SQLColAttribute( (SQLHANDLE) 0x1ec7850, > (SQLUSMALLINT) 1, > (SQLUSMALLINT) 15, > (SQLPOINTER) 0x1eb2640, > 128, > (SQLSMALLINT *) 0x7fffffff97de, > NULL); > > where 15 == SQL_DESC_TABLE_NAME == SQL_COLUMN_TABLE_NAME > returns (writes at 0x1eb2640) an empty string for this query: > > SELECT "Num" "Numero", "data" FROM "foo"."Table1" What is your environment e.g. the version of your PG server or the version of your psqlodbc? regards, Hiroshi Inoue