List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:November 29 2003 1:46am
Subject:Re: Storing binary data (string with nulls/ASCII 0 in them) in CHAR/VARCHAR?
View as plain text  
In the last episode (Nov 29), David Garamond said:
> >It seems the string in CHAR/VARCHAR is stored as null-terminated ala
> >C.  But why is record 3 rejected too?
> 
> Ugh, never mind. I forgot about the automatic trailing blanks removal
> feature. Well, since trailing blanks are always removed, it means
> CHAR/VARCHAR could never store binary data then...
> 
> Is there a 128-bit datatype planned? It would be handy to store
> GUID/UUID or IPv6 addresses.

You can use a TINYBLOB, which will consume 9 bytes (due to the length
byte), or you can use two BIGINTs.  An interesting addition to mysql
would be a fixed-length BLOB field which can only hold N characters. 
Might be more efficient than INTs for storing things like IP addresses,
checksums, or other values that happen to be N bytes but aren't really
numbers.

-- 
	Dan Nelson
	dnelson@stripped
Thread
Storing binary data (string with nulls/ASCII 0 in them) in CHAR/VARCHAR?David Garamond29 Nov
  • Re: Storing binary data (string with nulls/ASCII 0 in them) in CHAR/VARCHAR?David Garamond29 Nov
    • Re: Storing binary data (string with nulls/ASCII 0 in them) in CHAR/VARCHAR?Dan Nelson29 Nov