Hi,

Quoting Oscar Martinez <[EMAIL PROTECTED]>:

> I don't know if this is the best way to fix this or the problem itself has
> to do with this, but doing this gives me the result I need.
>
> Another problem is that, libdbi itself has a function to check for null
> strings. It checks the size and a flag (DBI_VALUE_NULL) and both conditions
> have to be met. But the flag is no set so, for libdbi, it seems that a
> string that has 0 size and the flat not set, is not a null string. Is it a
> task of the freetds dbd module to set that flag?
>

I assume that the first problem which you "fixed" by bzero'ing the  
buffer is a consequence of the second problem. It is indeed the  
drivers' job to set the NULL flag appropriately. If it is set, libdbi  
should never attempt to access a buffer which contains a NULL value.  
However, someone familiar with the FreeTDS driver should provide a  
second opinion.

If no one else jumps in, please have a look at e.g. the MySQL driver.  
The _get_row_data() uses exactly the double check you mentioned (size  
is zero and raw has the NULL value) to set the flag appropriately. You  
may want to experiment with similar code to fix the FreeTDS driver.  
I'll be happy to integrate whatever you come up with into the cvs  
version.

regards,
Markus



-- 
Markus Hoenicka
[EMAIL PROTECTED]
(Spam-protected email: replace the quadrupeds with "mhoenicka")
http://www.mhoenicka.de


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Libdbi-drivers-devel mailing list
Libdbi-drivers-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-drivers-devel

Reply via email to