summaryrefslogtreecommitdiff
path: root/mysql-test/r/partition_innodb.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/r/partition_innodb.result')
-rw-r--r--mysql-test/r/partition_innodb.result71
1 files changed, 70 insertions, 1 deletions
diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result
index f2f6ef138ff..2a04aafe554 100644
--- a/mysql-test/r/partition_innodb.result
+++ b/mysql-test/r/partition_innodb.result
@@ -1,4 +1,73 @@
-drop table if exists t1;
+drop table if exists t1, t2;
+#
+# Bug#51830: Incorrect partition pruning on range partition (regression)
+#
+CREATE TABLE t1 (a INT NOT NULL)
+ENGINE = InnoDB
+PARTITION BY RANGE(a)
+(PARTITION p10 VALUES LESS THAN (10),
+PARTITION p30 VALUES LESS THAN (30),
+PARTITION p50 VALUES LESS THAN (50),
+PARTITION p70 VALUES LESS THAN (70),
+PARTITION p90 VALUES LESS THAN (90));
+INSERT INTO t1 VALUES (10),(30),(50);
+INSERT INTO t1 VALUES (70);
+INSERT INTO t1 VALUES (80);
+INSERT INTO t1 VALUES (89);
+INSERT INTO t1 VALUES (90);
+ERROR HY000: Table has no partition for value 90
+INSERT INTO t1 VALUES (100);
+ERROR HY000: Table has no partition for value 100
+insert INTO t1 VALUES (110);
+ERROR HY000: Table has no partition for value 110
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 90;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 90;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 90;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 89;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p90 ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 89;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p90 ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 89;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 100;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 100;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 100;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where
+DROP TABLE t1;
+#
+# Bug#50104: Partitioned table with just 1 partion works with fk
+#
+CREATE TABLE t2 (
+id INT,
+PRIMARY KEY (id)
+) ENGINE=InnoDB ;
+CREATE TABLE t1 (
+id INT NOT NULL AUTO_INCREMENT,
+parent_id INT DEFAULT NULL,
+PRIMARY KEY (id),
+KEY parent_id (parent_id)
+) ENGINE=InnoDB;
+ALTER TABLE t1 PARTITION BY HASH (id) PARTITIONS 1;
+ALTER TABLE t1 ADD CONSTRAINT test_ibfk_1 FOREIGN KEY (parent_id) REFERENCES t2 (id);
+ERROR HY000: Foreign key clause is not yet supported in conjunction with partitioning
+ALTER TABLE t1 PARTITION BY HASH (id) PARTITIONS 2;
+ALTER TABLE t1 ADD CONSTRAINT test_ibfk_1 FOREIGN KEY (parent_id) REFERENCES t2 (id);
+ERROR HY000: Foreign key clause is not yet supported in conjunction with partitioning
+DROP TABLE t1, t2;
create table t1 (a int not null,
b datetime not null,
primary key (a,b))