~vadim-tk/percona-server/percona-galera-5.1.57-0.8.1

« back to all changes in this revision

Viewing changes to mysql-test/r/partition_order.result

  • Committer: root
  • Date: 2011-07-28 00:14:23 UTC
  • Revision ID: root@r815.office.percona.com-20110728001423-6pw0v4b7r0dkbsr4
Ported to Galera 0.8.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
drop table if exists t1;
 
2
CREATE TABLE t1 (
 
3
a int not null,
 
4
b int not null,
 
5
primary key(a),
 
6
index (b))
 
7
partition by range (a)
 
8
partitions 2
 
9
(partition x1 values less than (25),
 
10
partition x2 values less than (100));
 
11
INSERT into t1 values (1, 1);
 
12
INSERT into t1 values (2, 5);
 
13
INSERT into t1 values (30, 4);
 
14
INSERT into t1 values (35, 2);
 
15
select * from t1 order by b;
 
16
a       b
 
17
1       1
 
18
35      2
 
19
30      4
 
20
2       5
 
21
select * from t1 force index (b) where b > 0 order by b;
 
22
a       b
 
23
1       1
 
24
35      2
 
25
30      4
 
26
2       5
 
27
drop table t1;
 
28
CREATE TABLE t1 (
 
29
a int not null,
 
30
b int unsigned not null,
 
31
primary key(a),
 
32
index (b))
 
33
partition by range (a)
 
34
partitions 2
 
35
(partition x1 values less than (25),
 
36
partition x2 values less than (100));
 
37
INSERT into t1 values (1, 1);
 
38
INSERT into t1 values (2, 5);
 
39
INSERT into t1 values (30, 4);
 
40
INSERT into t1 values (35, 2);
 
41
select * from t1 force index (b) where b > 0 order by b;
 
42
a       b
 
43
1       1
 
44
35      2
 
45
30      4
 
46
2       5
 
47
drop table t1;
 
48
CREATE TABLE t1 (
 
49
a int not null,
 
50
b tinyint not null,
 
51
primary key(a),
 
52
index (b))
 
53
partition by range (a)
 
54
partitions 2
 
55
(partition x1 values less than (25),
 
56
partition x2 values less than (100));
 
57
INSERT into t1 values (1, 1);
 
58
INSERT into t1 values (2, 5);
 
59
INSERT into t1 values (30, 4);
 
60
INSERT into t1 values (35, 2);
 
61
select * from t1 force index (b) where b > 0 order by b;
 
62
a       b
 
63
1       1
 
64
35      2
 
65
30      4
 
66
2       5
 
67
drop table t1;
 
68
CREATE TABLE t1 (
 
69
a int not null,
 
70
b tinyint unsigned not null,
 
71
primary key(a),
 
72
index (b))
 
73
partition by range (a)
 
74
partitions 2
 
75
(partition x1 values less than (25),
 
76
partition x2 values less than (100));
 
77
INSERT into t1 values (1, 1);
 
78
INSERT into t1 values (2, 5);
 
79
INSERT into t1 values (30, 4);
 
80
INSERT into t1 values (35, 2);
 
81
select * from t1 force index (b) where b > 0 order by b;
 
82
a       b
 
83
1       1
 
84
35      2
 
85
30      4
 
86
2       5
 
87
drop table t1;
 
88
CREATE TABLE t1 (
 
89
a int not null,
 
90
b smallint not null,
 
91
primary key(a),
 
92
index (b))
 
93
partition by range (a)
 
94
partitions 2
 
95
(partition x1 values less than (25),
 
96
partition x2 values less than (100));
 
97
INSERT into t1 values (1, 1);
 
98
INSERT into t1 values (2, 5);
 
99
INSERT into t1 values (30, 4);
 
100
INSERT into t1 values (35, 2);
 
101
select * from t1 force index (b) where b > 0 order by b;
 
102
a       b
 
103
1       1
 
104
35      2
 
105
30      4
 
106
2       5
 
107
drop table t1;
 
