--source include/have_innodb.inc --source include/have_innodb_16k.inc create table t1(a blob) engine=innodb key_block_size=8; delimiter //; create function generate_blob() returns varchar(20000) begin declare x varchar(20000) default ''; declare i int default 500; while i > 0 do set x = concat(sha1(i), x); set i = i - 1; end while; return x; end // delimiter ;// insert into t1 select generate_blob(); let $x = `select 20000 - length(a) from t1`; if ($x) { echo Blob is truncated by $x bytes.; die It must have been 20000 bytes.; } truncate t1; insert into t1 select generate_blob(); let $x = `select 20000 - length(a) from t1`; if ($x) { echo Blob is truncated by $x bytes.; die It must have been 20000 bytes.; } drop table t1; drop function generate_blob;