25
25
00000000-0000-0000-0000-0000000000ff
26
26
EXPLAIN SELECT * FROM t1 WHERE a='00000000-0000-0000-0000-0000000000ff';
27
27
id select_type table type possible_keys key key_len ref rows Extra
28
- 1 SIMPLE t1 ref a a 17 const 2 Using where
28
+ 1 SIMPLE t1 ref a a 17 const 4 Using where
29
29
SELECT * FROM t1 WHERE a='garbage';
30
30
a
31
31
Warnings:
@@ -66,7 +66,7 @@ EXPLAIN SELECT * FROM t1 WHERE a IN
66
66
'00000000-0000-0000-0000-0000000000f0'
67
67
);
68
68
id select_type table type possible_keys key key_len ref rows Extra
69
- 1 SIMPLE t1 range a a 17 NULL 6 Using where
69
+ 1 SIMPLE t1 range a a 17 NULL 12 Using where
70
70
SELECT * FROM t1 WHERE a IN
71
71
(
72
72
'00000000-0000-0000-0000-000000000080',
@@ -85,7 +85,7 @@ EXPLAIN SELECT * FROM t1 WHERE a IN
85
85
'garbage'
86
86
);
87
87
id select_type table type possible_keys key key_len ref rows Extra
88
- 1 SIMPLE t1 range a a 17 NULL 4 Using where
88
+ 1 SIMPLE t1 range a a 17 NULL 8 Using where
89
89
Warnings:
90
90
Warning 1292 Incorrect uuid value: 'garbage'
91
91
SELECT * FROM t1 WHERE a BETWEEN
178
178
00000000-0000-0000-0000-0000000000ff
179
179
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=CAST('00000000-0000-0000-0000-0000000000ff' AS UUID);
180
180
id select_type table type possible_keys key key_len ref rows filtered Extra
181
- 1 SIMPLE t1 ref a a 17 const 2 100.00 Using where
181
+ 1 SIMPLE t1 ref a a 17 const 4 100.00 Using where
182
182
Warnings:
183
183
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = UUID'00000000-0000-0000-0000-0000000000ff'
184
184
DROP TABLE t1;
185
+ CREATE OR REPLACE TABLE t1 (a UUID,KEY(a));
186
+ SHOW CREATE TABLE t1;
187
+ Table Create Table
188
+ t1 CREATE TABLE `t1` (
189
+ `a` uuid DEFAULT NULL,
190
+ KEY `a` (`a`)
191
+ ) ENGINE=MEMORY DEFAULT CHARSET=latin1
192
+ BEGIN;
193
+ FOR i IN 0..255
194
+ DO
195
+ INSERT INTO t1 VALUES (REPLACE('XX000000-0000-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
196
+ INSERT INTO t1 VALUES (REPLACE('00XX0000-0000-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
197
+ INSERT INTO t1 VALUES (REPLACE('0000XX00-0000-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
198
+ INSERT INTO t1 VALUES (REPLACE('000000XX-0000-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
199
+ INSERT INTO t1 VALUES (REPLACE('00000000-XX00-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
200
+ INSERT INTO t1 VALUES (REPLACE('00000000-00XX-0000-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
201
+ INSERT INTO t1 VALUES (REPLACE('00000000-0000-XX00-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
202
+ INSERT INTO t1 VALUES (REPLACE('00000000-0000-00XX-0000-000000000000','XX',LPAD(HEX(i),2,'0')));
203
+ INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-XX00-000000000000','XX',LPAD(HEX(i),2,'0')));
204
+ INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-00XX-000000000000','XX',LPAD(HEX(i),2,'0')));
205
+ INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-XX0000000000','XX',LPAD(HEX(i),2,'0')));
206
+ INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-00XX00000000','XX',LPAD(HEX(i),2,'0')));
207
+ INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-0000XX000000','XX',LPAD(HEX(i),2,'0')));
208
+ INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-000000XX0000','XX',LPAD(HEX(i),2,'0')));
209
+ INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-00000000XX00','XX',LPAD(HEX(i),2,'0')));
210
+ INSERT INTO t1 VALUES (REPLACE('00000000-0000-0000-0000-0000000000XX','XX',LPAD(HEX(i),2,'0')));
211
+ END FOR;
212
+ $$
213
+ COMMIT;
214
+ EXPLAIN SELECT * FROM t1 WHERE a='ff000000-0000-0000-0000-000000000000';
215
+ id select_type table type possible_keys key key_len ref rows Extra
216
+ 1 SIMPLE t1 ref a a 17 const 2 Using where
217
+ EXPLAIN SELECT * FROM t1 WHERE a='00ff0000-0000-0000-0000-000000000000';
218
+ id select_type table type possible_keys key key_len ref rows Extra
219
+ 1 SIMPLE t1 ref a a 17 const 2 Using where
220
+ EXPLAIN SELECT * FROM t1 WHERE a='0000ff00-0000-0000-0000-000000000000';
221
+ id select_type table type possible_keys key key_len ref rows Extra
222
+ 1 SIMPLE t1 ref a a 17 const 2 Using where
223
+ EXPLAIN SELECT * FROM t1 WHERE a='000000ff-0000-0000-0000-000000000000';
224
+ id select_type table type possible_keys key key_len ref rows Extra
225
+ 1 SIMPLE t1 ref a a 17 const 2 Using where
226
+ EXPLAIN SELECT * FROM t1 WHERE a='00000000-ff00-0000-0000-000000000000';
227
+ id select_type table type possible_keys key key_len ref rows Extra
228
+ 1 SIMPLE t1 ref a a 17 const 2 Using where
229
+ EXPLAIN SELECT * FROM t1 WHERE a='00000000-00ff-0000-0000-000000000000';
230
+ id select_type table type possible_keys key key_len ref rows Extra
231
+ 1 SIMPLE t1 ref a a 17 const 2 Using where
232
+ EXPLAIN SELECT * FROM t1 WHERE a='00000000-0000-ff00-0000-000000000000';
233
+ id select_type table type possible_keys key key_len ref rows Extra
234
+ 1 SIMPLE t1 ref a a 17 const 2 Using where
235
+ EXPLAIN SELECT * FROM t1 WHERE a='00000000-0000-00ff-0000-000000000000';
236
+ id select_type table type possible_keys key key_len ref rows Extra
237
+ 1 SIMPLE t1 ref a a 17 const 2 Using where
238
+ EXPLAIN SELECT * FROM t1 WHERE a='00000000-0000-0000-ff00-000000000000';
239
+ id select_type table type possible_keys key key_len ref rows Extra
240
+ 1 SIMPLE t1 ref a a 17 const 2 Using where
241
+ EXPLAIN SELECT * FROM t1 WHERE a='00000000-0000-0000-00ff-000000000000';
242
+ id select_type table type possible_keys key key_len ref rows Extra
243
+ 1 SIMPLE t1 ref a a 17 const 2 Using where
244
+ EXPLAIN SELECT * FROM t1 WHERE a='00000000-0000-0000-0000-ff0000000000';
245
+ id select_type table type possible_keys key key_len ref rows Extra
246
+ 1 SIMPLE t1 ref a a 17 const 2 Using where
247
+ DROP TABLE t1;
185
248
#
186
249
# End of 10.5 tests
187
250
#
0 commit comments