108
CREATE TABLE t1 (
 
109
a int not null,
 
110
b smallint unsigned not null,
 
111
primary key(a),
 
112
index (b))
 
113
partition by range (a)
 
114
partitions 2
 
115
(partition x1 values less than (25),
 
116
partition x2 values less than (100));
 
117
INSERT into t1 values (1, 1);
 
118
INSERT into t1 values (2, 5);
 
119
INSERT into t1 values (30, 4);
 
120
INSERT into t1 values (35, 2);
 
121
select * from t1 force index (b) where b > 0 order by b;
 
122
a       b
 
123
1       1
 
124
35      2
 
125
30      4
 
126
2       5
 
127
drop table t1;
 
128
CREATE TABLE t1 (
 
129
a int not null,
 
130
b mediumint not null,
 
131
primary key(a),
 
132
index (b))
 
133
partition by range (a)
 
134
partitions 2
 
135
(partition x1 values less than (25),
 
136
partition x2 values less than (100));
 
137
INSERT into t1 values (1, 1);
 
138
INSERT into t1 values (2, 5);
 
139
INSERT into t1 values (30, 4);
 
140
INSERT into t1 values (35, 2);
 
141
select * from t1 force index (b) where b > 0 order by b;
 
142
a       b
 
143
1       1
 
144
35      2
 
145
30      4
 
146
2       5
 
147
drop table t1;
 
148
CREATE TABLE t1 (
 
149
a int not null,
 
150
b mediumint unsigned not null,
 
151
primary key(a),
 
152
index (b))
 
153
partition by range (a)
 
154
partitions 2
 
155
(partition x1 values less than (25),
 
156
partition x2 values less than (100));
 
157
INSERT into t1 values (1, 1);
 
158
INSERT into t1 values (2, 5);
 
159
INSERT into t1 values (30, 4);
 
160
INSERT into t1 values (35, 2);
 
161
select * from t1 force index (b) where b > 0 order by b;
 
162
a       b
 
163
1       1
 
164
35      2
 
165
30      4
 
166
2       5
 
167
drop table t1;
 
168
CREATE TABLE t1 (
 
169
a int not null,
 
170
b bigint unsigned not null,
 
171
primary key(a),
 
172
index (b))
 
173
partition by range (a)
 
174
partitions 2
 
175
(partition x1 values less than (25),
 
176
partition x2 values less than (100));
 
177
INSERT into t1 values (1, 1);
 
178
INSERT into t1 values (2, 5);
 
179
INSERT into t1 values (30, 4);
 
180
INSERT into t1 values (35, 2);
 
181
select * from t1 force index (b) where b > 0 order by b;
 
182
a       b
 
183
1       1
 
184
35      2
 
185
30      4
 
186
2       5
 
187
drop table t1;
 
188
CREATE TABLE t1 (
 
189
a int not null,
 
190
b bigint not null,
 
191
primary key(a),
 
192
index (b))
 
193
partition by range (a)
 
194
partitions 2
 
195
(partition x1 values less than (25),
 
196
partition x2 values less than (100));
 
197
INSERT into t1 values (1, 1);
 
198
INSERT into t1 values (2, 5);
 
199
INSERT into t1 values (30, 4);
 
200
INSERT into t1 values (35, 2);
 
201
select * from t1 force index (b) where b > 0 order by b;
 
202
a       b
 
203
1       1
 
204
35      2
 
205
30      4
 
206
2       5
 
207
drop table t1;
 
208
CREATE TABLE t1 (
 
209
a int not null,
 
210
b bigint not null,
 
211
primary key(a),
 
212
index (b))
 
213
partition by range (a)
 
214
partitions 2
 
215
(partition x1 values less than (25),
 
216
partition x2 values less than (100));
 
217
INSERT into t1 values (1, 1);
 
218
INSERT into t1 values (2, 5);
 
219
INSERT into t1 values (30, 4);
 
220
INSERT into t1 values (35, 2);
 
221
select * from t1 force index (b) where b > 0 order by b;
 
222
a       b
 
223
1       1
 
224
35      2
 
225
30      4
 
