diff options
Diffstat (limited to 'mysql-test/t/partition.test')
-rw-r--r-- | mysql-test/t/partition.test | 115 |
1 files changed, 94 insertions, 21 deletions
diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index fc6a33819d6..0b497d86623 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -10,8 +10,6 @@ # --source include/have_partition.inc -SET @old_general_log= @@global.general_log; - --disable_warnings drop table if exists t1, t2; --enable_warnings @@ -1020,6 +1018,17 @@ subpartition by hash(a) partition p1 values less than (1) (subpartition sp0)); # +# Bug 46354 Crash with subpartition +# +--error ER_PARSE_ERROR +create table t1 (a int, b int) +partition by list (a) +subpartition by hash(a) +(partition p0 values in (0), + partition p1 values in (1) (subpartition sp0)); + + +# # BUG 15961 No error when subpartition defined without subpartition by clause # --error ER_SUBPARTITION_ERROR @@ -1641,23 +1650,6 @@ insert into t values (1); drop table t; # -# Bug #27816: Log tables ran with partitions crashes the server when logging -# is enabled. -# - -USE mysql; -TRUNCATE TABLE general_log; -SET @old_general_log_state = @@global.general_log; -SET GLOBAL general_log = 0; -ALTER TABLE general_log ENGINE = MyISAM; ---error ER_WRONG_USAGE -ALTER TABLE general_log PARTITION BY RANGE (TO_DAYS(event_time)) - (PARTITION p0 VALUES LESS THAN (733144), PARTITION p1 VALUES LESS THAN (3000000)); -ALTER TABLE general_log ENGINE = CSV; -SET GLOBAL general_log = @old_general_log_state; -use test; - -# # Bug #27084 partitioning by list seems failing when using case # BUG #18198: Case no longer supported, test case removed # @@ -1922,7 +1914,88 @@ insert into t1 select s1 from t1 where s1=3; select count(*) from t1; drop table t1; ---echo End of 5.1 tests +--echo # +--echo # Bug#42944: partition not pruned correctly +--echo # +CREATE TABLE t1 (a int) PARTITION BY RANGE (a) + (PARTITION p0 VALUES LESS THAN (100), + PARTITION p1 VALUES LESS THAN (200), + PARTITION p2 VALUES LESS THAN (300), + PARTITION p3 VALUES LESS THAN MAXVALUE); +INSERT INTO t1 VALUES (10), (100), (200), (300), (400); +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a>=200; +DROP TABLE t1; + +# +# Bug#44821: select distinct on partitioned table returns wrong results +# +CREATE TABLE t1 ( a INT, b INT, c INT, KEY bc(b, c) ) +PARTITION BY KEY (a, b) PARTITIONS 3 +; -SET @@global.general_log= @old_general_log; +INSERT INTO t1 VALUES +(17, 1, -8), +(3, 1, -7), +(23, 1, -6), +(22, 1, -5), +(11, 1, -4), +(21, 1, -3), +(19, 1, -2), +(30, 1, -1), + +(20, 1, 1), +(16, 1, 2), +(18, 1, 3), +(9, 1, 4), +(15, 1, 5), +(28, 1, 6), +(29, 1, 7), +(25, 1, 8), +(10, 1, 9), +(13, 1, 10), +(27, 1, 11), +(24, 1, 12), +(12, 1, 13), +(26, 1, 14), +(14, 1, 15) +; + +SELECT b, c FROM t1 WHERE b = 1 GROUP BY b, c; + +EXPLAIN +SELECT b, c FROM t1 WHERE b = 1 GROUP BY b, c; + +DROP TABLE t1; + +--echo # +--echo # Bug #45807: crash accessing partitioned table and sql_mode +--echo # contains ONLY_FULL_GROUP_BY +--echo # + +SET SESSION SQL_MODE='ONLY_FULL_GROUP_BY'; +CREATE TABLE t1(id INT,KEY(id)) ENGINE=MYISAM + PARTITION BY HASH(id) PARTITIONS 2; +DROP TABLE t1; +SET SESSION SQL_MODE=DEFAULT; + + +--echo # +--echo # BUG#45816 - assertion failure with index containing double +--echo # column on partitioned table +--echo # + +CREATE TABLE t1 ( + a INT DEFAULT NULL, + b DOUBLE DEFAULT NULL, + c INT DEFAULT NULL, + KEY idx2(b,a) +) PARTITION BY HASH(c) PARTITIONS 3; + +INSERT INTO t1 VALUES (6,8,9); +INSERT INTO t1 VALUES (6,8,10); + +SELECT 1 FROM t1 JOIN t1 AS t2 USING (a) FOR UPDATE; + +DROP TABLE t1; +--echo End of 5.1 tests |