| 1 |
-- source include/have_ndb.inc |
| 2 |
|
| 3 |
# Valgrinding and debugging slows the mysqld down and thus making it |
| 4 |
# impossible to fill the redo log of ndbd(s) -> skip test |
| 5 |
--source include/not_valgrind.inc |
| 6 |
--source include/have_nodebug.inc |
| 7 |
|
| 8 |
use test; |
| 9 |
create table t1 (a varchar(1024)) engine=ndb max_rows=100000000; |
| 10 |
insert into t1 values (repeat('I', 1024)); |
| 11 |
|
| 12 |
# ~2kB : 1 row |
| 13 |
insert into t1 select * from t1; |
| 14 |
|
| 15 |
# ~64kB : 64 rows |
| 16 |
insert into t1 select * from t1; |
| 17 |
insert into t1 select * from t1; |
| 18 |
insert into t1 select * from t1; |
| 19 |
insert into t1 select * from t1; |
| 20 |
insert into t1 select * from t1; |
| 21 |
|
| 22 |
# ~1M : 1024 rows |
| 23 |
insert into t1 select * from t1; |
| 24 |
insert into t1 select * from t1; |
| 25 |
insert into t1 select * from t1; |
| 26 |
insert into t1 select * from t1; |
| 27 |
|
| 28 |
#~8M : 8192 rows |
| 29 |
insert into t1 select * from t1; |
| 30 |
insert into t1 select * from t1; |
| 31 |
insert into t1 select * from t1; |
| 32 |
|
| 33 |
# Cache 8192 rows in temporary table in order |
| 34 |
# to avoid scan during insert |
| 35 |
create temporary table t1_8192(a varchar(1024)); |
| 36 |
insert into t1_8192 select * from t1 limit 8192; |
| 37 |
|
| 38 |
# ~32M |
| 39 |
--error 0,1297 |
| 40 |
insert into t1 select * from t1_8192; |
| 41 |
--error 0,1297 |
| 42 |
insert into t1 select * from t1_8192; |
| 43 |
--error 0,1297 |
| 44 |
insert into t1 select * from t1_8192; |
| 45 |
|
| 46 |
--echo Continuing insert/delete until redo is full |
| 47 |
|
| 48 |
--disable_query_log |
| 49 |
--disable_result_log |
| 50 |
let $mysql_errno= 0; |
| 51 |
let $counter= 100; |
| 52 |
while (!$mysql_errno) |
| 53 |
{ |
| 54 |
--error 0,1297 |
| 55 |
insert into t1 select * from t1_8192; |
| 56 |
|
| 57 |
if (!$mysql_errno) |
| 58 |
{ |
| 59 |
if (!$counter) |
| 60 |
{ |
| 61 |
die Failed waiting for redo log full; |
| 62 |
} |
| 63 |
dec $counter; |
| 64 |
|
| 65 |
# Delete the inserted rows to avoid table full |
| 66 |
# and of course creating even more REDO log |
| 67 |
--error 0,1297 |
| 68 |
delete from t1 limit 8192; |
| 69 |
} |
| 70 |
} |
| 71 |
--enable_query_log |
| 72 |
--enable_result_log |
| 73 |
|
| 74 |
--echo Redo log full, waiting for redo log having space... |
| 75 |
|
| 76 |
--disable_query_log |
| 77 |
--disable_result_log |
| 78 |
|
| 79 |
let $mysql_errno= 1; |
| 80 |
let $counter= 600; |
| 81 |
while ($mysql_errno) |
| 82 |
{ |
| 83 |
--error 0,1297 |
| 84 |
insert into t1 select * from t1_8192; |
| 85 |
|
| 86 |
if ($mysql_errno) |
| 87 |
{ |
| 88 |
if (!$counter) |
| 89 |
{ |
| 90 |
die Failed waiting for redo log having space; |
| 91 |
} |
| 92 |
dec $counter; |
| 93 |
--sleep 0.1 |
| 94 |
} |
| 95 |
} |
| 96 |
--enable_query_log |
| 97 |
--enable_result_log |
| 98 |
|
| 99 |
--echo Redo had space again. |
| 100 |
|
| 101 |
drop table t1; |
| 102 |
drop table t1_8192; |