-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01/16/2011 08:30 AM, Navaneeth.K.N wrote:
> However, I am wondring why the function (sqlite3_bind_text) don't
> respect NULL character in the string and stop reading when it find
> one?

Others have pointed out the API allows for you to ask exactly that.  SQLite
quite happily works with nulls as part of a string.  It is part of my test
suite.  There are some cases where it is useful.

In general the behaviour of the SQLite APIs is to trust what you tell them.
 If you want your strings to contain nulls they'll happily oblige.  You can
also supply invalid UTF8.  It could add verification but the developer using
SQLite in the same process is not hostile.  Adding verification would merely
make things slower.  Of course if you are getting data from an untrusted
source you should verify it but you have that knowledge, not SQLite.

And just to blow your mind a little further, SQLite happily allows zero
length table and columns names.  This works.

  CREATE TABLE ""("" "");
  INSERT INTO "" VALUES(3);
  SELECT ""+"" FROM "";

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk0ztqYACgkQmOOfHg372QQ7lACgtnKvp6BdxPtzHcLjtbUp1cG1
I4EAoNGQpfv5zdsPew1sahx4WG1FXH0+
=9IdS
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to