[freetds] empty strings select as null bug

LacaK lacak at zoznam.sk
Thu Jun 11 01:39:04 EDT 2015


>
> tds_fdw assumes a column is NULL if dbdatlen() returns 0:
I am using for testing NULL dbdata(), which should return nil for NULL data.
(In my case I know, that column exists)

 From Sybase documentation:
"A NULL BYTE pointer is returned if there is no such column or if the 
data has a null value. To make sure that the data is really a null 
value, you should always check for a return of 0 from *dbdatlen*."

 From Microsoft documentation:
"A NULL BYTE pointer is returned if there is no such column or if the 
data has a null value. To make sure that the data is really a null 
value, check for a return of 0 from *dbdatlen*."

So you can use: dbdata()==nil && dbdatlen()==0

-Laco.



More information about the FreeTDS mailing list