diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-10-28 10:01:50 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-10-28 10:01:50 +0200 |
commit | a8de8f261d1b7621b8e16396e87dfaac14891162 (patch) | |
tree | 9b8ec45858c2757305e0bdecf237fcb59251020c /mysys/mf_iocache.c | |
parent | e183aec1d75ea7b424ebe237e6b1643961903f2d (diff) | |
parent | 42e1815ad850384fad292534665ff61b78dd96f6 (diff) | |
download | mariadb-git-a8de8f261d1b7621b8e16396e87dfaac14891162.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'mysys/mf_iocache.c')
-rw-r--r-- | mysys/mf_iocache.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index 9b3fd6a97b8..917ccd160ee 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -250,7 +250,7 @@ int init_io_cache(IO_CACHE *info, File file, size_t cachesize, info->write_buffer= info->buffer + cachesize; else info->write_buffer= info->buffer; - info->alloced_buffer= 1; + info->alloced_buffer= buffer_block; break; /* Enough memory found */ } if (cachesize == min_cache) @@ -324,14 +324,14 @@ int init_slave_io_cache(IO_CACHE *master, IO_CACHE *slave) DBUG_ASSERT(!master->share); DBUG_ASSERT(master->alloced_buffer); - if (!(slave_buf= (uchar*)my_malloc(master->buffer_length, MYF(0)))) + if (!(slave_buf= (uchar*)my_malloc(master->alloced_buffer, MYF(0)))) { return 1; } memcpy(slave, master, sizeof(IO_CACHE)); slave->buffer= slave_buf; - memcpy(slave->buffer, master->buffer, master->buffer_length); + memcpy(slave->buffer, master->buffer, master->alloced_buffer); slave->read_pos= slave->buffer + (master->read_pos - master->buffer); slave->read_end= slave->buffer + (master->read_end - master->buffer); |