1#
2# Test bugs in the MyISAM code with blobs
3#
4
5--disable_warnings
6drop table if exists t1;
7--enable_warnings
8
9# Bug #2159 (Problem with update of blob to > 16M)
10
11CREATE TABLE t1 (data LONGBLOB) ENGINE=myisam;
12INSERT INTO t1 (data) VALUES (NULL);
13UPDATE t1 set data=repeat('a',18*1024*1024);
14select length(data) from t1;
15delete from t1 where left(data,1)='a';
16check table t1;
17truncate table t1;
18INSERT INTO t1 (data) VALUES (repeat('a',1*1024*1024));
19INSERT INTO t1 (data) VALUES (repeat('b',16*1024*1024-1024));
20delete from t1 where left(data,1)='b';
21check table t1;
22
23# now we have two blocks in the table, first is a 1M record and second is
24# a 16M delete block.
25
26UPDATE t1 set data=repeat('c',17*1024*1024);
27check table t1;
28delete from t1 where left(data,1)='c';
29check table t1;
30
31INSERT INTO t1 set data=repeat('a',18*1024*1024);
32select length(data) from t1;
33SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
34alter table t1 modify data blob;
35select length(data) from t1;
36drop table t1;
37
38CREATE TABLE t1 (data BLOB) ENGINE=myisam;
39INSERT INTO t1 (data) VALUES (NULL);
40UPDATE IGNORE t1 set data=repeat('a',18*1024*1024);
41select length(data) from t1;
42drop table t1;
43
44# End of 4.1 tests
45