-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 09/26/2011 01:13 PM, David Garfield wrote: > In documented one case > (prepare), NULs are string terminators even with the count, and there > is an extra optimization you may apply. All this works (I think).
Agreed, ugly but documented. BTW in my wrapper the code leading up to a call to prepare was a bottleneck that I spent a lot of time profiling and optimising since it involved cache lookups, UTF8 conversion, multiple statements in one string, memory copies etc. > SQLite has a number of string manipulation functions. To be clear all the instances you are talking about are not the C API (which kept being mentioned) but rather user defined functions (in the sense of a SQL syntax entity). Some of the functions work just fine. Others have issues including stopping at the first NUL instead of the string length, working on blobs which makes no sense for string operations etc. They have been "broken" for many years and this breakage has been mentioned here over the years, but rarely. (ie doesn't affect many people). The workaround is to register your own functions of the same name with your own desired behaviour. It is conceivable that fixing the functions could break some existing code somewhere where someone has abused embedded NUL support (eg storing a list of NUL separated strings where only the first entry matters for user defined functions). Generally the team are very concerned about breaking even one deployment which is why this kind of thing tends not to get changed. They'll have to chime in this time, but I wouldn't get my hopes up. I'll create an entry in the bug tracker when I get home. Roger -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk6A9pgACgkQmOOfHg372QQADQCferKj6ud1csg9aSjzVetXs5mo imsAnjWDgwD863PxAXJVbDdYh/qzGY7/ =fJnR -----END PGP SIGNATURE----- _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users