Commit 17430a80 authored by Jan Lindström's avatar Jan Lindström

MDEV-11905: encryption.innodb-discard-import test fails

Problem was that on import with buffered input/output
trim is not possible as we write several pages in
one write.
parent ddc14d8e
--loose-innodb-use-trim=0
\ No newline at end of file
......@@ -5669,7 +5669,9 @@ struct fil_iterator_t {
for IO */
byte* io_buffer; /*!< Buffer to use for IO */
fil_space_crypt_t *crypt_data; /*!< MariaDB Crypt data (if encrypted) */
byte* crypt_io_buffer; /*!< MariaDB IO buffer when encrypted */
byte* crypt_io_buffer; /*!< MariaDB IO buffer when
encrypted */
dict_table_t* table; /*!< Imported table */
};
/********************************************************************//**
......@@ -5877,16 +5879,21 @@ fil_iterate(
if (page_compressed) {
ulint len = 0;
fil_compress_page(space_id,
byte * res = fil_compress_page(space_id,
src,
NULL,
size,
fil_space_get_page_compression_level(space_id),
dict_table_page_compression_level(iter.table),
fil_space_get_block_size(space_id, offset, size),
encrypted,
&len,
NULL);
if (len != size) {
memset(res+len, 0, size-len);
}
updated = true;
}
......@@ -5936,6 +5943,9 @@ fil_iterate(
ib::error() << "os_file_write() failed";
return(err);
}
/* Clean up the temporal buffer. */
memset(writeptr, 0, n_bytes);
}
return(DB_SUCCESS);
......@@ -6054,6 +6064,7 @@ fil_tablespace_iterate(
iter.file_size = file_size;
iter.n_io_buffers = n_io_buffers;
iter.page_size = callback.get_page_size().physical();
iter.table = table;
/* read (optional) crypt data */
iter.crypt_data = fil_space_read_crypt_data(
......
......@@ -355,6 +355,7 @@ fil_compress_page(
if (allocated) {
/* TODO: reduce number of memcpy's */
memcpy(buf, out_buf, len);
goto exit_free;
} else {
return(out_buf);
}
......@@ -380,6 +381,7 @@ fil_compress_page(
srv_stats.pages_page_compression_error.inc();
*out_len = len;
exit_free:
if (allocated) {
ut_free(out_buf);
#ifdef HAVE_LZO
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment