bug in ODBC driver ? - Mailing list pgsql-interfaces

From Sergio Kessler
Subject bug in ODBC driver ?
Date
Msg-id 366B61C3.39C0B67E@perio.unlp.edu.ar
Whole thread Raw
List pgsql-interfaces
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

pgsql-interfaces by date:

Previous
From: Constantin Teodorescu
Date:
Subject: Re: [INTERFACES] Re: libpgtcl.dll for Windows
Next
From: Byron Nikolaidis
Date:
Subject: Re: [INTERFACES] bug in ODBC driver ?