diff options
author | unknown <sergefp@mysql.com> | 2007-03-31 00:29:18 +0400 |
---|---|---|
committer | unknown <sergefp@mysql.com> | 2007-03-31 00:29:18 +0400 |
commit | 080c0c7ac8df45e6d6eb544e611183d029f4fb63 (patch) | |
tree | 6d230f7106b7719f705450b6dc07faa89a8270e3 /sql/opt_range.cc | |
parent | 9b358f811b046ce5e188235d7e3d60424d5579e7 (diff) | |
download | mariadb-git-080c0c7ac8df45e6d6eb544e611183d029f4fb63.tar.gz |
BUG#26624: high mem usage (crash) in range optimizer
Pushbuild fixes:
- Make MAX_SEL_ARGS smaller (even 16K records_in_range() calls is
more than it makes sense to do in typical cases)
- Don't call sel_arg->test_use_count() if we've already allocated
more than MAX_SEL_ARGs elements. The test will succeed but will take
too much time for the test suite (and not provide much value).
mysql-test/r/range.result:
BUG#26624: high mem usage (crash) in range optimizer
Pushbuild fixes: make the test go faster
mysql-test/t/range.test:
BUG#26624: high mem usage (crash) in range optimizer
Pushbuild fixes: make the test go faster
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r-- | sql/opt_range.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc index ca8f31f5775..01b366077b0 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -241,7 +241,7 @@ public: enum leaf_color { BLACK,RED } color; enum Type { IMPOSSIBLE, MAYBE, MAYBE_KEY, KEY_RANGE } type; - enum { MAX_SEL_ARGS = 64000 }; + enum { MAX_SEL_ARGS = 16000 }; SEL_ARG() {} SEL_ARG(SEL_ARG &); @@ -1640,7 +1640,8 @@ tree_and(PARAM *param,SEL_TREE *tree1,SEL_TREE *tree2) { tree1->type= SEL_TREE::IMPOSSIBLE; #ifdef EXTRA_DEBUG - (*key1)->test_use_count(*key1); + if (param->alloced_sel_args < SEL_ARG::MAX_SEL_ARGS) + (*key1)->test_use_count(*key1); #endif break; } @@ -1677,7 +1678,8 @@ tree_or(PARAM *param,SEL_TREE *tree1,SEL_TREE *tree2) { result=tree1; // Added to tree1 #ifdef EXTRA_DEBUG - (*key1)->test_use_count(*key1); + if (param->alloced_sel_args < SEL_ARG::MAX_SEL_ARGS) + (*key1)->test_use_count(*key1); #endif } } |