| 1 |
source suite.inc; |
| 2 |
source include/have_ndb.inc; |
| 3 |
result_format 2; |
| 4 |
|
| 5 |
call mtr.add_suppression("The table '.*' is full"); |
| 6 |
|
| 7 |
select version(); |
| 8 |
|
| 9 |
CREATE TABLE t1 ( |
| 10 |
c0 int unsigned not null primary key, |
| 11 |
c00 char(255) not null default '', |
| 12 |
c01 char(255) not null default '', |
| 13 |
c02 char(255) not null default '', |
| 14 |
c03 char(255) not null default '', |
| 15 |
c04 char(255) not null default '', |
| 16 |
c05 char(255) not null default '', |
| 17 |
c06 char(255) not null default '', |
| 18 |
c07 char(255) not null default '', |
| 19 |
c08 char(255) not null default '', |
| 20 |
c09 char(255) not null default '', |
| 21 |
c10 char(255) not null default '', |
| 22 |
c11 char(255) not null default '', |
| 23 |
c12 char(255) not null default '', |
| 24 |
c13 char(255) not null default '', |
| 25 |
c14 char(255) not null default '', |
| 26 |
c15 char(255) not null default '', |
| 27 |
c16 char(255) not null default '', |
| 28 |
c17 char(255) not null default '', |
| 29 |
c18 char(255) not null default '', |
| 30 |
c19 char(255) not null default '', |
| 31 |
c20 char(255) not null default '', |
| 32 |
c21 char(255) not null default '', |
| 33 |
c22 char(255) not null default '', |
| 34 |
c23 char(255) not null default '', |
| 35 |
c24 char(255) not null default '', |
| 36 |
c25 char(255) not null default '', |
| 37 |
c26 char(255) not null default '', |
| 38 |
c27 char(255) not null default '', |
| 39 |
c28 char(255) not null default '', |
| 40 |
c29 char(255) not null default '' |
| 41 |
) COMMENT='NDB_TABLE=NOLOGGING' ENGINE=ndbcluster partition by key(c0) partitions 1; |
| 42 |
|
| 43 |
let $batch = 200; |
| 44 |
|
| 45 |
## Load table... |
| 46 |
--echo Filling table with 15Gb of data |
| 47 |
disable_query_log; |
| 48 |
let $i = 0; |
| 49 |
let $lastgb = 0; |
| 50 |
while (`select (DATA_LENGTH / 1024 / 1024 / 1024) < 15 from INFORMATION_SCHEMA.PARTITIONS where table_name = 't1'`) |
| 51 |
{ |
| 52 |
let $b = $batch; # Number of values to INSERT per batch |
| 53 |
let $separator = ; |
| 54 |
let $sql = INSERT t1 (c0) VALUES; |
| 55 |
while($b) |
| 56 |
{ |
| 57 |
let $sql=$sql$separator($i*$batch + $b); |
| 58 |
let $separator = ,; |
| 59 |
dec $b; |
| 60 |
} |
| 61 |
|
| 62 |
--error 0,1297 |
| 63 |
eval $sql; |
| 64 |
if (!$mysql_errno) |
| 65 |
{ |
| 66 |
inc $i; |
| 67 |
} |
| 68 |
|
| 69 |
let $gb = `select round(DATA_LENGTH / 1024 / 1024 / 1024) from INFORMATION_SCHEMA.PARTITIONS where table_name = 't1'`; |
| 70 |
if ($gb != $lastgb) |
| 71 |
{ |
| 72 |
--echo $gb gb... |
| 73 |
let $lastgb = $gb; |
| 74 |
} |
| 75 |
} |
| 76 |
|
| 77 |
--echo Filling table up to 20Gb, expect error |
| 78 |
let $done = 0; |
| 79 |
while (!$done) |
| 80 |
{ |
| 81 |
let $b = $batch; # Number of values to INSERT per batch |
| 82 |
let $separator = ; |
| 83 |
let $sql = INSERT t1 (c0) VALUES; |
| 84 |
while($b) |
| 85 |
{ |
| 86 |
let $sql=$sql$separator($i*$batch + $b); |
| 87 |
let $separator = ,; |
| 88 |
dec $b; |
| 89 |
} |
| 90 |
|
| 91 |
--error 0,1114,1297 |
| 92 |
eval $sql; |
| 93 |
if (!$mysql_errno) |
| 94 |
{ |
| 95 |
inc $i; |
| 96 |
} |
| 97 |
if ($mysql_errno == 1114) |
| 98 |
{ |
| 99 |
show warnings; |
| 100 |
inc $done; |
| 101 |
} |
| 102 |
if (`select (DATA_LENGTH / 1024 / 1024 / 1024) >= 20 from INFORMATION_SCHEMA.PARTITIONS where table_name = 't1'`) |
| 103 |
{ |
| 104 |
inc $done; |
| 105 |
--echo 20g loaded! |
| 106 |
} |
| 107 |
} |
| 108 |
enable_query_log; |
| 109 |
|
| 110 |
select count(*),max(c0) |
| 111 |
from t1; |
| 112 |
|
| 113 |
select (DATA_LENGTH / 1024 / 1024 / 1024) |
| 114 |
from INFORMATION_SCHEMA.PARTITIONS |
| 115 |
where table_name = 't1'; |
| 116 |
|
| 117 |
--echo Clearing table |
| 118 |
disable_query_log; |
| 119 |
while ($i > 0) |
| 120 |
{ |
| 121 |
let $b = $batch; # |
| 122 |
let $separator = ; |
| 123 |
let $sql = delete from t1 where c0 in (; |
| 124 |
while($b) |
| 125 |
{ |
| 126 |
let $sql=$sql$separator($i*$batch + $b); |
| 127 |
let $separator = ,; |
| 128 |
dec $b; |
| 129 |
} |
| 130 |
let $sql=$sql); |
| 131 |
source run_query_with_retry.inc; |
| 132 |
|
| 133 |
dec $i; |
| 134 |
} |
| 135 |
enable_query_log; |
| 136 |
|
| 137 |
drop table t1; |
| 138 |
|
| 139 |
## Test suceeded |
| 140 |
exit; |