mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
BUG#18558 "Partition pruning results are incorrect for certain class of WHERE clauses" :
* Produce right results for conditions that were transformed to "(partitioning_range) AND (list_of_subpartitioning_ranges)": make each partition id set iterator auto-reset itself after it has returned all partition ids in the sequence * Fix "Range mapping" and "Range mapping" partitioning interval analysis functions to correctly deal with NULL values. mysql-test/r/partition_pruning.result: Testcase for BUG#18558 mysql-test/t/partition_pruning.test: Testcase for BUG#18558 sql/opt_range.cc: BUG#18558: Move partition set iterator initialization to sql_partition.cc, comment fixes sql/partition_info.h: BUG#18558: Make each partition set iterator auto-reset itself after it has returned all partition ids in the set it enumerates. sql/sql_partition.cc: BUG#18558: - Make each partition set iterator auto-reset itself after it has returned all partition ids in the set it enumerates. - Fix partition interval analysis to correctly handle intervals with one or both NULL bounds. sql/sql_partition.h: BUG#18558: - Make each partition set iterator auto-reset itself after it has returned all partition ids in the set it enumerates. - Rename PARTITION_ITERATOR::has_null_value to ret_null_part
This commit is contained in:
@@ -94,10 +94,20 @@ uint32 get_partition_id_range_for_endpoint(partition_info *part_info,
|
||||
|
||||
/*
|
||||
A "Get next" function for partition iterator.
|
||||
|
||||
SYNOPSIS
|
||||
partition_iter_func()
|
||||
part_iter Partition iterator, you call only "iter.get_next(&iter)"
|
||||
|
||||
DESCRIPTION
|
||||
Depending on whether partitions or sub-partitions are iterated, the
|
||||
function returns next subpartition id/partition number. The sequence of
|
||||
returned numbers is not ordered and may contain duplicates.
|
||||
|
||||
When the end of sequence is reached, NOT_A_PARTITION_ID is returned, and
|
||||
the iterator resets itself (so next get_next() call will start to
|
||||
enumerate the set all over again).
|
||||
|
||||
RETURN
|
||||
NOT_A_PARTITION_ID if there are no more partitions.
|
||||
[sub]partition_id of the next partition
|
||||
@@ -124,16 +134,22 @@ typedef uint32 (*partition_iter_func)(st_partition_iter* part_iter);
|
||||
typedef struct st_partition_iter
|
||||
{
|
||||
partition_iter_func get_next;
|
||||
bool has_null_value;
|
||||
/*
|
||||
Valid for "Interval mapping" in LIST partitioning: if true, let the
|
||||
iterator also produce id of the partition that contains NULL value.
|
||||
*/
|
||||
bool ret_null_part, ret_null_part_orig;
|
||||
struct st_part_num_range
|
||||
{
|
||||
uint32 start;
|
||||
uint32 cur;
|
||||
uint32 end;
|
||||
};
|
||||
|
||||
struct st_field_value_range
|
||||
{
|
||||
longlong start;
|
||||
longlong cur;
|
||||
longlong end;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user