Mads Kristensen <[EMAIL PROTECTED]> wrote on 13/01/2005 12:42:13:

> Is it true that I can only store 65535 bytes (2^16-1) in a field of type 

> BLOB? I thought that a BLOB was supposed to be able to hold 2^16 bytes 
> of data.
> 
> If it is indeed only possible to store 2^16-1 bytes I would like to know 

> why this has been implemented in that way (yes, I am always this curious 
;-)

The BLOB has to have a length, which is stored in 16 bits, range 0-65535. 
The concept of a zero length blob, as distinct from a NULL record, is 
perfectly valid, and may in some contexts be meaningful. Also, it avoids 
special logic for mapping the 65538 case to zero and erroring the zero 
case. If you want 65536, go for a MEDIUMBLOB: the overhead is only one 
part in 60,000.

        Alec


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to