mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
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
This commit is contained in:
@ -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
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user