540
540
# part2: bug in pruning code
541
create table t1 (a char(10) binary)
542
partition by list(length(a))
543
(partition p1 values in (1),
544
partition p2 values in (2),
545
partition p3 values in (3),
546
partition p4 values in (4),
547
partition p5 values in (5)
549
insert into t1 values ('a'),('bb'),('ccc'),('dddd'),('eeEee');
550
select * from t1 where a>='a' and a <= 'dddd';
551
explain partitions select * from t1 where a>='a' and a <= 'dddd';
541
#create table t1 (a char(10) binary)
542
#partition by list(ascii(a))
543
# (partition p1 values in (ascii('a')),
544
# partition p2 values in (ascii('b')),
545
# partition p3 values in (ascii('c')),
546
# partition p4 values in (ascii('d')),
547
# partition p5 values in (ascii('e')));
548
#insert into t1 values ('a'),('bb'),('ccc'),('dddd'),('eeEee');
549
#select * from t1 where a>='a' and a <= 'dddd';
550
#explain partitions select * from t1 where a>='a' and a <= 'dddd';
554
553
# BUG#18659: Assertion failure when subpartitioning is used and partition is
692
691
explain partitions select * from t1 where a = 18446744073709551613;
693
692
explain partitions select * from t1 where a = 18446744073709551614;
696
create table t1 (a int)
697
partition by range((a & 0xFF) << 56) (
698
partition p0 values less than (0x40 << 56),
699
partition p1 values less than (0x80 << 56),
700
partition p2 values less than (0xFF << 56)
703
insert into t1 values (0x20), (0x20), (0x41), (0x41), (0xFE), (0xFE);
695
# Test all variants of usage for interval_via_mapping
696
# and interval_via_walking
698
# t1 will use interval_via_mapping since it uses a
699
# monotonic function, whereas t2 will use
700
# interval_via_walking since the intervals are short
701
# and the function isn't monotonic (it is, but it isn't
702
# discovered in this version).
704
create table t1 (a int)
705
partition by range(a) (
706
partition p0 values less than (64),
707
partition p1 values less than (128),
708
partition p2 values less than (255)
711
create table t2 (a int)
712
partition by range(a+0) (
713
partition p0 values less than (64),
714
partition p1 values less than (128),
715
partition p2 values less than (255)
718
insert into t1 values (0x20), (0x20), (0x41), (0x41), (0xFE), (0xFE);
719
insert into t2 values (0x20), (0x20), (0x41), (0x41), (0xFE), (0xFE);
704
720
explain partitions select * from t1 where a=0;
721
explain partitions select * from t2 where a=0;
705
722
explain partitions select * from t1 where a=0xFE;
706
explain partitions select * from t1 where a>0xFE and a<= 0xFF;
723
explain partitions select * from t2 where a=0xFE;
724
explain partitions select * from t1 where a > 0xFE AND a <= 0xFF;
725
explain partitions select * from t2 where a > 0xFE AND a <= 0xFF;
726
explain partitions select * from t1 where a >= 0xFE AND a <= 0xFF;
727
explain partitions select * from t2 where a >= 0xFE AND a <= 0xFF;
728
explain partitions select * from t1 where a < 64 AND a >= 63;
729
explain partitions select * from t2 where a < 64 AND a >= 63;
730
explain partitions select * from t1 where a <= 64 AND a >= 63;
731
explain partitions select * from t2 where a <= 64 AND a >= 63;
709
735
create table t1(a bigint unsigned not null) partition by range(a+0) (
710
736
partition p1 values less than (10),
711
737
partition p2 values less than (20),