diff options
author | Sergei Golubchik <sergii@pisem.net> | 2012-11-03 12:28:51 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2012-11-03 12:28:51 +0100 |
commit | 40e94a3734b1daa254810c4be64e17b84dbbc2a2 (patch) | |
tree | 5e14dfc106276445caf85dc76c8034c8b0df11b4 /sql/opt_range.cc | |
parent | 247e654fa7e04dd0c5181c2241470f56749d2a99 (diff) | |
parent | 4ffc9c3b01459a2904a7154a6c750d128864fc7b (diff) | |
download | mariadb-git-40e94a3734b1daa254810c4be64e17b84dbbc2a2.tar.gz |
merge with 5.5
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r-- | sql/opt_range.cc | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 994b3f75989..5cf3a29a4b7 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -3853,27 +3853,28 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree) ppar->cur_subpart_fields+= ppar->is_subpart_keypart[key_tree_part]; *(ppar->arg_stack_end++)= key_tree; + if (ignore_part_fields) + { + /* + We come here when a condition on the first partitioning + fields led to evaluating the partitioning condition + (due to finding a condition of the type a < const or + b > const). Thus we must ignore the rest of the + partitioning fields but we still want to analyse the + subpartitioning fields. + */ + if (key_tree->next_key_part) + res= find_used_partitions(ppar, key_tree->next_key_part); + else + res= -1; + goto pop_and_go_right; + } + if (key_tree->type == SEL_ARG::KEY_RANGE) { if (ppar->part_info->get_part_iter_for_interval && key_tree->part <= ppar->last_part_partno) { - if (ignore_part_fields) - { - /* - We come here when a condition on the first partitioning - fields led to evaluating the partitioning condition - (due to finding a condition of the type a < const or - b > const). Thus we must ignore the rest of the - partitioning fields but we still want to analyse the - subpartitioning fields. - */ - if (key_tree->next_key_part) - res= find_used_partitions(ppar, key_tree->next_key_part); - else - res= -1; - goto pop_and_go_right; - } /* Collect left and right bound, their lengths and flags */ uchar *min_key= ppar->cur_min_key; uchar *max_key= ppar->cur_max_key; @@ -4114,6 +4115,13 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree) res= -1; goto pop_and_go_right; } + /* + No meaning in continuing with rest of partitioning key parts. + Will try to continue with subpartitioning key parts. + */ + ppar->ignore_part_fields= true; + did_set_ignore_part_fields= true; + goto process_next_key_part; } } |