MDEV-31226 Server crash or assertion failure with row size close to join_buffer_size

The problem was that JOIN_CACHE::alloc_buffer() did not check if the
given join_buffer_value is less than the query require.

Added a check for this and disabled join cache if it cannot be used.
This commit is contained in:
Monty 2023-05-27 16:31:22 +03:00
commit d657f18ea7
3 changed files with 43 additions and 0 deletions

View file

@ -945,6 +945,9 @@ int JOIN_CACHE::alloc_buffer()
join_buff_space_limit))
goto fail; // Fatal error
}
else if (curr_min_buff_space_sz > buff_size)
goto fail;
if (for_explain_only)
return 0;