| 1 |
CREATE TABLE t1 ( |
| 2 |
a int, |
| 3 |
b varchar(255), |
| 4 |
c int, |
| 5 |
d blob, |
| 6 |
primary key(a,b), |
| 7 |
key(b), |
| 8 |
unique (c)) engine=ndb character set latin1 comment='NDB_TABLE=FULLY_REPLICATED=1,PARTITION_BALANCE=FOR_RA_BY_NODE' partition by key(a) ; |
| 9 |
show warnings; |
| 10 |
Level Code Message |
| 11 |
CREATE TABLE t2 ( |
| 12 |
a int, |
| 13 |
b varchar(255), |
| 14 |
c int, |
| 15 |
d blob, |
| 16 |
primary key(a,b), |
| 17 |
key(b), |
| 18 |
unique (c)) engine=ndb comment='NDB_TABLE=JUNK' partition by key(a) ; |
| 19 |
ERROR HY000: Table storage engine 'ndbcluster' does not support the create option 'Syntax error in COMMENT modifier' |
| 20 |
CREATE TABLE t2 ( |
| 21 |
a int, |
| 22 |
b varchar(255), |
| 23 |
c int, |
| 24 |
primary key(a,b), |
| 25 |
key(b), |
| 26 |
unique (c)) engine=ndb comment='NDB_TABLE=FULLY_REPLICATED=1,PARTITION_BALANCE=FOR_RA_BY_LDM' partition by key(a) ; |
| 27 |
DROP TABLE t2; |
| 28 |
CREATE TABLE t2 ( |
| 29 |
a int, |
| 30 |
b varchar(255), |
| 31 |
c int not null, |
| 32 |
primary key (a,b), |
| 33 |
unique key (b,a) |
| 34 |
) engine=ndb |
| 35 |
comment='NDB_TABLE=FULLY_REPLICATED=1' |
| 36 |
partition by key(a); |
| 37 |
alter table t2 algorithm=inplace, add unique index (c); |
| 38 |
-- t1 -- |
| 39 |
Version: Any |
| 40 |
Fragment type: HashMapPartition |
| 41 |
K Value: 6 |
| 42 |
Min load factor: 78 |
| 43 |
Max load factor: 80 |
| 44 |
Temporary table: no |
| 45 |
Number of attributes: 4 |
| 46 |
Number of primary keys: 2 |
| 47 |
Length of frm data: XXX |
| 48 |
Max Rows: 0 |
| 49 |
Row Checksum: 1 |
| 50 |
Row GCI: 1 |
| 51 |
SingleUserMode: 0 |
| 52 |
ForceVarPart: 1 |
| 53 |
PartitionCount: 1 |
| 54 |
FragmentCount: 2 |
| 55 |
PartitionBalance: FOR_RA_BY_NODE |
| 56 |
ExtraRowGciBits: 0 |
| 57 |
ExtraRowAuthorBits: 0 |
| 58 |
TableStatus: Retrieved |
| 59 |
Table options: readbackup, fullyreplicated |
| 60 |
HashMap: DEFAULT-HASHMAP-3840-1 |
| 61 |
-- Attributes -- |
| 62 |
a Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY |
| 63 |
b Varchar(255;latin1_swedish_ci) PRIMARY KEY AT=SHORT_VAR ST=MEMORY |
| 64 |
c Int NULL AT=FIXED ST=MEMORY |
| 65 |
d Blob(256,2000,0) NULL AT=MEDIUM_VAR ST=MEMORY BV=2 BT=NDB$BLOB_XX_3 |
| 66 |
-- Indexes -- |
| 67 |
PRIMARY KEY(a, b) - UniqueHashIndex |
| 68 |
PRIMARY(a, b) - OrderedIndex |
| 69 |
c(c) - OrderedIndex |
| 70 |
c$unique(c) - UniqueHashIndex |
| 71 |
b(b) - OrderedIndex |
| 72 |
|
| 73 |
-- t1/PRIMARY -- |
| 74 |
Attributes: a,b |
| 75 |
Index Type: Ordered index |
| 76 |
Index Status: retrieved |
| 77 |
Partitions: 1 |
| 78 |
Fragments: 2 |
| 79 |
-- t1/c -- |
| 80 |
Attributes: c |
| 81 |
Index Type: Ordered index |
| 82 |
Index Status: retrieved |
| 83 |
Partitions: 1 |
| 84 |
Fragments: 2 |
| 85 |
-- t1/c$unique -- |
| 86 |
Attributes: c |
| 87 |
Index Type: Unique hash index |
| 88 |
Index Status: retrieved |
| 89 |
Partitions: 1 |
| 90 |
Fragments: 2 |
| 91 |
-- t1/b -- |
| 92 |
Attributes: b |
| 93 |
Index Type: Ordered index |
| 94 |
Index Status: retrieved |
| 95 |
Partitions: 1 |
| 96 |
Fragments: 2 |
| 97 |
|
| 98 |
-- Blob Tables -- |
| 99 |
Column name: d |
| 100 |
Inline size: 256 |
| 101 |
Part size: 2000 |
| 102 |
Stipe size: 0 |
| 103 |
Blob Table Name: NDB$BLOB_XX_3 |
| 104 |
Fragment type: HashMapPartition |
| 105 |
Temporary table: no |
| 106 |
Number of attributes: 5 |
| 107 |
Primary key: a,b,NDB$PART |
| 108 |
Max Rows: 0 |
| 109 |
Row Checksum: 1 |
| 110 |
Row GCI: 1 |
| 111 |
SingleUserMode: 0 |
| 112 |
Dynamic: 0 |
| 113 |
PartitionCount: 1 |
| 114 |
FragmentCount: 2 |
| 115 |
PartitionBalance: FOR_RA_BY_NODE |
| 116 |
ExtraRowGciBits: 0 |
| 117 |
ExtraRowAuthorBits: 0 |
| 118 |
TableStatus: Retrieved |
| 119 |
Table options: readbackup, fullyreplicated |
| 120 |
HashMap: DEFAULT-HASHMAP-3840-1 |
| 121 |
|
| 122 |
insert into t1 values |
| 123 |
(0, "row 0", 0, REPEAT("qubit#0",500)), |
| 124 |
(1, "row 1", 1, REPEAT("qubit#1",500)), |
| 125 |
(2, "row 2", 2, REPEAT("qubit#2",500)), |
| 126 |
(3, "row 3", 3, REPEAT("qubit#3",500)), |
| 127 |
(4, "row 4", 4, REPEAT("qubit#4",500)), |
| 128 |
(5, "row 5", 5, REPEAT("qubit#5",500)), |
| 129 |
(6, "row 6", 6, REPEAT("qubit#6",500)), |
| 130 |
(7, "row 7", 7, REPEAT("qubit#7",500)), |
| 131 |
(8, "row 8", 8, REPEAT("qubit#8",500)), |
| 132 |
(9, "row 9", 9, REPEAT("qubit#9",500)); |
| 133 |
select a,b,c,LENGTH(d) from t1 order by 1; |
| 134 |
a b c LENGTH(d) |
| 135 |
0 row 0 0 3500 |
| 136 |
1 row 1 1 3500 |
| 137 |
2 row 2 2 3500 |
| 138 |
3 row 3 3 3500 |
| 139 |
4 row 4 4 3500 |
| 140 |
5 row 5 5 3500 |
| 141 |
6 row 6 6 3500 |
| 142 |
7 row 7 7 3500 |
| 143 |
8 row 8 8 3500 |
| 144 |
9 row 9 9 3500 |
| 145 |
begin; |
| 146 |
select a,b,c,LENGTH(d) from t1 where a = 7; |
| 147 |
a b c LENGTH(d) |
| 148 |
7 row 7 7 3500 |
| 149 |
select a,b,c,LENGTH(d) from t1 where c = 9; |
| 150 |
a b c LENGTH(d) |
| 151 |
9 row 9 9 3500 |
| 152 |
select a,b,c,LENGTH(d) from t1 order by 1; |
| 153 |
a b c LENGTH(d) |
| 154 |
0 row 0 0 3500 |
| 155 |
1 row 1 1 3500 |
| 156 |
2 row 2 2 3500 |
| 157 |
3 row 3 3 3500 |
| 158 |
4 row 4 4 3500 |
| 159 |
5 row 5 5 3500 |
| 160 |
6 row 6 6 3500 |
| 161 |
7 row 7 7 3500 |
| 162 |
8 row 8 8 3500 |
| 163 |
9 row 9 9 3500 |
| 164 |
select a,b,c,LENGTH(d) from t1 where a < 5 order by a; |
| 165 |
a b c LENGTH(d) |
| 166 |
0 row 0 0 3500 |
| 167 |
1 row 1 1 3500 |
| 168 |
2 row 2 2 3500 |
| 169 |
3 row 3 3 3500 |
| 170 |
4 row 4 4 3500 |
| 171 |
update t1 set b = 'pk update' where a = 3; |
| 172 |
update t1 set c = c + 10; |
| 173 |
update t1 set b = 'uk update' where c = 16; |
| 174 |
delete from t1 where a = 7; |
| 175 |
delete from t1 where c = 17; |
| 176 |
delete from t1 where a < 5; |
| 177 |
select a,b,c,LENGTH(d) from t1 order by 1; |
| 178 |
a b c LENGTH(d) |
| 179 |
5 row 5 15 3500 |
| 180 |
6 uk update 16 3500 |
| 181 |
8 row 8 18 3500 |
| 182 |
9 row 9 19 3500 |
| 183 |
insert into t1 values (0, "row 0", 0, REPEAT("qubit#0",500)),(1, "row 1", 1, REPEAT("qubit#1",500)); |
| 184 |
select a,b,c,LENGTH(d) from t1 order by 1; |
| 185 |
a b c LENGTH(d) |
| 186 |
0 row 0 0 3500 |
| 187 |
1 row 1 1 3500 |
| 188 |
5 row 5 15 3500 |
| 189 |
6 uk update 16 3500 |
| 190 |
8 row 8 18 3500 |
| 191 |
9 row 9 19 3500 |
| 192 |
rollback; |
| 193 |
"Stop node 1" |
| 194 |
Node 1: NOT_STARTED |
| 195 |
begin; |
| 196 |
select a,b,c,LENGTH(d) from t1 where a = 7; |
| 197 |
a b c LENGTH(d) |
| 198 |
7 row 7 7 3500 |
| 199 |
select a,b,c,LENGTH(d) from t1 where c = 9; |
| 200 |
a b c LENGTH(d) |
| 201 |
9 row 9 9 3500 |
| 202 |
select a,b,c,LENGTH(d) from t1 order by 1; |
| 203 |
a b c LENGTH(d) |
| 204 |
0 row 0 0 3500 |
| 205 |
1 row 1 1 3500 |
| 206 |
2 row 2 2 3500 |
| 207 |
3 row 3 3 3500 |
| 208 |
4 row 4 4 3500 |
| 209 |
5 row 5 5 3500 |
| 210 |
6 row 6 6 3500 |
| 211 |
7 row 7 7 3500 |
| 212 |
8 row 8 8 3500 |
| 213 |
9 row 9 9 3500 |
| 214 |
select a,b,c,LENGTH(d) from t1 where a < 5 order by a; |
| 215 |
a b c LENGTH(d) |
| 216 |
0 row 0 0 3500 |
| 217 |
1 row 1 1 3500 |
| 218 |
2 row 2 2 3500 |
| 219 |
3 row 3 3 3500 |
| 220 |
4 row 4 4 3500 |
| 221 |
update t1 set b = 'pk update' where a = 3; |
| 222 |
update t1 set c = c + 10; |
| 223 |
update t1 set b = 'uk update' where c = 16; |
| 224 |
delete from t1 where a = 7; |
| 225 |
delete from t1 where c = 17; |
| 226 |
delete from t1 where a < 5; |
| 227 |
select a,b,c,LENGTH(d) from t1 order by 1; |
| 228 |
a b c LENGTH(d) |
| 229 |
5 row 5 15 3500 |
| 230 |
6 uk update 16 3500 |
| 231 |
8 row 8 18 3500 |
| 232 |
9 row 9 19 3500 |
| 233 |
insert into t1 values (0, "row 0", 0, REPEAT("qubit#0",500)),(1, "row 1", 1, REPEAT("qubit#1",500)); |
| 234 |
select a,b,c,LENGTH(d) from t1 order by 1; |
| 235 |
a b c LENGTH(d) |
| 236 |
0 row 0 0 3500 |
| 237 |
1 row 1 1 3500 |
| 238 |
5 row 5 15 3500 |
| 239 |
6 uk update 16 3500 |
| 240 |
8 row 8 18 3500 |
| 241 |
9 row 9 19 3500 |
| 242 |
rollback; |
| 243 |
"Start node 1" |
| 244 |
Node 1: STARTED |
| 245 |
Node 2: STARTED |
| 246 |
Node 3: STARTED |
| 247 |
Node 4: STARTED |
| 248 |
begin; |
| 249 |
select a,b,c,LENGTH(d) from t1 where a = 7; |
| 250 |
a b c LENGTH(d) |
| 251 |
7 row 7 7 3500 |
| 252 |
select a,b,c,LENGTH(d) from t1 where c = 9; |
| 253 |
a b c LENGTH(d) |
| 254 |
9 row 9 9 3500 |
| 255 |
select a,b,c,LENGTH(d) from t1 order by 1; |
| 256 |
a b c LENGTH(d) |
| 257 |
0 row 0 0 3500 |
| 258 |
1 row 1 1 3500 |
| 259 |
2 row 2 2 3500 |
| 260 |
3 row 3 3 3500 |
| 261 |
4 row 4 4 3500 |
| 262 |
5 row 5 5 3500 |
| 263 |
6 row 6 6 3500 |
| 264 |
7 row 7 7 3500 |
| 265 |
8 row 8 8 3500 |
| 266 |
9 row 9 9 3500 |
| 267 |
select a,b,c,LENGTH(d) from t1 where a < 5 order by a; |
| 268 |
a b c LENGTH(d) |
| 269 |
0 row 0 0 3500 |
| 270 |
1 row 1 1 3500 |
| 271 |
2 row 2 2 3500 |
| 272 |
3 row 3 3 3500 |
| 273 |
4 row 4 4 3500 |
| 274 |
update t1 set b = 'pk update' where a = 3; |
| 275 |
update t1 set c = c + 10; |
| 276 |
update t1 set b = 'uk update' where c = 16; |
| 277 |
delete from t1 where a = 7; |
| 278 |
delete from t1 where c = 17; |
| 279 |
delete from t1 where a < 5; |
| 280 |
select a,b,c,LENGTH(d) from t1 order by 1; |
| 281 |
a b c LENGTH(d) |
| 282 |
5 row 5 15 3500 |
| 283 |
6 uk update 16 3500 |
| 284 |
8 row 8 18 3500 |
| 285 |
9 row 9 19 3500 |
| 286 |
insert into t1 values (0, "row 0", 0, REPEAT("qubit#0",500)),(1, "row 1", 1, REPEAT("qubit#1",500)); |
| 287 |
select a,b,c,LENGTH(d) from t1 order by 1; |
| 288 |
a b c LENGTH(d) |
| 289 |
0 row 0 0 3500 |
| 290 |
1 row 1 1 3500 |
| 291 |
5 row 5 15 3500 |
| 292 |
6 uk update 16 3500 |
| 293 |
8 row 8 18 3500 |
| 294 |
9 row 9 19 3500 |
| 295 |
rollback; |
| 296 |
drop table t1,t2; |
| 297 |
CREATE TABLE t1 ( |
| 298 |
a int, |
| 299 |
b varchar(255), |
| 300 |
c int, |
| 301 |
d blob, |
| 302 |
primary key(a,b), |
| 303 |
key(b), |
| 304 |
unique (c)) engine=ndb comment='NDB_TABLE=FULLY_REPLICATED=1' partition by key(a) ; |
| 305 |
CREATE TABLE t2 ( |
| 306 |
a int, |
| 307 |
b varchar(255), |
| 308 |
c int not null, |
| 309 |
primary key (a,b), |
| 310 |
unique key (b,a) |
| 311 |
) engine=ndb |
| 312 |
comment='NDB_TABLE=FULLY_REPLICATED=1' |
| 313 |
partition by key(a); |
| 314 |
alter table t2 algorithm=inplace, add unique index (c); |
| 315 |
insert into t1 values |
| 316 |
(0, "row 0", 0, REPEAT("qubit#0",500)), |
| 317 |
(1, "row 1", 1, REPEAT("qubit#1",500)), |
| 318 |
(2, "row 2", 2, REPEAT("qubit#2",500)), |
| 319 |
(3, "row 3", 3, REPEAT("qubit#3",500)), |
| 320 |
(4, "row 4", 4, REPEAT("qubit#4",500)), |
| 321 |
(5, "row 5", 5, REPEAT("qubit#5",500)), |
| 322 |
(6, "row 6", 6, REPEAT("qubit#6",500)), |
| 323 |
(7, "row 7", 7, REPEAT("qubit#7",500)), |
| 324 |
(8, "row 8", 8, REPEAT("qubit#8",500)), |
| 325 |
(9, "row 9", 9, REPEAT("qubit#9",500)); |
| 326 |
"Restart cluster" |
| 327 |
Node 1: NOT_STARTED |
| 328 |
Node 2: NOT_STARTED |
| 329 |
Node 3: NOT_STARTED |
| 330 |
Node 4: NOT_STARTED |
| 331 |
Node 1: STARTED |
| 332 |
Node 2: STARTED |
| 333 |
Node 3: STARTED |
| 334 |
Node 4: STARTED |
| 335 |
"Wait reconnect" |
| 336 |
begin; |
| 337 |
select a,b,c,LENGTH(d) from t1 where a = 7; |
| 338 |
a b c LENGTH(d) |
| 339 |
7 row 7 7 3500 |
| 340 |
select a,b,c,LENGTH(d) from t1 where c = 9; |
| 341 |
a b c LENGTH(d) |
| 342 |
9 row 9 9 3500 |
| 343 |
select a,b,c,LENGTH(d) from t1 order by 1; |
| 344 |
a b c LENGTH(d) |
| 345 |
0 row 0 0 3500 |
| 346 |
1 row 1 1 3500 |
| 347 |
2 row 2 2 3500 |
| 348 |
3 row 3 3 3500 |
| 349 |
4 row 4 4 3500 |
| 350 |
5 row 5 5 3500 |
| 351 |
6 row 6 6 3500 |
| 352 |
7 row 7 7 3500 |
| 353 |
8 row 8 8 3500 |
| 354 |
9 row 9 9 3500 |
| 355 |
select a,b,c,LENGTH(d) from t1 where a < 5 order by a; |
| 356 |
a b c LENGTH(d) |
| 357 |
0 row 0 0 3500 |
| 358 |
1 row 1 1 3500 |
| 359 |
2 row 2 2 3500 |
| 360 |
3 row 3 3 3500 |
| 361 |
4 row 4 4 3500 |
| 362 |
update t1 set b = 'pk update' where a = 3; |
| 363 |
update t1 set c = c + 10; |
| 364 |
update t1 set b = 'uk update' where c = 16; |
| 365 |
delete from t1 where a = 7; |
| 366 |
delete from t1 where c = 17; |
| 367 |
delete from t1 where a < 5; |
| 368 |
select a,b,c,LENGTH(d) from t1 order by 1; |
| 369 |
a b c LENGTH(d) |
| 370 |
5 row 5 15 3500 |
| 371 |
6 uk update 16 3500 |
| 372 |
8 row 8 18 3500 |
| 373 |
9 row 9 19 3500 |
| 374 |
insert into t1 values (0, "row 0", 0, REPEAT("qubit#0",500)),(1, "row 1", 1, REPEAT("qubit#1",500)); |
| 375 |
select a,b,c,LENGTH(d) from t1 order by 1; |
| 376 |
a b c LENGTH(d) |
| 377 |
0 row 0 0 3500 |
| 378 |
1 row 1 1 3500 |
| 379 |
5 row 5 15 3500 |
| 380 |
6 uk update 16 3500 |
| 381 |
8 row 8 18 3500 |
| 382 |
9 row 9 19 3500 |
| 383 |
rollback; |
| 384 |
drop table t1,t2; |