pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hiroshi Inoue <Inoue@tpf.co.jp>
To: Keith Millard <Kmillard@pumatech.com>
Cc: pgsql-interfaces@postgresql.org
Subject: RE: Postgres odbc driver bug
Date: Sat, 5 May 2001 12:43:41 +0900
Message-ID: <EKEJJICOHDIEMGPNIFIJMEKMEEAA.Inoue@tpf.co.jp> (raw)
In-Reply-To: <D7058849BACBD411B0E900508BFDF7DA4BFE2A@MAILNH01>

Please try the latest driver 7.01.0005.
It solves several parameter handling problems.

regards,
Hiroshi Inoue
  -----Original Message-----
  From: pgsql-interfaces-owner@postgresql.org
[mailto:pgsql-interfaces-owner@postgresql.org]On Behalf Of Keith Millard
  Sent: Tuesday, May 01, 2001 10:37 PM
  To: 'pgsql-interfaces@postgresql.org'
  Subject: [INTERFACES] Postgres odbc driver bug


  We have found a reproducible problem with the Postgres ODBC driver.  It
has to do with the parameter replacement feature in the driver.  Below is a
piece of test code that shows the problem.  We were able to fix the problem
by making a change to execute.c in the ODBC driver code (attached).



  odbc driver version : Found in both 6.50 and 7.01.0004.

  postgresql database version : Found with both 7.0.2 and 7.0.3 versions of
Postgres.

  Server Operating System: Windows2000

  Client Operation System: Windows2000



  Explanation of the odbc driver bug:





     /*****************************************
      * ERROR HAPPENS HERE:
      * If we set the buffer that we binded to column "text1" now, it will
FAIL.
      * The SQLExecute in doQuery() will succeed (finding 0 rows), and the
      * SQLFetchScroll call will return SQL_NO_DATA_FOUND.
      *
      * This is because of a bug in the odbc driver. The call to
SQLNumResultCols
      * will execute the query in the driver, but the buffer that is binded
is
      * empty, so no rows will be found.  This of course assumes that the
table
      * doesn't contain any empty records for the "text1" column, which is
correct
      * for our test.  Then when we call SQLExcute, the driver will realize
it has
      * already done the query work and will not do it again, even though
our
      * buffer for parameter substitution has changed (next line of code
below
      * this comment).
      *****************************************/



   Zip file is attached.  The code is currently set up to fail, but I
describe in my comments that you can uncomment the code that sets the buffer
before SQLNumResultCols to make things will work.



  Thanks for your attention,

  Keith Millard

view thread (14+ messages)  latest in thread

Message-ID: <EKEJJICOHDIEMGPNIFIJMEKMEEAA.Inoue@tpf.co.jp>
Permalink:  ../EKEJJICOHDIEMGPNIFIJMEKMEEAA.Inoue@tpf.co.jp/
Also on:    postgresql.org/message-id/EKEJJICOHDIEMGPNIFIJMEKMEEAA.Inoue@tpf.co.jp

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: Inoue@tpf.co.jp, Kmillard@pumatech.com
  Subject: RE: Postgres odbc driver bug
  In-Reply-To: <EKEJJICOHDIEMGPNIFIJMEKMEEAA.Inoue@tpf.co.jp>

* 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