226
2       5
 
227
drop table t1;
 
228
CREATE TABLE t1 (
 
229
a int not null,
 
230
b float not null,
 
231
primary key(a),
 
232
index (b))
 
233
partition by range (a)
 
234
partitions 2
 
235
(partition x1 values less than (25),
 
236
partition x2 values less than (100));
 
237
INSERT into t1 values (1, 1);
 
238
INSERT into t1 values (2, 5);
 
239
INSERT into t1 values (30, 4);
 
240
INSERT into t1 values (35, 2);
 
241
select * from t1 force index (b) where b > 0 order by b;
 
242
a       b
 
243
1       1
 
244
35      2
 
245
30      4
 
246
2       5
 
247
drop table t1;
 
248
CREATE TABLE t1 (
 
249
a int not null,
 
250
b double not null,
 
251
primary key(a),
 
252
index (b))
 
253
partition by range (a)
 
254
partitions 2
 
255
(partition x1 values less than (25),
 
256
partition x2 values less than (100));
 
257
INSERT into t1 values (1, 1);
 
258
INSERT into t1 values (2, 5);
 
259
INSERT into t1 values (30, 4);
 
260
INSERT into t1 values (35, 2);
 
261
select * from t1 force index (b) where b > 0 order by b;
 
262
a       b
 
263
1       1
 
264
35      2
 
265
30      4
 
266
2       5
 
267
drop table t1;
 
268
CREATE TABLE t1 (
 
269
a int not null,
 
270
b double unsigned not null,
 
271
primary key(a),
 
272
index (b))
 
273
partition by range (a)
 
274
partitions 2
 
275
(partition x1 values less than (25),
 
276
partition x2 values less than (100));
 
277
INSERT into t1 values (1, 1);
 
278
INSERT into t1 values (2, 5);
 
279
INSERT into t1 values (30, 4);
 
280
INSERT into t1 values (35, 2);
 
281
select * from t1 force index (b) where b > 0 order by b;
 
282
a       b
 
283
1       1
 
284
35      2
 
285
30      4
 
286
2       5
 
287
drop table t1;
 
288
CREATE TABLE t1 (
 
289
a int not null,
 
290
b float unsigned not null,
 
291
primary key(a),
 
292
index (b))
 
293
partition by range (a)
 
294
partitions 2
 
295
(partition x1 values less than (25),
 
296
partition x2 values less than (100));
 
297
INSERT into t1 values (1, 1);
 
298
INSERT into t1 values (2, 5);
 
299
INSERT into t1 values (30, 4);
 
300
INSERT into t1 values (35, 2);
 
301
select * from t1 force index (b) where b > 0 order by b;
 
302
a       b
 
303
1       1
 
304
35      2
 
305
30      4
 
306
2       5
 
307
drop table t1;
 
308
CREATE TABLE t1 (
 
309
a int not null,
 
310
b double precision not null,
 
311
primary key(a),
 
312
index (b))
 
313
partition by range (a)
 
314
partitions 2
 
315
(partition x1 values less than (25),
 
316
partition x2 values less than (100));
 
317
INSERT into t1 values (1, 1);
 
318
INSERT into t1 values (2, 5);
 
319
INSERT into t1 values (30, 4);
 
320
INSERT into t1 values (35, 2);
 
321
select * from t1 force index (b) where b > 0 order by b;
 
322
a       b
 
323
1       1
 
324
35      2
 
325
30      4
 
326
2       5
 
327
drop table t1;
 
328
CREATE TABLE t1 (
 
329
a int not null,
 
330
b double precision unsigned not null,
 
331
primary key(a),
 
332
index (b))
 
333
partition by range (a)
 
334
partitions 2
 
335
(partition x1 values less than (25),
 
336
partition x2 values less than (100));
 
337
INSERT into t1 values (1, 1);
 
338
INSERT into t1 values (2, 5);
 
339
INSERT into t1 values (30, 4);
 
340
INSERT into t1 values (35, 2);
 
341
select * from t1 force index (b) where b > 0 order by b;
 
342
a       b
 
