1--source include/have_rocksdb.inc
2
3#
4# Basic CREATE TABLE statements
5#
6
7#############################################
8# TODO:
9# A part of the test is currently disabled
10# because temporary tables are not supported
11#############################################
12
13--disable_warnings
14DROP TABLE IF EXISTS t1,t2;
15--enable_warnings
16
17# Simple create table with minimal table options
18# which are defined in have_engine.inc
19# (default empty) plus ENGINE=
20
21CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=rocksdb;
22SHOW CREATE TABLE t1;
23
24# IF NOT EXISTS
25CREATE TABLE IF NOT EXISTS t1 (a INT PRIMARY KEY) ENGINE=rocksdb;
26
27# CREATE .. LIKE
28
29CREATE TABLE t2 LIKE t1;
30SHOW CREATE TABLE t2;
31
32--error ER_ILLEGAL_HA_CREATE_OPTION
33CREATE TEMPORARY TABLE t2 (a INT PRIMARY KEY) ENGINE=rocksdb;
34
35--disable_parsing
36
37DROP TABLE t2;
38
39CREATE TEMPORARY TABLE t2 LIKE t1;
40
41SHOW CREATE TABLE t2;
42DROP TEMPORARY TABLE t2;
43
44--enable_parsing
45
46DROP TABLE t2;
47
48DROP TABLE IF EXISTS t1;
49
50# CREATE .. AS SELECT
51
52# Use the engine as default
53
54SET default_storage_engine = rocksdb;
55
56CREATE TABLE t1 (a INT PRIMARY KEY);
57SHOW CREATE TABLE t1;
58DROP TABLE t1;
59
60CREATE TABLE t1 (a INT PRIMARY KEY) AS SELECT 1 AS a UNION SELECT 2 AS a;
61SHOW CREATE TABLE t1;
62--sorted_result
63SELECT * FROM t1;
64
65# Just to add FLUSH LOGS into the mix while we are in the most common test
66FLUSH LOGS;
67
68DROP TABLE IF EXISTS t1;
69
70# CREATE TABLE with MAX_INDEXES (64) keys and no primary key
71# MyRocks adds a hidden primary key, so make sure we don't break anything
72CREATE TABLE t1(c1 INT,c2 INT,c3 INT,c4 INT,c5 INT,c6 INT,c7 INT,c8 INT,c9 INT,
73                c10 INT,c11 INT,c12 INT,c13 INT,c14 INT,c15 INT,c16 INT,c17 INT,
74                c18 INT,c19 INT,c20 INT,c21 INT,c22 INT,c23 INT,c24 INT,c25 INT,
75                c26 INT,c27 INT,c28 INT,c29 INT,c30 INT,c31 INT,c32 INT,c33 INT,
76                c34 INT,c35 INT,c36 INT,c37 INT,c38 INT,c39 INT,c40 INT,c41 INT,
77                c42 INT,c43 INT,c44 INT,c45 INT,c46 INT,c47 INT,c48 INT,c49 INT,
78                c50 INT,c51 INT,c52 INT,c53 INT,c54 INT,c55 INT,c56 INT,c57 INT,
79                c58 INT,c59 INT,c60 INT,c61 INT,c62 INT,c63 INT,c64 INT,c65 INT,
80                c66 INT,c67 INT,c68 INT,c69 INT,c70 INT,c71 INT,c72 INT,c73 INT,
81                c74 INT,c75 INT,c76 INT,c77 INT,c78 INT,c79 INT,c80 INT,c81 INT,
82                c82 INT,c83 INT,c84 INT,c85 INT,c86 INT,c87 INT,c88 INT,c89 INT,
83                c90 INT,c91 INT,c92 INT,c93 INT,c94 INT,c95 INT,c96 INT,c97 INT,
84                c98 INT,c99 INT,c100 INT,c101 INT,c102 INT,c103 INT,c104 INT,
85                c105 INT,c106 INT,c107 INT,c108 INT,c109 INT,c110 INT,c111 INT,
86                c112 INT,c113 INT,c114 INT,c115 INT,c116 INT,c117 INT,c118 INT,
87                c119 INT,c120 INT,c121 INT,c122 INT,c123 INT,c124 INT,c125 INT,
88                c126 INT,c127 INT,c128 INT,c129 INT,c130 INT,c131 INT,c132 INT,
89                c133 INT,c134 INT,c135 INT,c136 INT,c137 INT,c138 INT,c139 INT,
90                c140 INT,c141 INT,c142 INT,c143 INT,c144 INT,c145 INT,c146 INT,
91                c147 INT,c148 INT,c149 INT,c150 INT,c151 INT,c152 INT,c153 INT,
92                c154 INT,c155 INT,c156 INT,c157 INT,c158 INT,c159 INT,c160 INT,
93                c161 INT,c162 INT,c163 INT,c164 INT,c165 INT,c166 INT,c167 INT,
94                c168 INT,c169 INT,c170 INT,c171 INT,c172 INT,c173 INT,c174 INT,
95                c175 INT,c176 INT,c177 INT,c178 INT,c179 INT,c180 INT,c181 INT,
96                c182 INT,c183 INT,c184 INT,c185 INT,c186 INT,c187 INT,c188 INT,
97                c189 INT,c190 INT,c191 INT,c192 INT,c193 INT,c194 INT,c195 INT,
98                c196 INT,c197 INT,c198 INT,c199 INT,c200 INT,c201 INT,c202 INT,
99                c203 INT,c204 INT,c205 INT,c206 INT,c207 INT,c208 INT,c209 INT,
100                c210 INT,c211 INT,c212 INT,c213 INT,c214 INT,c215 INT,c216 INT,
101                c217 INT,c218 INT,c219 INT,c220 INT,c221 INT,c222 INT,c223 INT,
102                c224 INT,c225 INT,c226 INT,c227 INT,c228 INT,c229 INT,c230 INT,
103                c231 INT,c232 INT,c233 INT,c234 INT,c235 INT,c236 INT,c237 INT,
104                c238 INT,c239 INT,c240 INT,c241 INT,c242 INT,c243 INT,c244 INT,
105                c245 INT,c246 INT,c247 INT,c248 INT,c249 INT,c250 INT,c251 INT,
106                c252 INT,c253 INT,c254 INT,c255 INT,c256 INT,c257 INT,c258 INT,
107                c259 INT,c260 INT,c261 INT,c262 INT,c263 INT,c264 INT,c265 INT,
108                c266 INT,c267 INT,c268 INT,c269 INT,c270 INT,c271 INT,c272 INT,
109                c273 INT,c274 INT,c275 INT,c276 INT,c277 INT,c278 INT,c279 INT,
110                c280 INT,c281 INT,c282 INT,c283 INT,c284 INT,c285 INT,c286 INT,
111                c287 INT,c288 INT,c289 INT,c290 INT,c291 INT,c292 INT,c293 INT,
112                c294 INT,c295 INT,c296 INT,c297 INT,c298 INT,c299 INT,c300 INT,
113                c301 INT,c302 INT,c303 INT,c304 INT,c305 INT,c306 INT,c307 INT,
114                c308 INT,c309 INT,c310 INT,c311 INT,c312 INT,c313 INT,c314 INT,
115                c315 INT,c316 INT,c317 INT,c318 INT,c319 INT,c320 INT,c321 INT,
116                c322 INT,c323 INT,c324 INT,c325 INT,c326 INT,c327 INT,c328 INT,
117                c329 INT,c330 INT,c331 INT,c332 INT,c333 INT,c334 INT,c335 INT,
118                c336 INT,c337 INT,c338 INT,c339 INT,c340 INT,c341 INT,c342 INT,
119                c343 INT,c344 INT,c345 INT,c346 INT,c347 INT,c348 INT,c349 INT,
120                c350 INT,c351 INT,c352 INT,c353 INT,c354 INT,c355 INT,c356 INT,
121                c357 INT,c358 INT,c359 INT,c360 INT,c361 INT,c362 INT,c363 INT,
122                c364 INT,c365 INT,c366 INT,c367 INT,c368 INT,c369 INT,c370 INT,
123                c371 INT,c372 INT,c373 INT,c374 INT,c375 INT,c376 INT,c377 INT,
124                c378 INT,c379 INT,c380 INT,c381 INT,c382 INT,c383 INT,c384 INT,
125                c385 INT,c386 INT,c387 INT,c388 INT,c389 INT,c390 INT,c391 INT,
126                c392 INT,c393 INT,c394 INT,c395 INT,c396 INT,c397 INT,c398 INT,
127                c399 INT,c400 INT,c401 INT,c402 INT,c403 INT,c404 INT,c405 INT,
128                c406 INT,c407 INT,c408 INT,c409 INT,c410 INT,c411 INT,c412 INT,
129                c413 INT,c414 INT,c415 INT,c416 INT,c417 INT,c418 INT,c419 INT,
130                c420 INT,c421 INT,c422 INT,c423 INT,c424 INT,c425 INT,c426 INT,
131                c427 INT,c428 INT,c429 INT,c430 INT,c431 INT,c432 INT,c433 INT,
132                c434 INT,c435 INT,c436 INT,c437 INT,c438 INT,c439 INT,c440 INT,
133                c441 INT,c442 INT,c443 INT,c444 INT,c445 INT,c446 INT,c447 INT,
134                c448 INT,
135    KEY (c1,c2,c3,c4,c5,c6,c7),KEY (c8,c9,c10,c11,c12,c13,c14),
136    KEY (c15,c16,c17,c18,c19,c20,c21),KEY (c22,c23,c24,c25,c26,c27,c28),
137    KEY (c29,c30,c31,c32,c33,c34,c35),KEY (c36,c37,c38,c39,c40,c41,c42),
138    KEY (c43,c44,c45,c46,c47,c48,c49),KEY (c50,c51,c52,c53,c54,c55,c56),
139    KEY (c57,c58,c59,c60,c61,c62,c63),KEY (c64,c65,c66,c67,c68,c69,c70),
140    KEY (c71,c72,c73,c74,c75,c76,c77),KEY (c78,c79,c80,c81,c82,c83,c84),
141    KEY (c85,c86,c87,c88,c89,c90,c91),KEY (c92,c93,c94,c95,c96,c97,c98),
142    KEY (c99,c100,c101,c102,c103,c104,c105),
143    KEY (c106,c107,c108,c109,c110,c111,c112),
144    KEY (c113,c114,c115,c116,c117,c118,c119),
145    KEY (c120,c121,c122,c123,c124,c125,c126),
146    KEY (c127,c128,c129,c130,c131,c132,c133),
147    KEY (c134,c135,c136,c137,c138,c139,c140),
148    KEY (c141,c142,c143,c144,c145,c146,c147),
149    KEY (c148,c149,c150,c151,c152,c153,c154),
150    KEY (c155,c156,c157,c158,c159,c160,c161),
151    KEY (c162,c163,c164,c165,c166,c167,c168),
152    KEY (c169,c170,c171,c172,c173,c174,c175),
153    KEY (c176,c177,c178,c179,c180,c181,c182),
154    KEY (c183,c184,c185,c186,c187,c188,c189),
155    KEY (c190,c191,c192,c193,c194,c195,c196),
156    KEY (c197,c198,c199,c200,c201,c202,c203),
157    KEY (c204,c205,c206,c207,c208,c209,c210),
158    KEY (c211,c212,c213,c214,c215,c216,c217),
159    KEY (c218,c219,c220,c221,c222,c223,c224),
160    KEY (c225,c226,c227,c228,c229,c230,c231),
161    KEY (c232,c233,c234,c235,c236,c237,c238),
162    KEY (c239,c240,c241,c242,c243,c244,c245),
163    KEY (c246,c247,c248,c249,c250,c251,c252),
164    KEY (c253,c254,c255,c256,c257,c258,c259),
165    KEY (c260,c261,c262,c263,c264,c265,c266),
166    KEY (c267,c268,c269,c270,c271,c272,c273),
167    KEY (c274,c275,c276,c277,c278,c279,c280),
168    KEY (c281,c282,c283,c284,c285,c286,c287),
169    KEY (c288,c289,c290,c291,c292,c293,c294),
170    KEY (c295,c296,c297,c298,c299,c300,c301),
171    KEY (c302,c303,c304,c305,c306,c307,c308),
172    KEY (c309,c310,c311,c312,c313,c314,c315),
173    KEY (c316,c317,c318,c319,c320,c321,c322),
174    KEY (c323,c324,c325,c326,c327,c328,c329),
175    KEY (c330,c331,c332,c333,c334,c335,c336),
176    KEY (c337,c338,c339,c340,c341,c342,c343),
177    KEY (c344,c345,c346,c347,c348,c349,c350),
178    KEY (c351,c352,c353,c354,c355,c356,c357),
179    KEY (c358,c359,c360,c361,c362,c363,c364),
180    KEY (c365,c366,c367,c368,c369,c370,c371),
181    KEY (c372,c373,c374,c375,c376,c377,c378),
182    KEY (c379,c380,c381,c382,c383,c384,c385),
183    KEY (c386,c387,c388,c389,c390,c391,c392),
184    KEY (c393,c394,c395,c396,c397,c398,c399),
185    KEY (c400,c401,c402,c403,c404,c405,c406),
186    KEY (c407,c408,c409,c410,c411,c412,c413),
187    KEY (c414,c415,c416,c417,c418,c419,c420),
188    KEY (c421,c422,c423,c424,c425,c426,c427),
189    KEY (c428,c429,c430,c431,c432,c433,c434),
190    KEY (c435,c436,c437,c438,c439,c440,c441),
191    KEY (c442,c443,c444,c445,c446,c447,c448));
192DROP TABLE t1;
193