| 1 |
Larger MaxAllowedPacket as this limits the size of Blob MySQLD can handle |
| 2 |
show variables like 'max_allowed_packet'; |
| 3 |
Variable_name Value |
| 4 |
max_allowed_packet 104857600 |
| 5 |
use test; |
| 6 |
create table t1 (a int primary key, b longtext) engine=ndb; |
| 7 |
create procedure heavy_insert(times int, bytes int) |
| 8 |
begin |
| 9 |
set @x = 0; |
| 10 |
repeat |
| 11 |
insert into t1 values (1, repeat('B', bytes)); |
| 12 |
delete from t1 where a=1; |
| 13 |
set @x = @x + 1; |
| 14 |
until @x = times |
| 15 |
end repeat; |
| 16 |
insert into t1 values (1, repeat('B', bytes)); |
| 17 |
end % |
| 18 |
create procedure heavy_read(times int) |
| 19 |
begin |
| 20 |
set @x = 0; |
| 21 |
repeat |
| 22 |
select a, length(b) from t1 where a=1; |
| 23 |
set @x = @x + 1; |
| 24 |
until @x = times |
| 25 |
end repeat; |
| 26 |
end % |
| 27 |
Set unlimited batch size for reads+writes |
| 28 |
set ndb_blob_read_batch_bytes = 0; |
| 29 |
set ndb_blob_write_batch_bytes = 0; |
| 30 |
Now try a heavy insert - idea is to show SendBufferMemory overload on insert |
| 31 |
call heavy_insert(20, 5*1024*1024); |
| 32 |
delete from t1; |
| 33 |
set ndb_blob_write_batch_bytes=100 * 1024; |
| 34 |
Now heavy insert should succeed |
| 35 |
call heavy_insert(10, 5*1024*1024); |
| 36 |
Now heavy read should fail |
| 37 |
call heavy_read(100); |
| 38 |
set ndb_blob_read_batch_bytes=100 * 1024; |
| 39 |
Now heavy read should succeed |
| 40 |
call heavy_read(100); |
| 41 |
set ndb_blob_write_batch_bytes=0; |
| 42 |
set ndb_blob_read_batch_bytes=0; |
| 43 |
drop procedure heavy_insert; |
| 44 |
drop procedure heavy_read; |
| 45 |
drop table t1; |