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

On 04/17/2010 07:12 PM, Dan Bishop wrote:
> Newlines, backslashes, and double quotes can be included literally. The 
> only other character you need to worry about is NUL.

Funnily enough I'm busy writing my own quoting routine right now (the source
are Python objects so I can't reuse the one in SQLite).  The only sensible
way I can see of producing a string literal with NUL (which SQLite quite
happily supports) is to output something like:

   CAST(X'43440045' AS CHAR)

Unfortunately the bytes have to be in the same encoding as the database but
when generating this you don't know what the encoding is or will be for a
dump.  The SQLite shell dump command just ignores the NUL onwards silently
losing data.

I guess the only other alternative is to register a function that does the
blob to string conversion taking into account blob encoding but that will
then only work in SQLites where the function is registered.

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

iEYEARECAAYFAkvKfSMACgkQmOOfHg372QTVhACguPE3otC/PLEK2ufATObPg5Os
UrUAoIgy7Aa2Jt8euQFgAh84sxKiM8es
=zQ6x
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to