1SET DEFAULT_STORAGE_ENGINE='tokudb';
2call mtr.add_suppression("TokuDB.*");
3call mtr.add_suppression(".*returned handler error 22");
4drop table if exists t;
5create table t (id int not null primary key, v longblob not null);
6select @@max_allowed_packet into @my_max_allowed_packet;
7set global max_allowed_packet=100000000;
8connect conn1,localhost,root,,;
9insert into t values (1,repeat('a',32*1024*1024));
10ERROR HY000: Got error 22 "Invalid argument" from storage engine TokuDB
11insert into t values (1,repeat('a',32*1024*1024-1));
12ERROR HY000: Got error 22 "Invalid argument" from storage engine TokuDB
13insert into t values (1,repeat('a',32*1024*1024-2));
14ERROR HY000: Got error 22 "Invalid argument" from storage engine TokuDB
15insert into t values (1,repeat('a',32*1024*1024-3));
16ERROR HY000: Got error 22 "Invalid argument" from storage engine TokuDB
17insert into t values (1,repeat('a',32*1024*1024-4));
18select id,length(v) from t;
19id	length(v)
201	33554428
21truncate table t;
22insert into t values (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,repeat('e',32*1024*1024-1));
23ERROR HY000: Got error 22 "Invalid argument" from storage engine TokuDB
24select id,length(v) from t;
25id	length(v)
26truncate table t;
27insert into t values (1,'a'),(2,'b'),(3,'c'),(4,'d');
28insert into t values (5,repeat('e',32*1024*1024-1));
29ERROR HY000: Got error 22 "Invalid argument" from storage engine TokuDB
30select id,length(v) from t;
31id	length(v)
321	1
332	1
343	1
354	1
36connection default;
37disconnect conn1;
38set global max_allowed_packet=@my_max_allowed_packet;
39drop table t;
40