1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +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.
This commit is contained in:
sergefp@mysql.com
2006-04-06 21:23:33 +04:00
parent 679dbc7627
commit 68bd945ca3
6 changed files with 208 additions and 48 deletions

View File

@ -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;
};