Skip to Content.
Sympa Menu

freetds - Re: [freetds] Are LOBs supported? Two additional bytes arefetched for text column.

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Sebastien FLAESCH <sf AT 4js.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Are LOBs supported? Two additional bytes arefetched for text column.
  • Date: Thu, 10 Jan 2008 14:19:28 +0100

Frediano,

Thanks a lot... I think I will use the 0.82 instead of HEAD.

What's the tag I should use to cvs export?

Seb

ZIGLIO, Frediano, VF-IT wrote:
Il giorno mer, 09/01/2008 alle 11.11 +0100, Sebastien FLAESCH ha
scritto:
Hello,

Here is a new version of the odbctest17.c sample...

Now the program uses SQL_LEN_DATA_AT_EXEC() macro for
SQLBindParameter().
But still uses SQL_DATA_AT_EXEC for SQLBindCol() (I suppose
this is supported).
I think there is a problem when fetching text data:

By inserting 10000 bytes, then fetching, I get 2 additional
bytes for the text column.
I checked the values inserted in the database with:

select datalength(t), datalength(b) from tt

returns:

0 10000 10000
1 10000 10000

So to me the insert is ok.

Try the following:

./odbctest17.bin dsn user pswd 2

where 2 is the number of rows to be inserted.

Output gives:

>> insert... 0
>> SQLParamData: ptr = 0xbff4b990 rcode = 99
>> param 0xbff4b990: total bytes written = 10000
>> SQLParamData: ptr = 0xbff4b990 rcode = 99
>> param 0xbff4b990: total bytes written = 10000
>> SQLParamData: ptr = 0xbff4b990 rcode = 0
>> insert... 1
>> SQLParamData: ptr = 0xbff4b990 rcode = 99
>> param 0xbff4b990: total bytes written = 10000
>> SQLParamData: ptr = 0xbff4b990 rcode = 99
>> param 0xbff4b990: total bytes written = 10000
>> SQLParamData: ptr = 0xbff4b990 rcode = 0
>> fetch... 0 rcode = 0
>> readBlob field 1
>> step 1: 4096 bytes read...
>> step 2: 4096 bytes read...
>> step 3: 1810 bytes read...
>> total bytes read = 10002 <--- should be 10000
>> readBlob field 2
I'll fix this problem is that it consider numm-termination cause source
is longvarchar while it should consider destination (witch is
SQL_C_BINARY)


Fixed (both 0.82 and CVS HEAD)

freddy77
_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds






Archive powered by MHonArc 2.6.24.

Top of Page