From: Sergio Kessler <ser@perio.unlp.edu.ar>
To: Pgsql-Interfaces <pgsql-interfaces@postgreSQL.org>
Subject: bug in ODBC driver ?
Date: Mon, 07 Dec 1998 02:04:03 -0300
Message-ID: <366B61C3.39C0B67E@perio.unlp.edu.ar> (raw)
Hi (Byron ?),
I think I've found a bug in the postODBC driver, version
6.40.0001.
The problem is with the function SQLGetData.
According to the docs of ODBC, when retrieving long data
(blobs), if the buffer is not enough, this function must
return SQL_SUCCESS_WITH_INFO and SQLSTATE 01004
(String data, right truncated) and in the variable
length_or_ind, it must return the _remaining_ byte
length of the data.
The function is not working this way, ie I call it
(in Delphi):
SQLGetData( hstmt, FieldNo, SQL_BINARY, PChar(TargetValue),
15, @strlen_or_ind);
Note that I put 15 as the buffer size, I _know_ that the
total size of the field (a text field in postgres) is 23
bytes, so this call must return SQL_SUCCESS_WITH_INFO
and SQLSTATE 01004 and the value of strlen_or_ind must
be 8.
But it return SQL_SUCCESS and strlen_or_ind = 23.
Also, the driver, don't must write more bytes than
the buffer size, ie. if the buffer size is 15 the
driver should write no more than 15 bytes.
Maybe this is the cause why other people are insulting the
BDE with blob fields (I don't use the BDE, btw)
Hope this help.
PS: if you will fix this, please, test it with 0 as the
buffer size, because I intend to make two calls, one with
0 (the driver don't write _nothing_ to the buffer) to
know the total bytes of the data and other with this number
as the buffer length.
--
Who is the General Failure and what f* do reading my disk !?
--
Sergio Kessler
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: ser@perio.unlp.edu.ar
Subject: Re: bug in ODBC driver ?
In-Reply-To: <366B61C3.39C0B67E@perio.unlp.edu.ar>
* 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