diff options
author | Varun Gupta <varun.gupta@mariadb.com> | 2020-10-22 22:45:06 +0530 |
---|---|---|
committer | Varun Gupta <varun.gupta@mariadb.com> | 2020-10-22 22:46:29 +0530 |
commit | b6fd3840640c29f851dbf8db2885e4e4fee9928d (patch) | |
tree | c273e86bcb6c7944142a1f47cf9c72295c4eb308 /sql | |
parent | 21ea14db8cc8c5d88ff804650de7caf984d08a98 (diff) | |
download | mariadb-git-10.2-mdev23867.tar.gz |
MDEV-23867: insert... select crash in compute_window_func10.2-mdev23867
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 a file.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/mf_iocache_encr.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sql/mf_iocache_encr.cc b/sql/mf_iocache_encr.cc index d741cf8b837..29d7074aeb1 100644 --- a/sql/mf_iocache_encr.cc +++ b/sql/mf_iocache_encr.cc @@ -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 |