summaryrefslogtreecommitdiff
path: root/include/my_bitmap.h
diff options
context:
space:
mode:
authorunknown <timour@askmonty.org>2011-11-17 01:25:10 +0200
committerunknown <timour@askmonty.org>2011-11-17 01:25:10 +0200
commit42221abaed700f6dc5d280b462755851780e8487 (patch)
treede3407cdfbd18cfe5d5c77a2ae2fa44cb6f02e19 /include/my_bitmap.h
parentc05e5b9c65f76ba2d3a6844add88c03076b2cb5d (diff)
downloadmariadb-git-42221abaed700f6dc5d280b462755851780e8487.tar.gz
Fix bug lp:869036
Apart from the fix, the patch also adds few more unrelated test cases for partial matching, and fixes few typos. Analysis: This bug uncovered that partial matching via rowid intersection didn't handle the case when: - the left IN argument has some NULLs, - there are no non-null value matches, and there is no non-null column, - the subquery columns that are not covered with the NULLs in the left IN argument contain at least one row, such that it has NULL values in all columns where the left IN operand has no NULLs. In this case there is a partial match. In addition the analysis of the related code uncovered incorrect handling of few other related cases. Solution: The solution for the bug is to check if there exists a row with NULLs in all columns other than the ones having NULL in the let IN operand. The check is implemented via checking whether the bitmaps that store NULL information in class Ordered_key have a non-empty intersection for the relevant columns. The intersection itself is implemented via the function bitmap_exists_intersection() in my_bitmap.c.
Diffstat (limited to 'include/my_bitmap.h')
-rw-r--r--include/my_bitmap.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/my_bitmap.h b/include/my_bitmap.h
index 09a2ff3fe65..3d179f56e4c 100644
--- a/include/my_bitmap.h
+++ b/include/my_bitmap.h
@@ -56,6 +56,10 @@ extern my_bool bitmap_test_and_clear(MY_BITMAP *map, uint bitmap_bit);
extern my_bool bitmap_fast_test_and_set(MY_BITMAP *map, uint bitmap_bit);
extern my_bool bitmap_union_is_set_all(const MY_BITMAP *map1,
const MY_BITMAP *map2);
+extern my_bool bitmap_exists_intersection(const MY_BITMAP **bitmap_array,
+ uint bitmap_count,
+ uint start_bit, uint end_bit);
+
extern uint bitmap_set_next(MY_BITMAP *map);
extern uint bitmap_get_first(const MY_BITMAP *map);
extern uint bitmap_get_first_set(const MY_BITMAP *map);