Details
Description
For some large queries Item_cond::remove_eq_conds() calls itself recursively end eventually runs out of stack. See attached schema and query files for repro.
The possible workaround would be to add this code to the beginning of the function:
if (check_stack_overrun(thd, STACK_MIN_SIZE, NULL)) |
{
|
*cond_value= Item::COND_FALSE;
|
return (COND*) 0; |
}
|
After such change mysqld will emit error instead of crashing:
ERROR 1436 (HY000): Thread stack overrun: 283200 bytes used of a 299008 byte stack, and 16000 bytes needed. Use 'mysqld --thread_stack=#' to specify a bigger stack
Would be nice to check all recursive function calls across the source base and make sure we have stack overflow guards there.