diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2017-04-28 10:07:03 +0300 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2017-05-18 09:29:44 +0300 |
commit | f302a3cf9d9de48cae660641ec9695412f74b80e (patch) | |
tree | 35ae5f34f82508b4159665c0695899b8c9f9d61f /storage/xtradb | |
parent | febe88198ebadceef2549c04f3e6afe75b68bac3 (diff) | |
download | mariadb-git-f302a3cf9d9de48cae660641ec9695412f74b80e.tar.gz |
MDEV-12593: InnoDB page compression should use lz4_compress_default if
available
lz4.cmake: Check if shared or static lz4 library has LZ4_compress_default
function and if it has define HAVE_LZ4_COMPRESS_DEFAULT.
fil_compress_page: If HAVE_LZ4_COMPRESS_DEFAULT is defined use
LZ4_compress_default function for compression if not use
LZ4_compress_limitedOutput function.
Introduced a innodb-page-compression.inc file for page compression
tests that will also search .ibd file to verify that pages
are compressed (i.e. used search string is not found). Modified
page compression tests to use this file.
Note that snappy method is not included because of MDEV-12615
InnoDB page compression method snappy mostly does not compress pages
that will be fixed on different commit.
Diffstat (limited to 'storage/xtradb')
-rw-r--r-- | storage/xtradb/fil/fil0pagecompress.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/storage/xtradb/fil/fil0pagecompress.cc b/storage/xtradb/fil/fil0pagecompress.cc index 8b2449983df..c377c19dd0d 100644 --- a/storage/xtradb/fil/fil0pagecompress.cc +++ b/storage/xtradb/fil/fil0pagecompress.cc @@ -163,8 +163,13 @@ fil_compress_page( switch(comp_method) { #ifdef HAVE_LZ4 case PAGE_LZ4_ALGORITHM: +#ifdef HAVE_LZ4_COMPRESS_DEFAULT + err = LZ4_compress_default((const char *)buf, + (char *)out_buf+header_len, len, write_size); +#else err = LZ4_compress_limitedOutput((const char *)buf, (char *)out_buf+header_len, len, write_size); +#endif /* HAVE_LZ4_COMPRESS_DEFAULT */ write_size = err; if (err == 0) { |