diff options
author | unknown <sergefp@mysql.com> | 2007-11-20 05:02:49 +0300 |
---|---|---|
committer | unknown <sergefp@mysql.com> | 2007-11-20 05:02:49 +0300 |
commit | 0b22925cc0553c11fc7d131f27b1846253a8ee87 (patch) | |
tree | bece4a64380034d28f6208449edb115f8b306f12 /mysql-test/r/partition_range.result | |
parent | 83e7133071b00cb3fe77346fc7c302d7549bbfe0 (diff) | |
download | mariadb-git-0b22925cc0553c11fc7d131f27b1846253a8ee87.tar.gz |
BUG#30573: Ordered range scan over partitioned tables returns some rows twice
The problem: ha_partition::read_range_first() could return a record that is
outside of the scanned range. If that record happened to be in the next
subsequent range, it would satisfy the WHERE and appear in the output twice.
(we would get it the second time when scanning the next subsequent range)
Fix:
Made ha_partition::read_range_first() check if the returned recod is within
the scanned range, like other read_range_first() implementations do.
mysql-test/r/partition_range.result:
BUG#30573: Ordered range scan over partitioned tables returns some rows twice
- Testcase
mysql-test/t/partition_range.test:
BUG#30573: Ordered range scan over partitioned tables returns some rows twice
- Testcase
sql/ha_partition.cc:
BUG#30573: Ordered range scan over partitioned tables returns some rows twice
- Make ha_partition::read_range_first() check if the returned record is
within the range.
Diffstat (limited to 'mysql-test/r/partition_range.result')
-rw-r--r-- | mysql-test/r/partition_range.result | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/mysql-test/r/partition_range.result b/mysql-test/r/partition_range.result index a61006e87a4..f75cbbf5470 100644 --- a/mysql-test/r/partition_range.result +++ b/mysql-test/r/partition_range.result @@ -1,4 +1,4 @@ -drop table if exists t1; +drop table if exists t1, t2; create table t1 (a int unsigned) partition by range (a) (partition pnull values less than (0), @@ -709,3 +709,23 @@ WHERE (a >= '2004-07-01' AND a <= '2004-09-30') OR id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p407,p408,p409,p507,p508,p509 ALL NULL NULL NULL NULL 18 Using where DROP TABLE t1; +create table t1 (a int); +insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +CREATE TABLE t2 ( +defid int(10) unsigned NOT NULL, +day int(10) unsigned NOT NULL, +count int(10) unsigned NOT NULL, +filler char(200), +KEY (defid,day) +) +PARTITION BY RANGE (day) ( +PARTITION p7 VALUES LESS THAN (20070401) , +PARTITION p8 VALUES LESS THAN (20070501)); +insert into t2 select 20, 20070311, 1, 'filler' from t1 A, t1 B; +insert into t2 select 20, 20070411, 1, 'filler' from t1 A, t1 B; +insert into t2 values(52, 20070321, 123, 'filler') ; +insert into t2 values(52, 20070322, 456, 'filler') ; +select sum(count) from t2 ch where ch.defid in (50,52) and ch.day between 20070320 and 20070401 group by defid; +sum(count) +579 +drop table t1, t2; |