pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Lionel Elie Mamane <lionel@mamane.lu>
To: Terrence Enger <tenger@iseries-guru.com>
Cc: pgsql-odbc@postgresql.org
Subject: Re: segfault in SQLSpecialColumns when table name is null string
Date: Tue, 10 Jul 2012 16:27:07 +0200
Message-ID: <20120710142707.GB26793@capsaicin.mamane.lu> (raw)
In-Reply-To: <1341922972.25065.19.camel@cougar-natty>
References: <1341922972.25065.19.camel@cougar-natty>

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"

Similarly, so do the similar calls with SQL_DESC_CATALOG_NAME and
SQL_DESC_SCHEMA_NAME.

By contrast, they do return good information for query

 SELECT "Num" AS "Numero", "data" FROM "foo"."Table1"

That is also a bug in the ODBC driver and should IMHO be fixed.

-- 
Lionel



view thread (9+ messages)  latest in thread

Message-ID: <20120710142707.GB26793@capsaicin.mamane.lu>
Permalink:  ../20120710142707.GB26793@capsaicin.mamane.lu/
Also on:    postgresql.org/message-id/20120710142707.GB26793@capsaicin.mamane.lu

 · 

reply

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: lionel@mamane.lu, tenger@iseries-guru.com
  Subject: Re: segfault in SQLSpecialColumns when table name is null string
  In-Reply-To: <20120710142707.GB26793@capsaicin.mamane.lu>
  References: <1341922972.25065.19.camel@cougar-natty> <20120710142707.GB26793@capsaicin.mamane.lu>

* 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