343
1       1
 
344
35      2
 
345
30      4
 
346
2       5
 
347
drop table t1;
 
348
CREATE TABLE t1 (
 
349
a int not null,
 
350
b decimal not null,
 
351
primary key(a),
 
352
index (b))
 
353
partition by range (a)
 
354
partitions 2
 
355
(partition x1 values less than (25),
 
356
partition x2 values less than (100));
 
357
INSERT into t1 values (1, 1);
 
358
INSERT into t1 values (2, 5);
 
359
INSERT into t1 values (30, 4);
 
360
INSERT into t1 values (35, 2);
 
361
select * from t1 force index (b) where b > 0 order by b;
 
362
a       b
 
363
1       1
 
364
35      2
 
365
30      4
 
366
2       5
 
367
drop table t1;
 
368
CREATE TABLE t1 (
 
369
a int not null,
 
370
b char(10) not null,
 
371
primary key(a),
 
372
index (b))
 
373
partition by range (a)
 
374
partitions 2
 
375
(partition x1 values less than (25),
 
376
partition x2 values less than (100));
 
377
INSERT into t1 values (1, '1');
 
378
INSERT into t1 values (2, '5');
 
379
INSERT into t1 values (30, '4');
 
380
INSERT into t1 values (35, '2');
 
381
select * from t1 force index (b) where b > 0 order by b;
 
382
a       b
 
383
1       1
 
384
35      2
 
385
30      4
 
386
2       5
 
387
drop table t1;
 
388
CREATE TABLE t1 (
 
389
a int not null,
 
390
b varchar(10) not null,
 
391
primary key(a),
 
392
index (b))
 
393
partition by range (a)
 
394
partitions 2
 
395
(partition x1 values less than (25),
 
396
partition x2 values less than (100));
 
397
INSERT into t1 values (1, '1');
 
398
INSERT into t1 values (2, '5');
 
399
INSERT into t1 values (30, '4');
 
400
INSERT into t1 values (35, '2');
 
401
select * from t1 force index (b) where b > '0' order by b;
 
402
a       b
 
403
1       1
 
404
35      2
 
405
30      4
 
406
2       5
 
407
drop table t1;
 
408
CREATE TABLE t1 (
 
409
a int not null,
 
410
b varchar(10) not null,
 
411
primary key(a),
 
412
index (b(5)))
 
413
partition by range (a)
 
414
partitions 2
 
415
(partition x1 values less than (25),
 
416
partition x2 values less than (100));
 
417
INSERT into t1 values (1, '1');
 
418
INSERT into t1 values (2, '5');
 
419
INSERT into t1 values (30, '4');
 
420
INSERT into t1 values (35, '2');
 
421
select * from t1 force index (b) where b > '0' order by b;
 
422
a       b
 
423
1       1
 
424
35      2
 
425
30      4
 
426
2       5
 
427
drop table t1;
 
428
CREATE TABLE t1 (
 
429
a int not null,
 
430
b varchar(10) binary not null,
 
431
primary key(a),
 
432
index (b))
 
433
partition by range (a)
 
434
partitions 2
 
435
(partition x1 values less than (25),
 
436
partition x2 values less than (100));
 
437
INSERT into t1 values (1, '1');
 
438
INSERT into t1 values (2, '5');
 
439
INSERT into t1 values (30, '4');
 
440
INSERT into t1 values (35, '2');
 
441
select * from t1 force index (b) where b > '0' order by b;
 
442
a       b
 
443
1       1
 
444
35      2
 
445
30      4
 
446
2       5
 
447
drop table t1;
 
448
CREATE TABLE t1 (
 
449
a int not null,
 
450
b tinytext not null,
 
451
primary key(a),
 
452
index (b(10)))
 
453
partition by range (a)
 
454
partitions 2
 
455
(partition x1 values less than (25),
 
456
partition x2 values less than (100));
 
457
INSERT into t1 values (1, '1');
 
458
INSERT into t1 values (2, '5');
 
459
INSERT into t1 values (30, '4');
 
