1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

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
parent 832b157bbe
commit d657f18ea7
3 changed files with 43 additions and 0 deletions

View File

@ -4207,3 +4207,20 @@ set @@optimizer_switch=@save_optimizer_switch;
set global innodb_stats_persistent= @innodb_stats_persistent_save;
set global innodb_stats_persistent_sample_pages=
@innodb_stats_persistent_sample_pages_save;
--echo #
--echo # MDEV-31226 Server crash or assertion failure with row size close to
--echo # join_buffer_size
--echo #
set @org_optimizer_switch=@@optimizer_switch;
set @org_join_buffer_size=@@join_buffer_size;
CREATE TABLE t (f VARCHAR(16384)) ENGINE=MyISAM CHARACTER SET utf8;
INSERT INTO t VALUES (REPEAT('a',16384)),(REPEAT('b',16384));
SET OPTIMIZER_SWITCH = 'optimize_join_buffer_size=off';
SET JOIN_BUFFER_SIZE = 16384;
explain SELECT length(concat(t1.f,t2.f)) FROM t t1, t t2;
SELECT length(concat(t1.f,t2.f)) FROM t t1, t t2;
DROP TABLE t;
set @@optimizer_switch=@org_optimizer_switch;
set @@join_buffer_size=@org_join_buffer_size;