Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 2858337EB72 for ; Sun, 15 Jul 2012 12:51:05 -0300 (ADT) Received: from sd.tpf.co.jp ([210.161.239.34]) by magus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1SqR62-0002ky-IY for pgsql-odbc@postgresql.org; Sun, 15 Jul 2012 15:51:04 +0000 Received: (qmail 30110 invoked by uid 512); 15 Jul 2012 15:50:41 -0000 X-Authentication: inoue was authenticated by sd.tpf.co.jp at 15 Jul 2012 15:50:41 -0000 Received: from unknown (HELO ?192.168.2.101?) (183.76.21.62) by sd.tpf.co.jp with SMTP; 15 Jul 2012 15:50:41 -0000 Message-ID: <5002E6D0.6090303@tpf.co.jp> Date: Mon, 16 Jul 2012 00:50:40 +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> <5001E9A3.6070707@tpf.co.jp> <20120715050211.GA4207@capsaicin.mamane.lu> In-Reply-To: <20120715050211.GA4207@capsaicin.mamane.lu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201207/7 X-Sequence-Number: 10901 (2012/07/15 14:02), Lionel Elie Mamane wrote: > On Sun, Jul 15, 2012 at 06:50:27AM +0900, Hiroshi Inoue wrote: >> (2012/07/10 23:27), Lionel Elie Mamane 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? > > On Debian GNU/Linux amd64, Debian packages. > > Client: > unixodbc 2.2.14p2-5 > psqlodbc 09.01.0100 > libpq5 9.1.3 > Server: > postgresql 9.0.6 SQLColattribute returns non null string here under Windows environment. Well how are you setting odbc.ini? regards, Hiroshi Inoue