summaryrefslogtreecommitdiff
path: root/storage/maria/ma_packrec.c
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2021-03-07 14:06:01 +0100
committerSergei Golubchik <serg@mariadb.org>2021-03-08 15:00:45 +0100
commitf24038b8515864e496dd2c55d973a0227b3698df (patch)
tree2e9c697826af2d466ca745ba3fee49e28c529c9e /storage/maria/ma_packrec.c
parent9742cf42035b3bebd50bbefe787e316cd041bf01 (diff)
downloadmariadb-git-f24038b8515864e496dd2c55d973a0227b3698df.tar.gz
mark Aria allocations for temp tables as MY_THREAD_SPECIFIC
Diffstat (limited to 'storage/maria/ma_packrec.c')
-rw-r--r--storage/maria/ma_packrec.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/storage/maria/ma_packrec.c b/storage/maria/ma_packrec.c
index e42e9300d14..d1c30a57146 100644
--- a/storage/maria/ma_packrec.c
+++ b/storage/maria/ma_packrec.c
@@ -1413,10 +1413,12 @@ uint _ma_pack_get_block_info(MARIA_HA *maria, MARIA_BIT_BUFF *bit_buff,
{
uchar *header= info->header;
uint head_length,UNINIT_VAR(ref_length);
+ MARIA_SHARE *share= maria->s;
+ myf flag= MY_WME | (share->temporary ? MY_THREAD_SPECIFIC : 0);
if (file >= 0)
{
- ref_length=maria->s->pack.ref_length;
+ ref_length=share->pack.ref_length;
/*
We can't use my_pread() here because _ma_read_rnd_pack_record assumes
position is ok
@@ -1426,11 +1428,11 @@ uint _ma_pack_get_block_info(MARIA_HA *maria, MARIA_BIT_BUFF *bit_buff,
return BLOCK_FATAL_ERROR;
DBUG_DUMP("header", header, ref_length);
}
- head_length= read_pack_length((uint) maria->s->pack.version, header,
+ head_length= read_pack_length((uint) share->pack.version, header,
&info->rec_len);
- if (maria->s->base.blobs)
+ if (share->base.blobs)
{
- head_length+= read_pack_length((uint) maria->s->pack.version,
+ head_length+= read_pack_length((uint) share->pack.version,
header + head_length, &info->blob_len);
/*
Ensure that the record buffer is big enough for the compressed
@@ -1439,7 +1441,7 @@ uint _ma_pack_get_block_info(MARIA_HA *maria, MARIA_BIT_BUFF *bit_buff,
*/
if (_ma_alloc_buffer(rec_buff_p, rec_buff_size_p,
info->rec_len + info->blob_len +
- maria->s->base.extra_rec_buff_size))
+ share->base.extra_rec_buff_size, flag))
return BLOCK_FATAL_ERROR; /* not enough memory */
bit_buff->blob_pos= *rec_buff_p + info->rec_len;
bit_buff->blob_end= bit_buff->blob_pos + info->blob_len;
@@ -1580,15 +1582,18 @@ _ma_mempack_get_block_info(MARIA_HA *maria,
size_t *rec_buff_size_p,
uchar *header)
{
- header+= read_pack_length((uint) maria->s->pack.version, header,
+ MARIA_SHARE *share= maria->s;
+ myf flag= MY_WME | (share->temporary ? MY_THREAD_SPECIFIC : 0);
+
+ header+= read_pack_length((uint) share->pack.version, header,
&info->rec_len);
- if (maria->s->base.blobs)
+ if (share->base.blobs)
{
- header+= read_pack_length((uint) maria->s->pack.version, header,
+ header+= read_pack_length((uint) share->pack.version, header,
&info->blob_len);
/* _ma_alloc_rec_buff sets my_errno on error */
if (_ma_alloc_buffer(rec_buff_p, rec_buff_size_p,
- info->blob_len + maria->s->base.extra_rec_buff_size))
+ info->blob_len + share->base.extra_rec_buff_size, flag))
return 0; /* not enough memory */
bit_buff->blob_pos= *rec_buff_p;
bit_buff->blob_end= *rec_buff_p + info->blob_len;