summaryrefslogtreecommitdiff
path: root/sql/sql_partition.h
diff options
context:
space:
mode:
authorsergefp@mysql.com <>2006-04-06 21:23:33 +0400
committersergefp@mysql.com <>2006-04-06 21:23:33 +0400
commit68bd945ca38046426346f1b22b6e7184c00609b9 (patch)
treebc2b49b52da1f1748cc430504820ba5c2dde4843 /sql/sql_partition.h
parent679dbc7627f156c6444222c1d9e2a8f6817cfbdc (diff)
downloadmariadb-git-68bd945ca38046426346f1b22b6e7184c00609b9.tar.gz
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.
Diffstat (limited to 'sql/sql_partition.h')
-rw-r--r--sql/sql_partition.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/sql/sql_partition.h b/sql/sql_partition.h
index c214be81ae4..fd2c474236f 100644
--- a/sql/sql_partition.h
+++ b/sql/sql_partition.h
@@ -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;
};