mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-23867: insert... select crash in compute_window_func
There are 2 issues here: Issue #1: memory allocation. An IO_CACHE that uses encryption uses a larger buffer (it needs space for the encrypted data, decrypted data, IO_CACHE_CRYPT struct to describe encryption parameters etc). Issue #2: IO_CACHE::seek_not_done When IO_CACHE objects are cloned, they still share the file descriptor. This means, operation on one IO_CACHE may change the file read position which will confuse other IO_CACHEs using it. The fix of these issues would be: Allocate the buffer to also include the extra size needed for encryption. Perform seek again after one IO_CACHE reads the file.
This commit is contained in:
@ -71,6 +71,16 @@ static int my_b_encr_read(IO_CACHE *info, uchar *Buffer, size_t Count)
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
info->seek_not_done= 0;
|
||||
if (info->next_file_user)
|
||||
{
|
||||
IO_CACHE *c;
|
||||
for (c= info->next_file_user;
|
||||
c!= info;
|
||||
c= c->next_file_user)
|
||||
{
|
||||
c->seek_not_done= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
do
|
||||
|
Reference in New Issue
Block a user