mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +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:
@ -2296,8 +2296,6 @@ bool prune_partitions(THD *thd, TABLE *table, Item *pprune_cond)
|
||||
RANGE_OPT_PARAM *range_par= &prune_param.range_param;
|
||||
|
||||
prune_param.part_info= part_info;
|
||||
prune_param.part_iter.has_null_value= FALSE;
|
||||
|
||||
init_sql_alloc(&alloc, thd->variables.range_alloc_block_size, 0);
|
||||
range_par->mem_root= &alloc;
|
||||
range_par->old_root= thd->mem_root;
|
||||
@ -2730,7 +2728,7 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree)
|
||||
key_tree->min_flag | key_tree->max_flag,
|
||||
&ppar->part_iter);
|
||||
if (!res)
|
||||
goto go_right; /* res=0 --> no satisfying partitions */
|
||||
goto go_right; /* res==0 --> no satisfying partitions */
|
||||
if (res == -1)
|
||||
{
|
||||
//get a full range iterator
|
||||
|
Reference in New Issue
Block a user