From: Dan Nelson Date: November 29 2003 1:46am Subject: Re: Storing binary data (string with nulls/ASCII 0 in them) in CHAR/VARCHAR? List-Archive: http://lists.mysql.com/mysql/154701 Message-Id: <20031129014629.GD65710@dan.emsphone.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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