Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id ACF019FB546 for ; Mon, 16 Jul 2007 10:23:53 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 94752-01-10 for ; Mon, 16 Jul 2007 10:23:35 -0300 (ADT) Received: from pgfoundry.org (pgfoundry.org [200.46.204.130]) by postgresql.org (Postfix) with ESMTP id 2058B9FB878 for ; Mon, 16 Jul 2007 10:21:51 -0300 (ADT) Received: from localhost (unknown [200.46.204.187]) by pgfoundry.org (Postfix) with ESMTP id 288AB217043; Mon, 16 Jul 2007 13:21:42 +0000 (UTC) Received: from pgfoundry.org ([200.46.204.130]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 93697-01; Mon, 16 Jul 2007 10:21:34 -0300 (ADT) Received: by pgfoundry.org (Postfix, from userid 80) id C3B61217040; Mon, 16 Jul 2007 13:21:40 +0000 (UTC) To: noreply@pgfoundry.org From: Subject: [ psqlodbc-Bugs-1007690 ] SQLNumResultCols returns error and HY000 error when it should be success and 0 columns Content-type: text/plain; charset=UTF-8 Message-Id: <20070716132140.C3B61217040@pgfoundry.org> Date: Mon, 16 Jul 2007 13:21:40 +0000 (UTC) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/21 X-Sequence-Number: 9076 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