diff options
author | Sergei Petrunia <sergey@mariadb.com> | 2023-02-08 15:27:15 +0300 |
---|---|---|
committer | Sergei Petrunia <sergey@mariadb.com> | 2023-02-15 11:36:12 +0300 |
commit | e8c7222ba3add52665e425740860325866b2aef5 (patch) | |
tree | ba736b680fa855f0301b27cbc16f7c7cc7a55c69 /cmake | |
parent | a7666952e05e14e7a6ef04d32422a90ec504c058 (diff) | |
download | mariadb-git-e8c7222ba3add52665e425740860325866b2aef5.tar.gz |
MDEV-30603: Wrong result with non-default JOIN_CACHE_LEVEL=[4|5] ...
JOIN_CACHE::alloc_buffer() used wrong logic when calculating the size
of all join buffers. Then, it computed the ratio by which
JOIN::shrink_join_buffers() should shrink the buffers.
shrink_join_buffers() ended up in a situation where buffers would not
fit into the total quota after shrinking, which resulted in negative
buffer sizes. Due to use of unsigned integers it would cause very large
buffers to be used instead.
Make JOIN_CACHE::alloc_buffer() use the same logic as
JOIN::shrink_join_buffers() when it calculates the total size of
all join buffers so far.
Also, add a safety check in JOIN::shrink_join_buffers()
This patch doesn't include a testcase, because the original test dataset
is too big and fragile. We have dbt3_s001.inc but I wasn't able to demonstrate
the issue with it.
Diffstat (limited to 'cmake')
0 files changed, 0 insertions, 0 deletions