Corrupted images after attempting to store PNG images as BLOBs in MySQL?

Fredrik Lundh fredrik at pythonware.com
Wed Aug 13 16:46:04 CEST 2008


Fredrik Lundh wrote:

> Silently truncating or otherwise mangling columns is a standard MySQL 
> feature.  What does the table definition look like?

Oh, you did write BLOB in the subject.  BLOB columns hold 64k (minus 2 
bytes for housekeeping), and excess data is discarded, by default:

"If strict SQL mode is not enabled and you assign a value to a BLOB or 
TEXT column that exceeds the column's maximum length, the value is 
truncated to fit and a warning is generated."

http://dev.mysql.com/doc/refman/5.0/en/blob.html

Are you sure you *need* to use MySQL ;-)

</F>




More information about the Python-list mailing list