> If the user supplies the length of the argument rather than using -1, 
> bind_text expects that this length exclude the null termination, whereas 
> prepare apparently expects it to include the null termination.
Can I challenge you in that this conclusion is wrong? Everywhere in
the development world length of string always means "null termination
is not included" because explicitly providing length means there can
be no null termination at all.

Please show examples of code that led you to your conclusion and show
how it fails without null termination.


> leaving the reader to look through the description of how auto-detection of 
> length works in each case.

You are a little inconsistent here. Auto-detection of length doesn't
work when you explicitly provide string length, so you don't have to
look through it.


Pavel


On Wed, Sep 21, 2011 at 3:05 PM, Sean Pieper <spie...@nvidia.com> wrote:
> There's an apparent inconsistency in the behavior of  sqlite3_bind_text and 
> sqlite3_prepare_v2.
> If the user supplies the length of the argument rather than using -1, 
> bind_text expects that this length exclude the null termination, whereas 
> prepare apparently expects it to include the null termination.
>
> Since this is kind of surprising, it would be helpful if the documentation 
> for each function directly stated the desired behavior for explicit 
> declaration of length, rather than leaving the reader to look through the 
> description of how auto-detection of length works in each case.
>
> -sean
>
> -----------------------------------------------------------------------------------
> This email message is for the sole use of the intended recipient(s) and may 
> contain
> confidential information.  Any unauthorized review, use, disclosure or 
> distribution
> is prohibited.  If you are not the intended recipient, please contact the 
> sender by
> reply email and destroy all copies of the original message.
> -----------------------------------------------------------------------------------
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to