460
INSERT into t1 values (35, '2');
 
461
select * from t1 force index (b) where b > '0' order by b;
 
462
a       b
 
463
1       1
 
464
35      2
 
465
30      4
 
466
2       5
 
467
drop table t1;
 
468
CREATE TABLE t1 (
 
469
a int not null,
 
470
b text not null,
 
471
primary key(a),
 
472
index (b(10)))
 
473
partition by range (a)
 
474
partitions 2
 
475
(partition x1 values less than (25),
 
476
partition x2 values less than (100));
 
477
INSERT into t1 values (1, '1');
 
478
INSERT into t1 values (2, '5');
 
479
INSERT into t1 values (30, '4');
 
480
INSERT into t1 values (35, '2');
 
481
select * from t1 force index (b) where b > '0' order by b;
 
482
a       b
 
483
1       1
 
484
35      2
 
485
30      4
 
486
2       5
 
487
drop table t1;
 
488
CREATE TABLE t1 (
 
489
a int not null,
 
490
b mediumtext not null,
 
491
primary key(a),
 
492
index (b(10)))
 
493
partition by range (a)
 
494
partitions 2
 
495
(partition x1 values less than (25),
 
496
partition x2 values less than (100));
 
497
INSERT into t1 values (1, '1');
 
498
INSERT into t1 values (2, '5');
 
499
INSERT into t1 values (30, '4');
 
500
INSERT into t1 values (35, '2');
 
501
select * from t1 force index (b) where b > '0' order by b;
 
502
a       b
 
503
1       1
 
504
35      2
 
505
30      4
 
506
2       5
 
507
drop table t1;
 
508
CREATE TABLE t1 (
 
509
a int not null,
 
510
b longtext not null,
 
511
primary key(a),
 
512
index (b(10)))
 
513
partition by range (a)
 
514
partitions 2
 
515
(partition x1 values less than (25),
 
516
partition x2 values less than (100));
 
517
INSERT into t1 values (1, '1');
 
518
INSERT into t1 values (2, '5');
 
519
INSERT into t1 values (30, '4');
 
520
INSERT into t1 values (35, '2');
 
521
select * from t1 force index (b) where b > '0' order by b;
 
522
a       b
 
523
1       1
 
524
35      2
 
525
30      4
 
526
2       5
 
527
drop table t1;
 
528
CREATE TABLE t1 (
 
529
a int not null,
 
530
b enum('1','2', '4', '5') not null,
 
531
primary key(a),
 
532
index (b))
 
533
partition by range (a)
 
534
partitions 2
 
535
(partition x1 values less than (25),
 
536
partition x2 values less than (100));
 
537
INSERT into t1 values (1, '1');
 
538
INSERT into t1 values (2, '5');
 
539
INSERT into t1 values (30, '4');
 
540
INSERT into t1 values (35, '2');
 
541
select * from t1 force index (b) where b >= '1' order by b;
 
542
a       b
 
543
1       1
 
544
35      2
 
545
30      4
 
546
2       5
 
547
drop table t1;
 
548
CREATE TABLE t1 (
 
549
a int not null,
 
550
b set('1','2', '4', '5') not null,
 
551
primary key(a),
 
552
index (b))
 
553
partition by range (a)
 
554
partitions 2
 
555
(partition x1 values less than (25),
 
556
partition x2 values less than (100));
 
557
INSERT into t1 values (1, '1');
 
558
INSERT into t1 values (2, '5');
 
559
INSERT into t1 values (30, '4');
 
560
INSERT into t1 values (35, '2');
 
561
select * from t1 force index (b) where b >= '1' order by b;
 
562
a       b
 
563
1       1
 
564
35      2
 
565
30      4
 
566
2       5
 
567
drop table t1;
 
568
CREATE TABLE t1 (
 
569
a int not null,
 
570
b date not null,
 
571
primary key(a),
 
572
index (b))
 
573
partition by range (a)
 
574
partitions 2
 
575
(partition x1 values less than (25),
 
576
partition x2 values less than (100));
 
577
INSERT into t1 values (1, '2001-01-01');
 
