diff options
author | Sergei Golubchik <sergii@pisem.net> | 2012-02-21 20:51:56 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2012-02-21 20:51:56 +0100 |
commit | edab37cd680ebcca999d989c34251f6be1115c54 (patch) | |
tree | 9a960e6324916997d8efa87ce8d48d099d78cab8 /sql/opt_range.cc | |
parent | 5bf311e1e853457c31dbadd3d130b2569a867d80 (diff) | |
parent | 446554a15bd84f39ec4a8163e9f4456fa9be8fb2 (diff) | |
download | mariadb-git-edab37cd680ebcca999d989c34251f6be1115c54.tar.gz |
5.3 merge
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r-- | sql/opt_range.cc | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 9fb29512b83..a004e7700c7 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -578,6 +578,14 @@ public: increment_use_count(1); use_count++; } + void incr_refs_all() + { + for (SEL_ARG *pos=first(); pos ; pos=pos->next) + { + pos->increment_use_count(1); + } + use_count++; + } void free_tree() { for (SEL_ARG *pos=first(); pos ; pos=pos->next) @@ -1117,9 +1125,11 @@ int SEL_IMERGE::and_sel_tree(RANGE_OPT_PARAM *param, SEL_TREE *tree, for (SEL_TREE** or_tree= trees; or_tree != trees_next; or_tree++) { SEL_TREE *res_or_tree= 0; - if (!(res_or_tree= new SEL_TREE())) + SEL_TREE *and_tree= 0; + if (!(res_or_tree= new SEL_TREE()) || + !(and_tree= new SEL_TREE(tree, TRUE, param))) return (-1); - if (!and_range_trees(param, *or_tree, tree, res_or_tree)) + if (!and_range_trees(param, *or_tree, and_tree, res_or_tree)) { if (new_imerge->or_sel_tree(param, res_or_tree)) return (-1); @@ -1332,7 +1342,7 @@ SEL_TREE::SEL_TREE(SEL_TREE *arg, bool without_merges, for (uint idx= 0; idx < param->keys; idx++) { if ((keys[idx]= arg->keys[idx])) - keys[idx]->incr_refs(); + keys[idx]->incr_refs_all(); } if (without_merges) |