Debian Codegraph @

mysql-test/suite/innodb/include/create_workload_itt.inc

raw
1 #
2 # WL#6737: Create Workload that will be used to fire queries involving
3 # intrinsic tables.
4 #
5 drop table if exists t1, t2;
6 eval create $wl6737_temp table t1 (a int, b varchar(20));
7 eval create $wl6737_temp table t2 (a int, b varchar(20));
8 insert into t1 values(1, 'a'), (2, 'b'), (3, 'c'), (3, 'c'), (4, 'c');
9 insert into t2 values(2, 'd'), (3, 'e'), (4, 'f'), (4, 'f'), (5, 'e');
10 #
11 drop function if exists func1;
12 delimiter |;
13 create function func1(x int) returns int deterministic
14 begin
15 declare z1, z2 int;
16 set z1 = x;
17 set z2 = z1 + 2;
18 return z2;
19 end|
20 delimiter ;|
21 #
22 drop table if exists t3;
23 eval create $wl6737_temp table t3 like t1;
24 insert into t3 select 5 + 10000 * rand(), '5' from t3;
25 insert into t3 select 5 + 10000 * rand(), '5' from t3;
26 insert into t3 select 5 + 10000 * rand(), '5' from t3;
27 insert into t3 select 5 + 10000 * rand(), '5' from t3;
28 insert into t3 select 5 + 10000 * rand(), '5' from t3;
29 insert into t3 select 5 + 10000 * rand(), '5' from t3;
30 insert into t3 select 5 + 10000 * rand(), '5' from t3;
31 insert into t3 select 5 + 10000 * rand(), '5' from t3;
32 #
33 drop table if exists t4;
34 eval create $wl6737_temp table t4 (a int, b int, c int, d char, e blob);
35 insert into t4 values (1, 2, 3, '4', '5');
36 #
37 drop table if exists t5;
38 eval create $wl6737_temp table t5 (a int, b int primary key);
39 insert into t5 values (1,7), (1,8);
40 #
41 drop table if exists t6;
42 eval create $wl6737_temp table t6 (a int, b int, c int, d char);
43 insert into t6 values(1, 2, 3, '4');
44 create index t6_indx1 on t6(a);
45 #
46 drop table if exists t7;
47 eval create $wl6737_temp table t7 (a int, b varchar(20));
48 insert into t7 values(1, 'a'), (2, 'b'), (3, 'c'), (3, 'c'), (4, 'c');
49 create index indx7 on t7(b);
50 #
51 drop table if exists t8;
52 eval create $wl6737_temp table t8 (
53 pk integer $wl6737_auto_inc, col_int_key integer,
54 col_varchar_key varchar(1), primary key (pk),
55 key (col_int_key), key (col_varchar_key, col_int_key)) engine = innodb;
56 insert into t8 values (1, 2, 'v'), (2, 150, 'v');
57 #
58 drop table if exists t9, t10;
59 eval create $wl6737_temp table t9 (
60 pk int(11) not null $wl6737_auto_inc,
61 col_int_nokey int(11) default null,
62 col_int_key int(11) default null,
63 col_date_key date default null,
64 col_date_nokey date default null,
65 primary key (pk),
66 key col_int_key (col_int_key),
67 key col_date_key (col_date_key),
68 key col_varchar_key (col_int_key)
69 ) engine=innodb;
70 eval create $wl6737_temp table t10 (
71 pk int(11) not null $wl6737_auto_inc,
72 col_int_nokey int(11) default null,
73 col_int_key int(11) default null,
74 col_date_key date default null,
75 col_date_nokey date default null,
76 primary key (pk),
77 key col_int_key (col_int_key),
78 key col_date_key (col_date_key),
79 key col_varchar_key (col_int_key)
80 ) engine=innodb;
81 #
82 insert into t9 values
83 (1, 2, 4, '2008-12-05', '2008-12-05'),
84 (2, 150, 62, '2005-03-27', '2005-03-27'),
85 (3, NULL, 7, '2004-04-09', '2004-04-09'),
86 (4, 2, 1, '2006-05-13', '2006-05-13'),
87 (5, 5, 0, '2001-05-06', '2001-05-06'),
88 (6, 3, 7, '2006-03-03', '2006-03-03'),
89 (7, 1, 7, '2007-12-28', '2007-12-28'),
90 (8, 4, 1, '2004-10-20', '2004-10-20'),
91 (9, NULL, 7, '2008-04-09', '2008-04-09'),
92 (10, 2, 1, '2005-12-25', '2005-12-25'),
93 (11, 6, 5, '1900-01-01', '1900-01-01'),
94 (12, 6, 2, NULL, NULL),
95 (13, 8, 0, '1900-01-01', '1900-01-01'),
96 (14, 2, 1, '2001-01-16', '2001-01-16'),
97 (15, 6, 8, '1900-01-01', '1900-01-01'),
98 (16, 8, 1, '2001-11-23', '2001-11-23'),
99 (17, 3, 1, '2004-11-04', '2004-11-04'),
100 (18, 3, 9, '2003-03-12', '2003-03-12'),
101 (19, 9, 1, '2002-06-22', '2002-06-22'),
102 (20, 6, 5, '2004-10-10', '2004-10-10');
103 insert into t10 values
104 (1, 8, 4, '2002-01-03', '2002-01-03'),
105 (2, 3, 5, '2007-07-08', '2007-07-08'),
106 (3, 3, 8, '2000-08-02', '2000-08-02'),
107 (4, NULL, 4, '2000-03-06', '2000-03-06'),
108 (5, 7, 8, '2002-06-05', '2002-06-05'),
109 (6, 4, 2, '2009-08-09', '2009-08-09'),
110 (7, 7, 9, '2001-03-22', '2001-03-22'),
111 (8, 7, 6, '2002-10-08', '2002-10-08'),
112 (9, 8, NULL, NULL, NULL),
113 (10, 6, NULL, '2007-09-13', '2007-09-13'),
114 (11, 3, 48, '2003-12-08', '2003-12-08'),
115 (12, 210, 228, '2006-06-01', '2006-06-01'),
116 (13, 1, 3, '2001-10-04', '2001-10-04'),
117 (14, 2, 5, '2004-11-16', '2004-11-16'),
118 (15, 251, 39, NULL, NULL),
119 (16, 4, 6, '2005-06-22', '2005-06-22'),
120 (17, 4, 8, '2003-04-19', '2003-04-19'),
121 (18, 9, 3, '2006-03-23', '2006-03-23'),
122 (19, 4, NULL, NULL, NULL),
123 (20, NULL, 2, '2008-10-22', '2008-10-22'),
124 (21, 4, 6, '2009-04-04', '2009-04-04'),
125 (22, NULL, 3, NULL, NULL),
126 (23, 1, 1, '2001-07-15', '2001-07-15'),
127 (24, 6, 4, '2004-09-25', '2004-09-25'),
128 (25, 2, 3, '2001-02-20', '2001-02-20'),
129 (26, NULL, 1, '1900-01-01', '1900-01-01'),
130 (27, 4, NULL, '2004-08-02', '2004-08-02'),
131 (28, 248, 97, '2009-02-26', '2009-02-26'),
132 (29, 4, 0, '2002-11-23', '2002-11-23'),
133 (30, 8, 0, '2008-12-17', '2008-12-17'),
134 (31, 4, 9, '2005-08-26', '2005-08-26'),
135 (32, 5, 5, '2001-03-10', '2001-03-10'),
136 (33, 9, 9, '1900-01-01', '1900-01-01'),
137 (34, 2, 0, '2003-08-04', '2003-08-04'),
138 (35, 4, 2, '2007-11-06', '2007-11-06'),
139 (36, 211, 172, '2009-04-23', '2009-04-23'),
140 (37, 2, NULL, '2002-10-06', '2002-10-06'),
141 (38, 4, 5, '2008-02-12', '2008-02-12'),
142 (39, 125, 119, '2007-09-18', '2007-09-18'),
143 (40, 9, 1, '2007-06-26', '2007-06-26'),
144 (41, 4, 4, NULL, NULL),
145 (42, 8, 8, '2009-05-05', '2009-05-05'),
146 (43, 8, NULL, '2003-05-04', '2003-05-04'),
147 (44, NULL, 6, '2003-11-10', '2003-11-10'),
148 (45, 8, 5, '2009-02-19', '2009-02-19'),
149 (46, 4, 5, '2006-11-17', '2006-11-17'),
150 (47, 8, 1, '2000-02-23', '2000-02-23'),
151 (48, NULL, 7, '1900-01-01', '1900-01-01'),
152 (49, 1, 2, '2003-04-08', '2003-04-08'),
153 (50, 3, 8, '2006-07-08', '2006-07-08'),
154 (51, 5, 9, '2001-05-21', '2001-05-21'),
155 (52, 8, NULL, NULL, NULL),
156 (53, 7, NULL, '2009-01-05', '2009-01-05'),
157 (54, 2, 3, '2001-08-05', '2001-08-05'),
158 (55, NULL, 172, '2000-11-01', '2000-11-01'),
159 (56, 3, NULL, '2004-12-16', '2004-12-16'),
160 (57, NULL, 6, '2003-02-06', '2003-02-06'),
161 (58, 9, 6, '2008-04-23', '2008-04-23'),
162 (59, 1, 5, '2005-12-20', '2005-12-20'),
163 (60, 0, 4, '2002-03-13', '2002-03-13'),
164 (61, 0, 3, NULL, NULL),
165 (62, 8, 2, '2006-07-20', '2006-07-20'),
166 (63, NULL, 7, '2002-12-19', '2002-12-19'),
167 (64, 9, 4, '2001-07-09', '2001-07-09'),
168 (65, 1, 6, '2006-05-27', '2006-05-27'),
169 (66, 9, 0, '2007-02-26', '2007-02-26'),
170 (67, 7, 8, NULL, NULL),
171 (68, 2, 5, '2007-02-07', '2007-02-07'),
172 (69, 1, 8, '2005-01-22', '2005-01-22'),
173 (70, 9, 2, '2006-04-25', '2006-04-25'),
174 (71, 5, 9, '2002-11-13', '2002-11-13'),
175 (72, 4, 7, '2007-10-26', '2007-10-26'),
176 (73, 6, 5, '2003-06-16', '2003-06-16'),
177 (74, 5, 7, '2006-01-18', '2006-01-18'),
178 (75, 2, 0, '1900-01-01', '1900-01-01'),
179 (76, 4, 4, '2000-09-13', '2000-09-13'),
180 (77, 0, 3, '2003-01-26', '2003-01-26'),
181 (78, 3, 1, '2002-09-09', '2002-09-09'),
182 (79, 0, 0, '2001-09-06', '2001-09-06'),
183 (80, 6, 6, '2006-02-23', '2006-02-23'),
184 (81, 1, 2, '2004-06-21', '2004-06-21'),
185 (82, 9, NULL, '2006-12-02', '2006-12-02'),
186 (83, 4, 8, '2005-05-17', '2005-05-17'),
187 (84, 9, NULL, '2001-12-27', '2001-12-27'),
188 (85, 4, NULL, '2008-04-11', '2008-04-11'),
189 (86, 1, NULL, '2000-09-24', '2000-09-24'),
190 (87, 2, 3, '2004-04-20', '2004-04-20'),
191 (88, 8, 7, '2008-07-10', '2008-07-10'),
192 (89, 1, 3, '2007-08-14', '2007-08-14'),
193 (90, 0, 5, '2008-06-08', '2008-06-08'),
194 (91, 2, 5, '2001-07-26', '2001-07-26'),
195 (92, 0, 1, '2008-09-17', '2008-09-17'),
196 (93, 1, 2, NULL, NULL),
197 (94, 2, 1, '2004-02-25', '2004-02-25'),
198 (95, NULL, 7, '2009-11-02', '2009-11-02'),
199 (96, 3, 1, '2001-12-14', '2001-12-14'),
200 (97, 8, 9, NULL, NULL),
201 (98, 4, 9, '1900-01-01', '1900-01-01'),
202 (99, 4, 8, '2002-04-12', '2002-04-12'),
203 (100, NULL, 3, '2000-02-09', '2000-02-09');
204 #
205 eval create $wl6737_temp table t11 (
206 col_date_key date default null,
207 col_varchar_10_utf8 varchar(10) CHARACTER SET utf8 default null,
208 col_varchar_10_latin1 varchar(10) default null,
209 col_varchar_10_latin1_key varchar(10) default null,
210 col_datetime datetime default null,
211 col_varchar_10_utf8_key varchar(10) CHARACTER SET utf8 default null,
212 col_varchar_1024_latin1_key varchar(1024) default null,
213 col_varchar_1024_latin1 varchar(1024) default null,
214 col_varchar_1024_utf8 varchar(1024) CHARACTER SET utf8 default null,
215 col_int_key int(11) default null,
216 col_date date default null,
217 col_varchar_1024_utf8_key varchar(1024) CHARACTER SET utf8 default null,
218 col_int int(11) default null,
219 pk int(11) not null auto_increment,
220 col_datetime_key datetime default null,
221 primary key (pk),
222 key col_date_key (col_date_key),
223 key col_varchar_10_latin1_key (col_varchar_10_latin1_key),
224 key col_varchar_10_utf8_key (col_varchar_10_utf8_key),
225 key col_varchar_1024_latin1_key (col_varchar_1024_latin1_key(1000)),
226 key col_int_key (col_int_key),
227 key col_varchar_1024_utf8_key (col_varchar_1024_utf8_key(333)),
228 key col_datetime_key (col_datetime_key)
229 ) engine=myisam auto_increment=76 default charset=latin1;
230 #
231 --disable_warnings
232 insert ignore into t11 values
233 ('2005-03-10','have','o','gryvuwdllyhymuwyypoiuyeqbnaanbur','2004','going','h','well','f',1140785152,'2003','YTLDF',NULL,NULL,'20050908213850.042201'),
234 ('2003', 'g', 'ELTFL', 'got', '20:07:16.048352', 'ryvuwdllyhymuwyypoiuyeqbnaanbursgddnqhyvxnnpadsjiqdkajofferjfslatroorycttbiuhlubvmoikwwnalqyewgthdmfvsedatazrflwenzeiwdxtheqppbmqfydsawvanehgvfvbsqxzkqzhtjkybvikmpexipoddmoulsnzfchusfgkdazecevrpuakfioamyyqyribcnydfxmmzsxcpkydyczmeajaebsaskneaqwxjbpjptiwgiizoxfygnbjojpifpzldsdhrukdbwpzribxgafunywmmcfpjugozduylotsugqocbadhcnxjqlugncbebwsbobhxgghyyphxfqqnpliazusgjswynfotwdonpbkllfdbuoqceirksegypasuuxnrjumrkaryhkgkbdfgoqbdmrdrmpvwitqzswgossxltimkbtrxitnmigcxgfaqmrnvspyaftisgdbkzlevczyrlossygtnatwcobbtsxqhjrdykmthpyzmdgyirxwlidiknxwsufkyexucekyhivscjdcouswuiyltrpmrngriwvrxgovfyewdsvlwirfzkwexxzoccufvuvhsjfvuwjsrrzguntudxxhblzbescayrbbrijnvucxxmbyltlojlgcweddzrfxsmwnxxewigapgrowtmrlqsknuaegzfvdwfdnnbfyubwckwfdrwmrymagyswwvvyeqhaaskgxogthhrzsdlsyqoeuvhwxquwbnivpowtybzehvbsoppuefqngkqohtdeylosjyvtxuziotnfpbqxkpxvzcjbgxokjzitakfevxduhtudsslluhzgcwgrcrtpnczgxchnmmgnubjzvvuklklfhiupbsjzhcqyadhskxtjzabzesulhgpykga', 'she', 'have', 'PYJKD', 9, '2008-06-10', 'yvuwdllyhymuwyypoiuyeqbnaanbursgddnqhyvxnnpadsjiqdkajofferjfslatroorycttbiuhlubvmoikwwnalqyewgthdmfvsedatazrflwenzeiwdxtheqppbmqfydsawvanehgvfvbsqxzkqzhtjkybvikmpexipoddmoulsnzfchusfgkdazecevrpuakfioamyyqyribcnydfxmmzsxcpkydyczmeajaebsaskneaqwxjbpjptiwgiizoxfygnbjojpifpzldsdhrukdbwpzribxgafunywmmcfpjugozduylotsugqocbadhcnxjqlugncbebwsbobhxgghyyphxfqqnpliazusgjswynfotwdonpbkllfdbuoqceirksegypasuuxnrjumrkaryhkgkbdfgoqbdmrdrmpvwitqzswgossxltimkbtrxitnmigcxgfaqmrnv', NULL, NULL, '2008-01-09');
235 --enable_warnings
236 #
237 eval create $wl6737_temp table t12 (t text, c char(10), b blob, d varbinary(10)) engine=innodb;
238 insert into t12 values (NULL, NULL, NULL,NULL);
239 insert into t12 values ("", "", "", "");
240 insert into t12 values ("hello", "hello", "hello", "hello");
241 insert into t12 values ("HELLO", "HELLO","HELLO", "HELLO");
242 insert into t12 values ("HELLO MY", "HELLO MY", "HELLO MY", "HELLO MY");
243 insert into t12 values ("a", "a", "a", "a");
244 insert into t12 values (1,1,1,1);
245 insert into t12 values (NULL,NULL,NULL,NULL);
246 #
247 #
248 eval create $wl6737_temp table t13 (
249 pk int(11) not null auto_increment,
250 col_int_nokey int(11) default null,
251 col_int_key int(11) default null,
252 col_date_key date default null,
253 col_time_key time default null,
254 col_varchar_key varchar(1) default null,
255 col_varchar_nokey varchar(1) default null,
256 primary key (pk),
257 key col_int_key (col_int_key),
258 key col_date_key (col_date_key),
259 key col_time_key (col_time_key),
260 key col_varchar_key (col_varchar_key, col_int_key)
261 ) engine=myisam auto_increment=21;
262 #
263 insert into t13 values
264 (2, 150, 62, '2005-03-27', '14:26:02', 'v', 'v'),
265 (3, NULL, 7, '2004-04-09', '14:03:03', 'c', 'c'),
266 (4, 2, 1, '2006-05-13', '01:46:09', NULL, NULL),
267 (5, 5, 0, '2001-05-06', '16:21:18', 'x', 'x'),
268 (6, 3, 7, '2006-03-03', '18:56:33', 'i', 'i'),
269 (7, 1, 7, '2007-12-28', NULL, 'e', 'e'),
270 (8, 4, 1, '2004-10-20', '09:29:08', 'p', 'p'),
271 (9, NULL, 7, '2008-04-09', '19:11:10', 's', 's'),
272 (10, 2, 1, '2005-12-25', '11:57:26', 'j', 'j'),
273 (11, 6, 5, '1900-01-01', '00:39:46', 'z', 'z'),
274 (12, 6, 2, NULL, '03:28:15', 'c', 'c'),
275 (13, 8, 0, '1900-01-01', '06:44:18', 'a', 'a'),
276 (14, 2, 1, '2001-01-16', '14:36:39', 'q', 'q'),
277 (15, 6, 8, '1900-01-01', '18:42:45', 'y', 'y'),
278 (16, 8, 1, '2001-11-23', '02:57:29', NULL, NULL),
279 (17, 3, 1, '2004-11-04', '16:46:13', 'r', 'r'),
280 (18, 3, 9, '2003-03-12', '19:39:02', 'v', 'v'),
281 (19, 9, 1, '2002-06-22', NULL, NULL, NULL),
282 (20, 6, 5, '2004-10-10', '20:58:33', 'r', 'r');
283 #
284 #
285 eval create $wl6737_temp table t14 (
286 pk int(11) not null auto_increment,
287 col_int_nokey int(11) default null,
288 col_int_key int(11) default null,
289 col_date_key date default null,
290 col_time_key time default null,
291 col_varchar_key varchar(1) default null,
292 col_varchar_nokey varchar(1) default null,
293 primary key (pk),
294 key col_int_key (col_int_key),
295 key col_date_key (col_date_key),
296 key col_time_key (col_time_key),
297 key col_varchar_key (col_varchar_key,col_int_key)
298 ) ENGINE=myisam auto_increment=30;
299 #
300 insert into t14 values
301 (10, NULL, 8, '2000-12-03', '22:55:23', 'x', 'x'),
302 (11, 8, 7, '2008-05-03', '10:19:31', 'd', 'd'),
303 (12, 1, 1, '2005-12-06', '14:40:36', 'r', 'r'),
304 (13, 9, 7, '2000-04-10', '04:37:47', 'f', 'f'),
305 (14, 4, 9, '2002-11-05', '19:34:06', 'y', 'y'),
306 (15, 3, NULL, '2000-09-06', '20:35:33', 'u', 'u'),
307 (16, 2, 1, NULL, NULL, 'm', 'm'),
308 (17, NULL, 9, '2007-06-14', '14:43:37', NULL, NULL),
309 (18, 2, 2, '2007-11-17', '02:23:09', 'o', 'o'),
310 (19, NULL, 9, '2009-02-23', '01:22:45', 'w', 'w'),
311 (20, 6, 2, '2007-01-08', '00:00:00', 'm', 'm'),
312 (21, 7, 4, '2008-06-10', '00:13:25', 'q', 'q'),
313 (22, 2, 0, '2002-10-20', '03:47:16', NULL, NULL),
314 (23, 5, 4, '2008-09-12', '01:41:48', 'd', 'd'),
315 (24, 7, 8, '2006-06-16', '00:00:00', 'g', 'g'),
316 (25, 6, NULL, '2004-09-18', '22:32:04', 'x', 'x'),
317 (26, 6, NULL, '1900-01-01', '16:44:14', 'f', 'f'),
318 (27, 2, 0, '2005-09-13', '17:38:37', 'p', 'p'),
319 (28, 9, NULL, '2007-04-09', '08:46:48', 'j', 'j'),
320 (29, 6, 8, '2000-09-20', '14:11:27', 'c', 'c');
321
322 #
323 # to make stats consistent
324 analyze table t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14;
325