578
INSERT into t1 values (2, '2005-01-01');
 
579
INSERT into t1 values (30, '2004-01-01');
 
580
INSERT into t1 values (35, '2002-01-01');
 
581
select * from t1 force index (b) where b > '2000-01-01' order by b;
 
582
a       b
 
583
1       2001-01-01
 
584
35      2002-01-01
 
585
30      2004-01-01
 
586
2       2005-01-01
 
587
drop table t1;
 
588
CREATE TABLE t1 (
 
589
a int not null,
 
590
b datetime not null,
 
591
primary key(a),
 
592
index (b))
 
593
partition by range (a)
 
594
partitions 2
 
595
(partition x1 values less than (25),
 
596
partition x2 values less than (100));
 
597
INSERT into t1 values (1, '2001-01-01 00:00:00');
 
598
INSERT into t1 values (2, '2005-01-01 00:00:00');
 
599
INSERT into t1 values (30, '2004-01-01 00:00:00');
 
600
INSERT into t1 values (35, '2002-01-01 00:00:00');
 
601
select * from t1 force index (b) where b > '2000-01-01 00:00:00' order by b;
 
602
a       b
 
603
1       2001-01-01 00:00:00
 
604
35      2002-01-01 00:00:00
 
605
30      2004-01-01 00:00:00
 
606
2       2005-01-01 00:00:00
 
607
drop table t1;
 
608
CREATE TABLE t1 (
 
609
a int not null,
 
610
b timestamp not null,
 
611
primary key(a),
 
612
index (b))
 
613
partition by range (a)
 
614
partitions 2
 
615
(partition x1 values less than (25),
 
616
partition x2 values less than (100));
 
617
INSERT into t1 values (1, '2001-01-01 00:00:00');
 
618
INSERT into t1 values (2, '2005-01-01 00:00:00');
 
619
INSERT into t1 values (30, '2004-01-01 00:00:00');
 
620
INSERT into t1 values (35, '2002-01-01 00:00:00');
 
621
select * from t1 force index (b) where b > '2000-01-01 00:00:00' order by b;
 
622
a       b
 
623
1       2001-01-01 00:00:00
 
624
35      2002-01-01 00:00:00
 
625
30      2004-01-01 00:00:00
 
626
2       2005-01-01 00:00:00
 
627
drop table t1;
 
628
CREATE TABLE t1 (
 
629
a int not null,
 
630
b time not null,
 
631
primary key(a),
 
632
index (b))
 
633
partition by range (a)
 
634
partitions 2
 
635
(partition x1 values less than (25),
 
636
partition x2 values less than (100));
 
637
INSERT into t1 values (1, '01:00:00');
 
638
INSERT into t1 values (2, '05:00:00');
 
639
INSERT into t1 values (30, '04:00:00');
 
640
INSERT into t1 values (35, '02:00:00');
 
641
select * from t1 force index (b) where b > '00:00:00' order by b;
 
642
a       b
 
643
1       01:00:00
 
644
35      02:00:00
 
645
30      04:00:00
 
646
2       05:00:00
 
647
drop table t1;
 
648
CREATE TABLE t1 (
 
649
a int not null,
 
650
b year not null,
 
651
primary key(a),
 
652
index (b))
 
653
partition by range (a)
 
654
partitions 2
 
655
(partition x1 values less than (25),
 
656
partition x2 values less than (100));
 
657
INSERT into t1 values (1, 2001);
 
658
INSERT into t1 values (2, 2005);
 
659
INSERT into t1 values (30, 2004);
 
660
INSERT into t1 values (35, 2002);
 
661
select * from t1 force index (b) where b > 2000 order by b;
 
662
a       b
 
663
1       2001
 
664
35      2002
 
665
30      2004
 
666
2       2005
 
667
drop table t1;
 
668
CREATE TABLE t1 (
 
669
a int not null,
 
670
b bit(5) not null,
 
671
c int,
 
672
primary key(a),
 
673
index (b))
 
674
partition by range (a)
 
675
partitions 2
 
