From d2f08db40c90a0b0ffd8fe84cda99fbb9af0c6c9 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Jun 2006 09:34:06 +0400 Subject: BUG#20484: "Partitions: crash with EXPLAIN and UNION" - Don't forget to produce "partitions" column for "UNION RESULT" row of EXPLAIN output mysql-test/r/partition_pruning.result: BUG#20484: Testcase mysql-test/t/partition_pruning.test: BUG#20484: Testcase --- mysql-test/t/partition_pruning.test | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mysql-test/t/partition_pruning.test') diff --git a/mysql-test/t/partition_pruning.test b/mysql-test/t/partition_pruning.test index 976466e1578..8fdfca15eef 100644 --- a/mysql-test/t/partition_pruning.test +++ b/mysql-test/t/partition_pruning.test @@ -590,3 +590,10 @@ explain partitions select * from t2; --horizontal_results drop table t2; + +# BUG#20484 "Partitions: crash with explain and union" +create table t1 (s1 int); +explain partitions select 1 from t1 union all select 2; +drop table t1; + + -- cgit v1.2.1 From 045cde1c811d6545566af38d471ef719f74d6c33 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 24 Jul 2006 21:58:11 +0400 Subject: BUG#20257: Fix partition pruning for BIGINT UNSIGNED: - Fix problems in the "Interval walking" partition interval analyzer. mysql-test/r/partition_pruning.result: BUG#20257: Add more testcases for partition pruning mysql-test/t/partition_pruning.test: BUG#20257: Add more testcases for partition pruning sql/sql_partition.cc: BUG#20257: Fix partition pruning for BIGINT UNSIGNED, interval walking: - provide special handling for an edge case of interval of size 4G-1. - Store interval size in ulonglong, not uint (it was possible to miss partitions this way) - In get_next_partition_via_walking(), interpret the value of walked-over field as having the same "signedness" as field (this is so because this value was obtained by calling field->val_int()) - Remove out of date todo comment. --- mysql-test/t/partition_pruning.test | 66 +++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) (limited to 'mysql-test/t/partition_pruning.test') diff --git a/mysql-test/t/partition_pruning.test b/mysql-test/t/partition_pruning.test index 8fdfca15eef..752ba8875c2 100644 --- a/mysql-test/t/partition_pruning.test +++ b/mysql-test/t/partition_pruning.test @@ -597,3 +597,69 @@ explain partitions select 1 from t1 union all select 2; drop table t1; +# BUG#20257: partition pruning test coverage for BIGINT UNSIGNED +create table t1 (a bigint unsigned not null) partition by range(a) ( + partition p0 values less than (10), + partition p1 values less than (100), + partition p2 values less than (1000), + partition p3 values less than (18446744073709551000), + partition p4 values less than (18446744073709551614) +); +insert into t1 values (5),(15),(105),(1005); +insert into t1 values (18446744073709551000+1); +insert into t1 values (18446744073709551614-1); + +explain partitions select * from t1 where a < 10; +explain partitions select * from t1 + where a >= 18446744073709551000-1 and a <= 18446744073709551000+1; + +explain partitions select * from t1 + where a between 18446744073709551001 and 18446744073709551002; + +explain partitions select * from t1 where a = 18446744073709551000; +explain partitions select * from t1 where a = 18446744073709551613; +explain partitions select * from t1 where a = 18446744073709551614; +drop table t1; + +create table t1 (a int) + partition by range((a & 0xFF) << 56) ( + partition p0 values less than (0x40 << 56), + partition p1 values less than (0x80 << 56), + partition p2 values less than (0xFF << 56) +); + +insert into t1 values (0x20), (0x20), (0x41), (0x41), (0xFE), (0xFE); +explain partitions select * from t1 where a=0; +explain partitions select * from t1 where a=0xFE; +explain partitions select * from t1 where a>0xFE and a<= 0xFF; +drop table t1; + +create table t1(a bigint unsigned not null) partition by range(a+0) ( + partition p1 values less than (10), + partition p2 values less than (20), + partition p3 values less than (2305561538531885056), + partition p4 values less than (2305561538531950591) +); + +insert into t1 values (9),(19),(0xFFFF0000FFFF000-1), (0xFFFF0000FFFFFFF-1); +insert into t1 values (9),(19),(0xFFFF0000FFFF000-1), (0xFFFF0000FFFFFFF-1); + +explain partitions select * from t1 where + a >= 2305561538531885056-10 and a <= 2305561538531885056-8; + +explain partitions select * from t1 where + a > 0xFFFFFFFFFFFFFFEC and a < 0xFFFFFFFFFFFFFFEE; + +explain partitions select * from t1 where a>=0 and a <= 0xFFFFFFFFFFFFFFFF; +drop table t1; + +create table t1 (a bigint) partition by range(a+0) ( + partition p1 values less than (-1000), + partition p2 values less than (-10), + partition p3 values less than (10), + partition p4 values less than (1000) +); +insert into t1 values (-15),(-5),(5),(15),(-15),(-5),(5),(15); +explain partitions select * from t1 where a>-2 and a <=0; +drop table t1; + -- cgit v1.2.1