1# the first statement is a drop table for the test table
2drop table if exists t_basic;
3# the second statement is a test; if it succeeds, skip the rest of the file.
4select id from t_basic where id = 9999;
5# the following statements are delimited by semicolon
6
7DROP TABLE IF EXISTS conversation_summary;
8CREATE TABLE conversation_summary (
9  source_user_id bigint(11) NOT NULL,
10  destination_user_id bigint(11) NOT NULL,
11  last_message_user_id bigint(11) NOT NULL,
12  text_summary varchar(255) NOT NULL DEFAULT '',
13  query_history_id bigint(20) NOT NULL DEFAULT '0',
14  answerer_id bigint(11) NOT NULL,
15  viewed bit(1) NOT NULL,
16  updated_at bigint(20) NOT NULL,
17  PRIMARY KEY (source_user_id,destination_user_id,query_history_id),
18  KEY IX_updated_at (updated_at)
19) ENGINE=ndbcluster;
20
21DROP TABLE IF EXISTS twopk;
22CREATE TABLE IF NOT EXISTS twopk (
23  id int not null,
24  name varchar(30)
25) ENGINE = ndbcluster;
26
27DROP TABLE IF EXISTS hashpk;
28CREATE TABLE IF NOT EXISTS hashpk (
29  id int not null,
30  name varchar(30),
31    CONSTRAINT PK_hashpk PRIMARY KEY (id) USING HASH
32) ENGINE = ndbcluster;
33
34DROP TABLE IF EXISTS subscriber ;
35
36CREATE TABLE IF NOT EXISTS subscriber (
37  imsi   VARCHAR(9) NOT NULL ,
38  guti   VARCHAR(10) NOT NULL ,
39  mme_s1ap_id   INT NOT NULL ,
40  enb_s1ap_id   INT NOT NULL ,
41  mme_teid   INT NULL ,
42  sgw_teid   VARCHAR(39) NULL ,
43  pgw_teid   VARCHAR(39) NULL ,
44  imei   VARCHAR(9) NOT NULL ,
45  msisdn   VARCHAR(11) NOT NULL ,
46  ecm_state   CHAR NULL ,
47  emm_state   CHAR NULL ,
48  eps_cgi   VARCHAR(7) NULL ,
49  global_enb_id   VARCHAR(7) NULL ,
50  bearer_id   CHAR NULL ,
51  sgw_ip_addr   VARCHAR(34) NULL ,
52PRIMARY KEY (  imsi  ) ,
53UNIQUE INDEX   imsi_UNIQUE   USING BTREE (  imsi   ASC) ,
54UNIQUE INDEX   guti_UNIQUE   USING BTREE (  guti   ASC) ,
55UNIQUE INDEX   mme_s1ap_id_UNIQUE   (  mme_s1ap_id   ASC) ,
56UNIQUE INDEX   imei_UNIQUE   (  imei   ASC) ,
57UNIQUE INDEX   msisdn_UNIQUE   (  msisdn   ASC) )
58ENGINE = ndbcluster;
59
60drop table if exists longlongstringpk;
61create table longlongstringpk (
62 longpk1 bigint not null,
63 longpk2 bigint not null,
64 stringpk varchar(10) not null,
65 stringvalue varchar(10),
66        CONSTRAINT PK_longlongstringpk PRIMARY KEY (longpk1, longpk2, stringpk)
67
68) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
69
70drop table if exists bittypes;
71create table bittypes (
72 id int not null primary key,
73
74 bit1 bit(1),
75 bit2 bit(2),
76 bit4 bit(4),
77 bit8 bit(8),
78 bit16 bit(16),
79 bit32 bit(32),
80 bit64 bit(64)
81
82) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
83
84drop table if exists binarytypes;
85create table binarytypes (
86 id int not null primary key,
87
88 binary1 binary(1),
89 binary2 binary(2),
90 binary4 binary(4),
91 binary8 binary(8),
92 binary16 binary(16),
93 binary32 binary(32),
94 binary64 binary(64),
95 binary128 binary(128)
96
97) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
98
99drop table if exists varbinarytypes;
100create table varbinarytypes (
101 id int not null primary key,
102
103 binary1 varbinary(1),
104 binary2 varbinary(2),
105 binary4 varbinary(4),
106 binary8 varbinary(8),
107 binary16 varbinary(16),
108 binary32 varbinary(32),
109 binary64 varbinary(64),
110 binary128 varbinary(128),
111 binary256 varbinary(256),
112 binary512 varbinary(512),
113 binary1024 varbinary(1024),
114 binary2048 varbinary(2048)
115
116) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
117
118drop table if exists binarypk;
119create table binarypk (
120 id binary(255) primary key not null,
121 number int not null,
122 name varchar(10) not null
123) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
124
125drop table if exists varbinarypk;
126create table varbinarypk (
127 id varbinary(255) primary key not null,
128 number int not null,
129 name varchar(10) not null
130) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
131
132drop table if exists longvarbinarypk;
133create table longvarbinarypk (
134 id varbinary(256) primary key not null,
135 number int not null,
136 name varchar(10) not null
137) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
138
139drop table if exists charsetlatin1;
140create table charsetlatin1 (
141 id int not null primary key,
142 smallcolumn varchar(200),
143 mediumcolumn varchar(500),
144 largecolumn text(10000)
145
146) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
147
148drop table if exists charsetbig5;
149create table charsetbig5 (
150 id int not null primary key,
151 smallcolumn varchar(200),
152 mediumcolumn varchar(500),
153 largecolumn text(10000)
154
155) ENGINE=ndbcluster DEFAULT CHARSET=big5;
156
157drop table if exists charsetutf8;
158create table charsetutf8 (
159 id int not null primary key,
160 smallcolumn varchar(200),
161 mediumcolumn varchar(500),
162 largecolumn text(10000)
163
164) ENGINE=ndbcluster DEFAULT CHARSET=utf8;
165
166drop table if exists charsetswedishutf8;
167create table charsetswedishutf8 (
168 id int not null primary key,
169 swedishcolumn char(4) COLLATE latin1_swedish_ci,
170 utfcolumn char(4) COLLATE utf8_general_ci
171
172) ENGINE=ndbcluster;
173
174drop table if exists charsetsjis;
175create table charsetsjis (
176 id int not null primary key,
177 smallcolumn varchar(200),
178 mediumcolumn varchar(500),
179 largecolumn text(10000)
180
181) ENGINE=ndbcluster DEFAULT CHARSET=sjis;
182
183drop table if exists longintstringpk;
184create table longintstringpk (
185 longpk bigint not null,
186 intpk int not null,
187 stringpk varchar(10) not null,
188 stringvalue varchar(10),
189        CONSTRAINT PK_longlongstringpk PRIMARY KEY (longpk, intpk, stringpk)
190
191) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY(intpk, longpk);
192
193drop table if exists hashonlylongintstringpk;
194create table hashonlylongintstringpk (
195 longpk bigint not null,
196 intpk int not null,
197 stringpk varchar(10) not null,
198 stringvalue varchar(10),
199        CONSTRAINT PK_longlongstringpk PRIMARY KEY (longpk, intpk, stringpk) USING HASH
200
201) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY(intpk, longpk);
202
203drop table if exists longlongstringfk;
204create table longlongstringfk (
205 longpk1 bigint not null,
206 longpk2 bigint not null,
207 stringpk varchar(10) not null,
208 longfk1 bigint,
209 longfk2 bigint,
210 stringfk varchar(10),
211 stringvalue varchar(10),
212        KEY FK_longfk1longfk2stringfk (longfk1, longfk2, stringfk),
213        CONSTRAINT PK_longlongstringfk PRIMARY KEY (longpk1, longpk2, stringpk)
214
215) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
216
217drop table if exists longintstringfk;
218create table longintstringfk (
219 longpk bigint not null,
220 intpk int not null,
221 stringpk varchar(10) not null,
222 longfk bigint,
223 intfk int,
224 stringfk varchar(10),
225 stringvalue varchar(10),
226        KEY FK_longfkintfkstringfk (longfk, intfk, stringfk),
227        CONSTRAINT PK_longintstringfk PRIMARY KEY (longpk, intpk, stringpk)
228
229) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
230
231drop table if exists a;
232CREATE TABLE a (
233        id              INT             NOT NULL,
234        cint            INT,
235        clong           BIGINT,
236        cfloat          FLOAT,
237        cdouble         DOUBLE,
238        cstring         VARCHAR(100),
239        CONSTRAINT PK_A_0 PRIMARY KEY (id)
240) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
241
242drop table if exists b0;
243CREATE TABLE b0 (
244        id              INT             NOT NULL,
245        cint            INT,
246        clong           BIGINT,
247        cfloat          FLOAT,
248        cdouble         DOUBLE,
249        a_id            INT,
250        cstring         VARCHAR(100),
251        cvarchar_ascii  VARCHAR(100),
252        ctext_ascii     TEXT(100),
253        cvarchar_ucs2   VARCHAR(100),
254        ctext_ucs2      TEXT(100),
255        bytes           VARBINARY(202),
256        KEY FK_a_id (a_id),
257        CONSTRAINT PK_B0_0 PRIMARY KEY (id)
258) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
259
260drop table if exists blobtypes;
261create table blobtypes (
262 id int not null primary key,
263
264 blobbytes blob,
265 blobstream blob
266
267) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
268
269drop table if exists bytestype;
270create table bytestype (
271 id int not null primary key,
272
273 bytes_null_hash varbinary(8),
274 bytes_null_btree varbinary(8),
275 bytes_null_both varbinary(8),
276 bytes_null_none varbinary(8),
277key idx_bytes_null_btree (bytes_null_btree),
278unique key idx_bytes_null_both (bytes_null_both),
279unique key idx_bytes_null_hash (bytes_null_hash) using hash
280
281) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
282
283drop table if exists doubletypes;
284create table doubletypes (
285 id int not null primary key,
286
287 double_null_hash double,
288 double_null_btree double,
289 double_null_both double,
290 double_null_none double,
291
292 double_not_null_hash double,
293 double_not_null_btree double,
294 double_not_null_both double,
295 double_not_null_none double,
296 unique key idx_double_null_hash (double_null_hash) using hash,
297 key idx_double_null_btree (double_null_btree),
298 unique key idx_double_null_both (double_null_both),
299
300 unique key idx_double_not_null_hash (double_not_null_hash) using hash,
301 key idx_double_not_null_btree (double_not_null_btree),
302 unique key idx_double_not_null_both (double_not_null_both)
303
304) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
305
306drop table if exists localetypes;
307create table localetypes (
308 id int not null primary key,
309
310 locale_null_hash varchar(20),
311 locale_null_btree varchar(300),
312 locale_null_both varchar(20),
313 locale_null_none varchar(300),
314
315 locale_not_null_hash varchar(300),
316 locale_not_null_btree varchar(20),
317 locale_not_null_both varchar(300),
318 locale_not_null_none varchar(20),
319 unique key idx_locale_null_hash (locale_null_hash) using hash,
320 key idx_locale_null_btree (locale_null_btree),
321 unique key idx_locale_null_both (locale_null_both),
322
323 unique key idx_locale_not_null_hash (locale_not_null_hash) using hash,
324 key idx_locale_not_null_btree (locale_not_null_btree),
325 unique key idx_locale_not_null_both (locale_not_null_both)
326
327) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
328
329drop table if exists stringtypes;
330create table stringtypes (
331 id int not null primary key,
332
333 string_null_hash varchar(20),
334 string_null_btree varchar(300),
335 string_null_both varchar(20),
336 string_null_none varchar(300),
337
338 string_not_null_hash varchar(300),
339 string_not_null_btree varchar(20),
340 string_not_null_both varchar(300),
341 string_not_null_none varchar(20),
342 unique key idx_string_null_hash (string_null_hash) using hash,
343 key idx_string_null_btree (string_null_btree),
344 unique key idx_string_null_both (string_null_both),
345
346 unique key idx_string_not_null_hash (string_not_null_hash) using hash,
347 key idx_string_not_null_btree (string_not_null_btree),
348 unique key idx_string_not_null_both (string_not_null_both)
349
350) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
351
352drop table if exists floattypes;
353create table floattypes (
354 id int not null primary key,
355
356 float_null_hash float,
357 float_null_btree float,
358 float_null_both float,
359 float_null_none float,
360
361 float_not_null_hash float,
362 float_not_null_btree float,
363 float_not_null_both float,
364 float_not_null_none float,
365 unique key idx_float_null_hash (float_null_hash) using hash,
366 key idx_float_null_btree (float_null_btree),
367 unique key idx_float_null_both (float_null_both),
368
369 unique key idx_float_not_null_hash (float_not_null_hash) using hash,
370 key idx_float_not_null_btree (float_not_null_btree),
371 unique key idx_float_not_null_both (float_not_null_both)
372
373) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
374
375drop table if exists t_basic;
376create table t_basic (
377  id int not null,
378  name varchar(32),
379  age int,
380  magic int not null,
381  primary key(id),
382
383  unique key idx_unique_hash_magic (magic) using hash,
384  key idx_btree_age (age)
385) ENGINE=ndbcluster;
386
387drop table if exists dn2id;
388create table dn2id (
389 eid bigint(20) unsigned NOT NULL,
390 object_classes varchar(100) NOT NULL,
391 x_object_classes varchar(100) NOT NULL DEFAULT '',
392 a0 varchar(128) NOT NULL DEFAULT '',
393 a1 varchar(128) NOT NULL DEFAULT '',
394 a2 varchar(128) NOT NULL DEFAULT '',
395 a3 varchar(128) NOT NULL DEFAULT '',
396 a4 varchar(128) NOT NULL DEFAULT '',
397 a5 varchar(128) NOT NULL DEFAULT '',
398 a6 varchar(128) NOT NULL DEFAULT '',
399 a7 varchar(128) NOT NULL DEFAULT '',
400 a8 varchar(128) NOT NULL DEFAULT '',
401 a9 varchar(128) NOT NULL DEFAULT '',
402 a10 varchar(128) NOT NULL DEFAULT '',
403 a11 varchar(128) NOT NULL DEFAULT '',
404 a12 varchar(128) NOT NULL DEFAULT '',
405 a13 varchar(128) NOT NULL DEFAULT '',
406 a14 varchar(128) NOT NULL DEFAULT '',
407 a15 varchar(128) NOT NULL DEFAULT '',
408 PRIMARY KEY (a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15),
409 unique key idx_unique_hash_eid (eid) using hash
410) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
411
412drop table if exists nullvalues;
413create table nullvalues (
414 id int not null primary key,
415 int_not_null_default_null_value_default int not null default '5',
416 int_not_null_default_null_value_exception int not null default '5',
417 int_not_null_default_null_value_none int not null default '5',
418 int_not_null_no_default_null_value_default int not null,
419 int_not_null_no_default_null_value_exception int not null,
420 int_not_null_no_default_null_value_none int not null,
421 int_null_default_null_value_default int default '5',
422 int_null_default_null_value_exception int default '5',
423 int_null_default_null_value_none int default '5',
424 int_null_no_default_null_value_default int,
425 int_null_no_default_null_value_exception int,
426 int_null_no_default_null_value_none int,
427
428 long_not_null_default_null_value_default bigint not null default '5',
429 long_not_null_default_null_value_exception bigint not null default '5',
430 long_not_null_default_null_value_none bigint not null default '5',
431 long_not_null_no_default_null_value_default bigint not null,
432 long_not_null_no_default_null_value_exception bigint not null,
433 long_not_null_no_default_null_value_none bigint not null,
434 long_null_default_null_value_default bigint default '5',
435 long_null_default_null_value_exception bigint default '5',
436 long_null_default_null_value_none bigint default '5',
437 long_null_no_default_null_value_default bigint,
438 long_null_no_default_null_value_exception bigint,
439 long_null_no_default_null_value_none bigint,
440
441 short_not_null_default_null_value_default smallint not null default '5',
442 short_not_null_default_null_value_exception smallint not null default '5',
443 short_not_null_default_null_value_none smallint not null default '5',
444 short_not_null_no_default_null_value_default smallint not null,
445 short_not_null_no_default_null_value_exception smallint not null,
446 short_not_null_no_default_null_value_none smallint not null,
447 short_null_default_null_value_default smallint default '5',
448 short_null_default_null_value_exception smallint default '5',
449 short_null_default_null_value_none smallint default '5',
450 short_null_no_default_null_value_default smallint,
451 short_null_no_default_null_value_exception smallint,
452 short_null_no_default_null_value_none smallint,
453
454 byte_not_null_default_null_value_default tinyint not null default '5',
455 byte_not_null_default_null_value_exception tinyint not null default '5',
456 byte_not_null_default_null_value_none tinyint not null default '5',
457 byte_not_null_no_default_null_value_default tinyint not null,
458 byte_not_null_no_default_null_value_exception tinyint not null,
459 byte_not_null_no_default_null_value_none tinyint not null,
460 byte_null_default_null_value_default tinyint default '5',
461 byte_null_default_null_value_exception tinyint default '5',
462 byte_null_default_null_value_none tinyint default '5',
463 byte_null_no_default_null_value_default tinyint,
464 byte_null_no_default_null_value_exception tinyint,
465 byte_null_no_default_null_value_none tinyint,
466
467 string_not_null_default_null_value_default varchar(5) not null default '5',
468 string_not_null_default_null_value_exception varchar(5) not null default '5',
469 string_not_null_default_null_value_none varchar(5) not null default '5',
470 string_not_null_no_default_null_value_default varchar(5) not null,
471 string_not_null_no_default_null_value_exception varchar(5) not null,
472 string_not_null_no_default_null_value_none varchar(5) not null,
473 string_null_default_null_value_default varchar(5) default '5',
474 string_null_default_null_value_exception varchar(5) default '5',
475 string_null_default_null_value_none varchar(5) default '5',
476 string_null_no_default_null_value_default varchar(5),
477 string_null_no_default_null_value_exception varchar(5),
478 string_null_no_default_null_value_none varchar(5),
479
480 float_not_null_default_null_value_default float not null default '5',
481 float_not_null_default_null_value_exception float not null default '5',
482 float_not_null_default_null_value_none float not null default '5',
483 float_not_null_no_default_null_value_default float not null,
484 float_not_null_no_default_null_value_exception float not null,
485 float_not_null_no_default_null_value_none float not null,
486 float_null_default_null_value_default float default '5',
487 float_null_default_null_value_exception float default '5',
488 float_null_default_null_value_none float default '5',
489 float_null_no_default_null_value_default float,
490 float_null_no_default_null_value_exception float,
491 float_null_no_default_null_value_none float,
492
493 double_not_null_default_null_value_default double not null default '5',
494 double_not_null_default_null_value_exception double not null default '5',
495 double_not_null_default_null_value_none double not null default '5',
496 double_not_null_no_default_null_value_default double not null,
497 double_not_null_no_default_null_value_exception double not null,
498 double_not_null_no_default_null_value_none double not null,
499 double_null_default_null_value_default double default '5',
500 double_null_default_null_value_exception double default '5',
501 double_null_default_null_value_none double default '5',
502 double_null_no_default_null_value_default double,
503 double_null_no_default_null_value_exception double,
504 double_null_no_default_null_value_none double
505
506) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
507
508drop table if exists shortpk;
509create table shortpk (
510 id smallint not null primary key,
511 short_null_none smallint,
512 short_null_btree smallint,
513 short_null_hash smallint,
514 short_null_both smallint,
515 key idx_short_null_btree (short_null_btree),
516 unique key idx_short_null_both (short_null_both),
517 unique key idx_short_null_hash (short_null_hash) using hash
518 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
519
520drop table if exists bytepk;
521create table bytepk (
522 id tinyint not null primary key,
523 byte_null_none tinyint,
524 byte_null_btree tinyint,
525 byte_null_hash tinyint,
526 byte_null_both tinyint,
527 key idx_byte_null_btree (byte_null_btree),
528 unique key idx_byte_null_both (byte_null_both),
529 unique key idx_byte_null_hash (byte_null_hash) using hash
530 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
531
532drop table if exists allprimitives;
533create table allprimitives (
534 id int not null primary key,
535
536 int_not_null_hash int not null,
537 int_not_null_btree int not null,
538 int_not_null_both int not null,
539 int_not_null_none int not null,
540 int_null_hash int,
541 int_null_btree int,
542 int_null_both int,
543 int_null_none int,
544
545 byte_not_null_hash tinyint not null,
546 byte_not_null_btree tinyint not null,
547 byte_not_null_both tinyint not null,
548 byte_not_null_none tinyint not null,
549 byte_null_hash tinyint,
550 byte_null_btree tinyint,
551 byte_null_both tinyint,
552 byte_null_none tinyint,
553
554 short_not_null_hash smallint not null,
555 short_not_null_btree smallint not null,
556 short_not_null_both smallint not null,
557 short_not_null_none smallint not null,
558 short_null_hash smallint,
559 short_null_btree smallint,
560 short_null_both smallint,
561 short_null_none smallint,
562
563 long_not_null_hash bigint not null,
564 long_not_null_btree bigint not null,
565 long_not_null_both bigint not null,
566 long_not_null_none bigint not null,
567 long_null_hash bigint,
568 long_null_btree bigint,
569 long_null_both bigint,
570 long_null_none bigint,
571
572 unique key idx_int_not_null_hash (int_not_null_hash) using hash,
573 key idx_int_not_null_btree (int_not_null_btree),
574 unique key idx_int_not_null_both (int_not_null_both),
575 unique key idx_int_null_hash (int_null_hash) using hash,
576 key idx_int_null_btree (int_null_btree),
577 unique key idx_int_null_both (int_null_both),
578
579 unique key idx_byte_not_null_hash (byte_not_null_hash) using hash,
580 key idx_byte_not_null_btree (byte_not_null_btree),
581 unique key idx_byte_not_null_both (byte_not_null_both),
582 unique key idx_byte_null_hash (byte_null_hash) using hash,
583 key idx_byte_null_btree (byte_null_btree),
584 unique key idx_byte_null_both (byte_null_both),
585
586 unique key idx_short_not_null_hash (short_not_null_hash) using hash,
587 key idx_short_not_null_btree (short_not_null_btree),
588 unique key idx_short_not_null_both (short_not_null_both),
589 unique key idx_short_null_hash (short_null_hash) using hash,
590 key idx_short_null_btree (short_null_btree),
591 unique key idx_short_null_both (short_null_both),
592
593 unique key idx_long_not_null_hash (long_not_null_hash) using hash,
594 key idx_long_not_null_btree (long_not_null_btree),
595 unique key idx_long_not_null_both (long_not_null_both),
596 unique key idx_long_null_hash (long_null_hash) using hash,
597 key idx_long_null_btree (long_null_btree),
598 unique key idx_long_null_both (long_null_both)
599
600) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
601
602drop table if exists decimaltypes;
603create table decimaltypes (
604 id int not null primary key,
605
606 decimal_null_hash decimal(10,5),
607 decimal_null_btree decimal(10,5),
608 decimal_null_both decimal(10,5),
609 decimal_null_none decimal(10,5),
610
611 unique key idx_decimal_null_hash (decimal_null_hash) using hash,
612 key idx_decimal_null_btree (decimal_null_btree),
613 unique key idx_decimal_null_both (decimal_null_both)
614
615) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
616
617drop table if exists bigintegertypes;
618create table bigintegertypes (
619 id int not null primary key,
620
621 decimal_null_hash decimal(10),
622 decimal_null_btree decimal(10),
623 decimal_null_both decimal(10),
624 decimal_null_none decimal(10),
625
626 unique key idx_decimal_null_hash (decimal_null_hash) using hash,
627 key idx_decimal_null_btree (decimal_null_btree),
628 unique key idx_decimal_null_both (decimal_null_both)
629
630) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
631
632drop table if exists timestamptypes;
633create table timestamptypes (
634 id int not null primary key,
635
636 timestamp_not_null_hash timestamp not null,
637 timestamp_not_null_btree timestamp not null,
638 timestamp_not_null_both timestamp not null,
639 timestamp_not_null_none timestamp not null,
640
641 unique key idx_timestamp_not_null_hash (timestamp_not_null_hash) using hash,
642 key idx_timestamp_not_null_btree (timestamp_not_null_btree),
643 unique key idx_timestamp_not_null_both (timestamp_not_null_both)
644
645) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
646
647drop table if exists stringtype;
648create table stringtype (
649 id int not null primary key,
650
651 string_null_hash varchar(10),
652 string_null_btree varchar(10),
653 string_null_both varchar(10),
654 string_null_none varchar(10),
655
656 unique key idx_string_null_hash (string_null_hash) using hash,
657 key idx_string_null_btree (string_null_btree),
658 unique key idx_string_null_both (string_null_both)
659
660) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
661
662drop table if exists yeartypes;
663create table yeartypes (
664 id int not null primary key,
665
666 year_null_hash year,
667 year_null_btree year,
668 year_null_both year,
669 year_null_none year,
670
671 year_not_null_hash year,
672 year_not_null_btree year,
673 year_not_null_both year,
674 year_not_null_none year,
675
676 unique key idx_year_null_hash (year_null_hash) using hash,
677 key idx_year_null_btree (year_null_btree),
678 unique key idx_year_null_both (year_null_both),
679
680 unique key idx_year_not_null_hash (year_not_null_hash) using hash,
681 key idx_year_not_null_btree (year_not_null_btree),
682 unique key idx_year_not_null_both (year_not_null_both)
683
684) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
685
686drop table if exists timetypes;
687create table timetypes (
688 id int not null primary key,
689
690 time_null_hash time,
691 time_null_btree time,
692 time_null_both time,
693 time_null_none time,
694
695 time_not_null_hash time,
696 time_not_null_btree time,
697 time_not_null_both time,
698 time_not_null_none time,
699
700 unique key idx_time_null_hash (time_null_hash) using hash,
701 key idx_time_null_btree (time_null_btree),
702 unique key idx_time_null_both (time_null_both),
703
704 unique key idx_time_not_null_hash (time_not_null_hash) using hash,
705 key idx_time_not_null_btree (time_not_null_btree),
706 unique key idx_time_not_null_both (time_not_null_both)
707
708) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
709
710drop table if exists datetypes;
711create table datetypes (
712 id int not null primary key,
713
714 date_null_hash date,
715 date_null_btree date,
716 date_null_both date,
717 date_null_none date,
718
719 date_not_null_hash date,
720 date_not_null_btree date,
721 date_not_null_both date,
722 date_not_null_none date,
723
724 unique key idx_date_null_hash (date_null_hash) using hash,
725 key idx_date_null_btree (date_null_btree),
726 unique key idx_date_null_both (date_null_both),
727
728 unique key idx_date_not_null_hash (date_not_null_hash) using hash,
729 key idx_date_not_null_btree (date_not_null_btree),
730 unique key idx_date_not_null_both (date_not_null_both)
731
732) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
733
734drop table if exists datetimetypes;
735create table datetimetypes (
736 id int not null primary key,
737
738 datetime_null_hash datetime,
739 datetime_null_btree datetime,
740 datetime_null_both datetime,
741 datetime_null_none datetime,
742
743 datetime_not_null_hash datetime,
744 datetime_not_null_btree datetime,
745 datetime_not_null_both datetime,
746 datetime_not_null_none datetime,
747
748 unique key idx_datetime_null_hash (datetime_null_hash) using hash,
749 key idx_datetime_null_btree (datetime_null_btree),
750 unique key idx_datetime_null_both (datetime_null_both),
751
752 unique key idx_datetime_not_null_hash (datetime_not_null_hash) using hash,
753 key idx_datetime_not_null_btree (datetime_not_null_btree),
754 unique key idx_datetime_not_null_both (datetime_not_null_both)
755
756) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
757
758drop table if exists autopkbigint;
759create table autopkbigint (
760  id bigint primary key auto_increment,
761  val bigint
762) ENGINE=ndb;
763
764drop table if exists autopkint;
765create table autopkint (
766  id int primary key auto_increment,
767  val int
768) ENGINE=ndb;
769
770drop table if exists autopksmallint;
771create table autopksmallint (
772  id smallint primary key auto_increment,
773  val smallint
774) ENGINE=ndb;
775
776drop table if exists autopktinyint;
777create table autopktinyint (
778  id tinyint primary key auto_increment,
779  val tinyint
780) ENGINE=ndb;
781
782drop table if exists longintstringix;
783create table longintstringix (
784 id int(11) not null,
785 longix bigint(20) not null,
786 stringix varchar(10) not null,
787 intix int(11) not null,
788 stringvalue varchar(10) default null,
789 PRIMARY KEY (id),
790 KEY idx_long_int_string (longix, intix, stringix)
791) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
792
793drop table if exists cassandra_string;
794create table cassandra_string (
795  id varchar(10),
796  c1 varchar(34),
797  c2 varchar(34),
798  c3 varchar(34),
799  c4 varchar(34),
800  c5 varchar(34)
801) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
802
803drop table if exists cassandra_byte_array;
804create table cassandra_byte_array (
805  id binary(10) primary key,
806  c1 binary(34),
807  c2 binary(34),
808  c3 binary(34),
809  c4 binary(34),
810  c5 binary(34)
811) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
812
813drop table if exists stress;
814create table stress (
815  id int not null primary key,
816  i0 int not null,
817  l0 bigint not null,
818  f0 float not null,
819  d0 double not null,
820  i1 int not null,
821  l1 bigint not null,
822  f1 float not null,
823  d1 double not null,
824  i2 int not null,
825  l2 bigint not null,
826  f2 float not null,
827  d2 double not null,
828  i3 int not null,
829  l3 bigint not null,
830  f3 float not null,
831  d3 double not null,
832  i4 int not null,
833  l4 bigint not null,
834  f4 float not null,
835  d4 double not null,
836  i5 int not null,
837  l5 bigint not null,
838  f5 float not null,
839  d5 double not null,
840  i6 int not null,
841  l6 bigint not null,
842  f6 float not null,
843  d6 double not null,
844  i7 int not null,
845  l7 bigint not null,
846  f7 float not null,
847  d7 double not null,
848  i8 int not null,
849  l8 bigint not null,
850  f8 float not null,
851  d8 double not null,
852  i9 int not null,
853  l9 bigint not null,
854  f9 float not null,
855  d9 double not null,
856  i10 int not null,
857  l10 bigint not null,
858  f10 float not null,
859  d10 double not null,
860  i11 int not null,
861  l11 bigint not null,
862  f11 float not null,
863  d11 double not null,
864  i12 int not null,
865  l12 bigint not null,
866  f12 float not null,
867  d12 double not null,
868  i13 int not null,
869  l13 bigint not null,
870  f13 float not null,
871  d13 double not null,
872  i14 int not null,
873  l14 bigint not null,
874  f14 float not null,
875  d14 double not null,
876  i15 int not null,
877  l15 bigint not null,
878  f15 float not null,
879  d15 double not null,
880  i16 int not null,
881  l16 bigint not null,
882  f16 float not null,
883  d16 double not null,
884  i17 int not null,
885  l17 bigint not null,
886  f17 float not null,
887  d17 double not null,
888  i18 int not null,
889  l18 bigint not null,
890  f18 float not null,
891  d18 double not null,
892  i19 int not null,
893  l19 bigint not null,
894  f19 float not null,
895  d19 double not null
896  ) ENGINE=ndbcluster;
897
898create database if not exists test2;
899use test2;
900drop table if exists t_basic2;
901create table t_basic2 (
902  id int not null,
903  name varchar(32),
904  age int,
905  magic int not null,
906  primary key(id),
907
908  unique key idx_unique_hash_magic (magic) using hash,
909  key idx_btree_age (age)
910) ENGINE=ndbcluster;
911use test;
912