OK Roger, lets start over.

The API has functions that deal with strings.  They take either a NUL
terminated buffer with a length specified as negative, or a buffer and
length in which NULs are not special.  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).

SQLite has a number of string manipulation functions.  Many of these,
despite being in an environment where the strings are all counted
strings, terminate processing at the first NUL.  This is the bug.
They should not treat NUL as special.  Some functions are fine (hex(),
relational operators, group by, ...), some are broken (quote(),
upper(), lower(), length(), ...), and some are half-broken (replace(),
trim(), rtrim(), ...).  When I say broken, I mean they stop at the NUL
when they should not.

Yes, I know you could replace the built-in functions.  You should not
have to.

--David Garfield

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to