summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-02-07 18:54:11 +0100
committerSergei Golubchik <serg@mariadb.org>2018-02-08 22:54:37 +0100
commit60dfe12be3adaa03a8d409ca2da58e78e6d0c972 (patch)
treedeb24a73dc6fd63465268799a8d9da77cdff5deb /sql
parent47d1679ac69e96b201622bc0f5b3e5526ba571f2 (diff)
downloadmariadb-git-60dfe12be3adaa03a8d409ca2da58e78e6d0c972.tar.gz
MDEV-14868 MariaDB server crashes after using ROLLBACK TO when encrypt_tmp_files=ON
Fix reinit_io_cache(WRITE_CACHE) with non-zero seek_offset. Run encryption.tempfiles with and without binlog checksums.
Diffstat (limited to 'sql')
-rw-r--r--sql/mf_iocache_encr.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/mf_iocache_encr.cc b/sql/mf_iocache_encr.cc
index ae314d826a0..149e6feb605 100644
--- a/sql/mf_iocache_encr.cc
+++ b/sql/mf_iocache_encr.cc
@@ -145,9 +145,10 @@ static int my_b_encr_write(IO_CACHE *info, const uchar *Buffer, size_t Count)
if (info->seek_not_done)
{
- DBUG_ASSERT(info->pos_in_file == 0);
+ DBUG_ASSERT(info->pos_in_file % info->buffer_length == 0);
+ size_t wpos= info->pos_in_file / info->buffer_length * crypt_data->block_length;
- if ((mysql_file_seek(info->file, 0, MY_SEEK_SET, MYF(0)) == MY_FILEPOS_ERROR))
+ if ((mysql_file_seek(info->file, wpos, MY_SEEK_SET, MYF(0)) == MY_FILEPOS_ERROR))
{
info->error= -1;
DBUG_RETURN(1);