Subject | Re: [firebird-support] Why can't CHAR and VARCHAR store binary data (ASCII 0)? |
---|---|
Author | Helen Borrie |
Post date | 2003-11-26T12:57:57Z |
At 05:01 PM 26/11/2003 +0700, you wrote:
heLen
>Why can't CHAR and VARCHAR store binary data (ASCII 0)?Use CHARACTER SET OCTETS and you will get exactly what you want.
>
>Is it because internally the data are represented by null-terminated
>strings? If yes, why? CHAR always has fixed length and VARCHAR has 2
>extra bytes to store string length.
>
>I currently need to store 128-bit MD5 hashes (sort of like UUID/GUID) as
>primary keys. In MySQL, I can use "CHAR(16) BINARY NOT NULL" for this
>data since the CHAR & VARCHAR are "binary safe", but in Firebird I have
>to use "CHAR(18) NOT NULL" (I am encoding to base192, where the charset
>are from ASCII 64 to ASCII 255).
>
>I can also use CHAR(24) (storing as base64) or CHAR(32) (storing as
>hexdigits), but they are longer.
heLen
>--
>dave
>
>
>
>To unsubscribe from this group, send an email to:
>firebird-support-unsubscribe@yahoogroups.com
>
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/