From: noreply@pgfoundry.org
To: noreply@pgfoundry.org
Subject: [ psqlodbc-Bugs-1007690 ] SQLNumResultCols returns error and HY000 error when it should be success and 0 columns
Date: Mon, 16 Jul 2007 13:21:40 +0000 (UTC)
Message-ID: <20070716132140.C3B61217040@pgfoundry.org> (raw)
Bugs item #1007690, was opened at 2007-07-16 13:21
You can respond by visiting:
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1007690&group_id=1000125
Category: None
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Martin Evans (mjevans)
Assigned to: Nobody (None)
Summary: SQLNumResultCols returns error and HY000 error when it should be success and 0 columns
Initial Comment:
Using the Postgres ODBC Driver 08.01.0200 on Linux/Ubuntu it fails some of the Perl DBD::ODBC tests. The tests attempt to update a column and then look at what SQLNumResultCols returns but SQLNumResultCols errors returning "HY000, No query has been executed with that handle". This may be demonstrated with:
create table fred (a int)
insert into table fred values (1)
perl -e 'use Data::Dumper;use DBI;$h=DBI->connect("dbi:ODBC:mydb","martin","easysoft");$s = $h->prepare("update fred set a = 1 where a = 1");print Dumper($s->{NAME});$s->execute;print Dumper($s->{NAME});'
$VAR1 = [];
Describe failed during DBI::st=HASH(0x82fca90)->FETCH(NAME,0) at /usr/lib/perl/5.8/Data/Dumper.pm line 511.
$VAR1 = undef;
If you look at an ODBC trace you'll see:
SQLPrepare(update table set column = 100 where column = 100);
SQLNumResultCols returns 0 columns
SQLMoreResults returns SQL_NO_DATA
SQLExecute
SQLRowCount returns 1 row affected
SQLNumResultCols returns 0 columns
SQLMoreResults returns SQL_NO_DATA
SQLNumResultCols returns an error saying
HY000 No query has been executed with that handle
The unixODBC driver manager lets this call through because it is not a function sequence error (usually the only error you get from SQLNumResultCols) and:
1. as far as I can see from the ODBC spec SQLNumResultCols should return success and 0 columns here
2. 3 other drivers I've tried today all work fine with this.
As far as I can tell this HY000 error has been specifically inserted into the postgres ODBC driver when returning success and 0 columns is the behavior outlined by ODBC and what most (if not all) other ODBC drivers do.
----------------------------------------------------------------------
You can respond by visiting:
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1007690&group_id=1000125
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: noreply@pgfoundry.org
Subject: Re: [ psqlodbc-Bugs-1007690 ] SQLNumResultCols returns error and HY000 error when it should be success and 0 columns
In-Reply-To: <20070716132140.C3B61217040@pgfoundry.org>
References: <20070716132140.C3B61217040@pgfoundry.org>
* 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