Subject Re: [firebird-support] Why can't CHAR and VARCHAR store binary data (ASCII 0)?
Author David Garamond
David Garamond wrote:
> ID STRLEN CODE
> ============ ============ =======================
>
> 0 0 0-0
> 1 0 0-0
> 2 1 32-0
> 3 0 0-0
> 4 1 32-0
> 5 1 32-0
> 6 2 32-32
>
> So it seems the binary CHAR/VARCHAR column are still stored as
> null-terminated string. Otherwise, why would record 4 be converted into
> 32-0 where it should be 0-32? Or is it something that I do wrong? How
> can I store nulls inside a non-BLOB column?

Ugh, never mind. I forgot about the automatic trimming of trailing
blanks. So it seems CHAR/VARCHAR can never store binary data anyway.

Then I would vote for an 128-bit BIGBIGINT/INT128/GUID datatype :-)

--
dave