Skip site navigation (1) Skip section navigation (2)

bug in ODBC driver ?

From: Sergio Kessler <ser(at)perio(dot)unlp(dot)edu(dot)ar>
To: Pgsql-Interfaces <pgsql-interfaces(at)postgreSQL(dot)org>
Subject: bug in ODBC driver ?
Date: 1998-12-07 05:04:03
Message-ID: 366B61C3.39C0B67E@perio.unlp.edu.ar (view raw or flat)
Thread:
Lists: 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

Responses

pgsql-interfaces by date

Next:From: Eric Lee GreenDate: 1998-12-07 05:18:48
Subject: Re: [INTERFACES] crypt not included when compiling libpgtcl !!!!!!!
Previous:From: Raymond LawDate: 1998-12-07 02:34:21
Subject: Can't Update Database!

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group