diff options
author | Martin Hansson <martin.hansson@sun.com> | 2009-10-09 11:30:40 +0200 |
---|---|---|
committer | Martin Hansson <martin.hansson@sun.com> | 2009-10-09 11:30:40 +0200 |
commit | 5ef9ec9d9e8457bbc850a1b66f41445a5a4adb44 (patch) | |
tree | 69d200f4a36874e12120bf81bf6f04ff359763c6 /client | |
parent | 6e4039ce673b82a9335350bc80539473ea0d4a55 (diff) | |
download | mariadb-git-5ef9ec9d9e8457bbc850a1b66f41445a5a4adb44.tar.gz |
Bug#42846: wrong result returned for range scan when using
covering index
When two range predicates were combined under an OR
predicate, the algorithm tried to merge overlapping ranges
into one. But the case when a range overlapped several other
ranges was not handled. This lead to
1) ranges overlapping, which gave repeated results and
2) a range that overlapped several other ranges was cut off.
Fixed by
1) Making sure that a range got an upper bound equal to the
next range with a greater minimum.
2) Removing a continue statement
mysql-test/r/group_min_max.result:
Bug#42846: Changed query plans
mysql-test/r/range.result:
Bug#42846: Test result.
mysql-test/t/range.test:
Bug#42846: Test case.
sql/opt_range.cc:
Bug#42846: The fix.
Part1: Previously, both endpoints from key2 were copied,
which is not safe. Since ranges are processed in ascending
order of minimum endpoints, it is safe to copy the minimum
endpoint from key2 but not the maximum. The maximum may only
be copied if there is no other range or the other range's
minimum is greater than key2's maximum.
Diffstat (limited to 'client')
0 files changed, 0 insertions, 0 deletions