Keith Medcalf wrote:
> In the case of a BLOB if a NULL pointer is returned the error code must
> be retrieved and then if and only if the bytes counter is greater than
> 0 is the error valid.
>
> Does this mean that if you are retrieving the value of a blob via the
> colmn_blob interface you should ask for the column_bytes first and only
> expect a NULL pointer if the bytes count is zero?

For detecting errors, it does not really matter whether you call _blob
or _bytes first.  (A zeroblob might need to be expanded in the _blob
call, but it does not matter when exactly this error happens.)

In many cases, your code will copy the value elsewhere, so it will be
necessary to call _bytes first to allocate the buffer.

If you do not check the type beforehand, _blob must be called first
because the possible type conversion might change the size.


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to