summaryrefslogtreecommitdiff
path: root/storage/xtradb/fil
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@skysql.com>2014-08-07 13:44:00 +0300
committerJan Lindström <jan.lindstrom@skysql.com>2014-08-07 13:44:00 +0300
commitd87ffeb49133aa459e134f09924cd7b7b5013632 (patch)
treee582610747a3e7efd7a85de04da62c4ec95057b1 /storage/xtradb/fil
parent50777e26f048bb2019cdb4439aebda7d530feba4 (diff)
downloadmariadb-git-d87ffeb49133aa459e134f09924cd7b7b5013632.tar.gz
MDEV-6548: Incorrect compression on LZMA.
Analysis: Provided incorrect parameter to output buffer size and incorrectly determined actual payload size after compression.
Diffstat (limited to 'storage/xtradb/fil')
-rw-r--r--storage/xtradb/fil/fil0pagecompress.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/storage/xtradb/fil/fil0pagecompress.cc b/storage/xtradb/fil/fil0pagecompress.cc
index 854b094ea81..71815ca0318 100644
--- a/storage/xtradb/fil/fil0pagecompress.cc
+++ b/storage/xtradb/fil/fil0pagecompress.cc
@@ -345,16 +345,19 @@ fil_compress_page(
len,
reinterpret_cast<uint8_t*>(out_buf + header_len),
&out_pos,
- (size_t)&write_size);
+ (size_t)write_size);
- if (err != LZMA_OK || write_size > UNIV_PAGE_SIZE-header_len) {
+ if (err != LZMA_OK || out_pos > UNIV_PAGE_SIZE-header_len) {
fprintf(stderr,
"InnoDB: Warning: Compression failed for space %lu name %s len %lu err %d write_size %lu\n",
- space_id, fil_space_name(space), len, err, write_size);
+ space_id, fil_space_name(space), len, err, out_pos);
srv_stats.pages_page_compression_error.inc();
*out_len = len;
return (buf);
}
+
+ write_size = out_pos;
+
break;
}
#endif /* HAVE_LZMA */