| 1 |
source include/have_ndb.inc; |
| 2 |
|
| 3 |
# let $maxrowsize = 14000 - 64; # for 7.6, 8.0.17 |
| 4 |
# let $maxrowsize = 30000 - 64; # from 8.0.18 with WL#13079 |
| 5 |
let $maxrowsize = 30000; # from 8.0.18 with Bug#29698277 |
| 6 |
|
| 7 |
# Create a table with a big Dbtup internal expanded row format. |
| 8 |
|
| 9 |
let $pkcount = 1; |
| 10 |
let $fixcount = 2; |
| 11 |
let $varcount = 2; |
| 12 |
let $dynfixcount = 2; |
| 13 |
let $dynvarcount = 503; |
| 14 |
let $ddcount = 1; |
| 15 |
let $colcount = |
| 16 |
($pkcount + $fixcount + $varcount + $dynfixcount + $dynvarcount + $ddcount); |
| 17 |
# Length of varbinary column which will be added last to fill row size. |
| 18 |
# All other columns are 4 bytes each. |
| 19 |
let $varlen = `select $maxrowsize - $colcount * 4 - 2`; |
| 20 |
|
| 21 |
let $colnum = 1; |
| 22 |
let $colstr = ; |
| 23 |
|
| 24 |
let $count = $dynfixcount; |
| 25 |
while ($count) |
| 26 |
{ |
| 27 |
let $colstr=$colstr, |
| 28 |
col$colnum binary(1) default '@' column_format dynamic; |
| 29 |
inc $colnum; |
| 30 |
dec $count; |
| 31 |
} |
| 32 |
|
| 33 |
let $count = $dynvarcount; |
| 34 |
while ($count) |
| 35 |
{ |
| 36 |
let $colstr=$colstr, |
| 37 |
col$colnum varbinary(3) default 'ABC' column_format dynamic; |
| 38 |
inc $colnum; |
| 39 |
dec $count; |
| 40 |
} |
| 41 |
|
| 42 |
let $count = $fixcount; |
| 43 |
while ($count) |
| 44 |
{ |
| 45 |
let $colstr=$colstr, |
| 46 |
col$colnum binary(1) default '@' column_format fixed; |
| 47 |
inc $colnum; |
| 48 |
dec $count; |
| 49 |
} |
| 50 |
|
| 51 |
let $count = $varcount; |
| 52 |
while ($count) |
| 53 |
{ |
| 54 |
let $colstr=$colstr, |
| 55 |
col$colnum varbinary(3) null default 'ABC' column_format fixed; |
| 56 |
inc $colnum; |
| 57 |
dec $count; |
| 58 |
} |
| 59 |
|
| 60 |
let $count = $ddcount; |
| 61 |
while ($count) |
| 62 |
{ |
| 63 |
let $colstr=$colstr, |
| 64 |
col$colnum varbinary(3) null default 'ABC' storage disk; |
| 65 |
inc $colnum; |
| 66 |
dec $count; |
| 67 |
} |
| 68 |
|
| 69 |
CREATE LOGFILE GROUP lg1 |
| 70 |
ADD UNDOFILE 'undofile.dat' |
| 71 |
INITIAL_SIZE 16M |
| 72 |
UNDO_BUFFER_SIZE = 1M |
| 73 |
ENGINE=NDB; |
| 74 |
|
| 75 |
CREATE TABLESPACE ts1 |
| 76 |
ADD DATAFILE 'datafile.dat' |
| 77 |
USE LOGFILE GROUP lg1 |
| 78 |
INITIAL_SIZE 12M |
| 79 |
ENGINE NDB; |
| 80 |
|
| 81 |
eval create table t1 ( |
| 82 |
pk int unsigned primary key |
| 83 |
$colstr |
| 84 |
) engine = ndb |
| 85 |
tablespace ts1 |
| 86 |
storage memory |
| 87 |
partition by key(pk) partitions 1; |
| 88 |
|
| 89 |
insert into t1 (pk) values (0x12345678); |
| 90 |
insert into t1 (pk) values (0x87654321); |
| 91 |
|
| 92 |
eval alter table t1 algorithm=inplace, |
| 93 |
add column col511 varbinary($varlen) column_format dynamic; |
| 94 |
|
| 95 |
eval update t1 set col511 = repeat('-', $varlen); |
| 96 |
|
| 97 |
drop table t1; |
| 98 |
alter tablespace ts1 |
| 99 |
drop datafile 'datafile.dat'; |
| 100 |
drop tablespace ts1; |
| 101 |
drop logfile group lg1 engine ndb; |