summaryrefslogtreecommitdiff
path: root/sql/sql_partition.h
diff options
context:
space:
mode:
authorunknown <sergefp@mysql.com>2006-04-06 21:23:33 +0400
committerunknown <sergefp@mysql.com>2006-04-06 21:23:33 +0400
commit4d1666f6b8f84053e5d1882e3d8893171ffe3956 (patch)
treebc2b49b52da1f1748cc430504820ba5c2dde4843 /sql/sql_partition.h
parent3d34946e762c01157ebe7bae2482ed4bfd3b5e84 (diff)
downloadmariadb-git-4d1666f6b8f84053e5d1882e3d8893171ffe3956.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. 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
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;
};