676
(partition x1 values less than (25),
 
677
partition x2 values less than (100));
 
678
INSERT into t1 values (1, b'00001', NULL);
 
679
INSERT into t1 values (2, b'00101', 2);
 
680
INSERT into t1 values (30, b'00100', 2);
 
681
INSERT into t1 values (35, b'00010', NULL);
 
682
select a from t1 force index (b) where b > b'00000' order by b;
 
683
a
 
684
1
 
685
35
 
686
30
 
687
2
 
688
drop table t1;
 
689
CREATE TABLE t1 (
 
690
a int not null,
 
691
b bit(15) not null,
 
692
c int,
 
693
primary key(a),
 
694
index (b))
 
695
partition by range (a)
 
696
partitions 2
 
697
(partition x1 values less than (25),
 
698
partition x2 values less than (100));
 
699
INSERT into t1 values (1,  b'000000000000001', NULL);
 
700
INSERT into t1 values (2,  b'001010000000101', 2);
 
701
INSERT into t1 values (30, b'001000000000100', 2);
 
702
INSERT into t1 values (35, b'000100000000010', NULL);
 
703
select a from t1 force index (b) where b > b'000000000000000' order by b;
 
704
a
 
705
1
 
706
35
 
707
30
 
708
2
 
709
drop table t1;
 
710
CREATE TABLE t1 (
 
711
a int not null,
 
712
b int,
 
713
primary key(a),
 
714
index (b))
 
715
partition by range (a)
 
716
partitions 2
 
717
(partition x1 values less than (25),
 
718
partition x2 values less than (100));
 
719
INSERT into t1 values (1, 1);
 
720
INSERT into t1 values (5, NULL);
 
721
INSERT into t1 values (2, 4);
 
722
INSERT into t1 values (3, 3);
 
723
INSERT into t1 values (4, 5);
 
724
INSERT into t1 values (7, 1);
 
725
INSERT into t1 values (6, 6);
 
726
INSERT into t1 values (30, 4);
 
727
INSERT into t1 values (35, 2);
 
728
INSERT into t1 values (40, NULL);
 
729
select * from t1 force index (b) where b < 10 OR b IS NULL order by b;
 
730
a       b
 
731
5       NULL
 
732
40      NULL
 
733
1       1
 
734
7       1
 
735
35      2
 
736
3       3
 
737
2       4
 
738
30      4
 
739
4       5
 
740
6       6
 
741
select * from t1 force index (b) where b < 10 ORDER BY b;
 
742
a       b
 
743
1       1
 
744
7       1
 
745
35      2
 
746
3       3
 
747
2       4
 
748
30      4
 
749
4       5
 
750
6       6
 
751
select * from t1 force index (b) where b < 10 ORDER BY b DESC;
 
752
a       b
 
753
6       6
 
754
4       5
 
755
2       4
 
756
30      4
 
757
3       3
 
758
35      2
 
759
7       1
 
760
1       1
 
761
drop table t1;
 
762
create table t1 (a int not null, b int, c varchar(20), key (a,b,c))
 
763
partition by range (b)
 
764
(partition p0 values less than (5),
 
765
partition p1 values less than (10));
 
766
INSERT into t1 values (1,1,'1'),(2,2,'2'),(1,3,'3'),(2,4,'4'),(1,5,'5');
 
767
INSERT into t1 values (2,6,'6'),(1,7,'7'),(2,8,'8'),(1,9,'9');
 
768
INSERT into t1 values (1, NULL, NULL), (2, NULL, '10');
 
769
select * from t1 where a = 1 order by a desc, b desc;
 
770
a       b       c
 
771
1       9       9
 
772
1       7       7
 
773
1       5       5
 
774
1       3       3
 
775
1       1       1
 
776
1       NULL    NULL
 
777
select * from t1 where a = 1 order by b desc;
 
778
a       b       c
 
779
1       9       9
 
780
1       7       7
 
781
1       5       5
 
782
1       3       3
 
783
1       1       1
 
784
1       NULL    NULL
 
785
drop table t1;