diff options
author | Jan Lindström <jan.lindstrom@skysql.com> | 2014-07-21 22:21:30 +0300 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@skysql.com> | 2014-07-22 06:56:50 +0300 |
commit | dbc79ce0557ad5b7e3f51d7ffb0ffd1bec5b21bf (patch) | |
tree | 27f2366b816649284fb0786a31aadb24e26dfeea /storage/innobase/include | |
parent | f98b52aba13d98285d10224260a661128e7fe92f (diff) | |
download | mariadb-git-dbc79ce0557ad5b7e3f51d7ffb0ffd1bec5b21bf.tar.gz |
MDEV-6354: Implement a way to read MySQL 5.7.4-labs-tplc page
compression format (Fusion-IO).
Addeed LZMA and BZIP2 compression methods.
Diffstat (limited to 'storage/innobase/include')
-rw-r--r-- | storage/innobase/include/fil0fil.h | 21 | ||||
-rw-r--r-- | storage/innobase/include/fsp0pagecompress.h | 14 | ||||
-rw-r--r-- | storage/innobase/include/fsp0pagecompress.ic | 3 | ||||
-rw-r--r-- | storage/innobase/include/univ.i | 13 |
4 files changed, 45 insertions, 6 deletions
diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h index e1f938dbf32..965b1c31e23 100644 --- a/storage/innobase/include/fil0fil.h +++ b/storage/innobase/include/fil0fil.h @@ -126,6 +126,24 @@ extern fil_addr_t fil_addr_null; data file (ibdata*, not *.ibd): the file has been flushed to disk at least up to this lsn */ +/** If page type is FIL_PAGE_COMPRESSED then the 8 bytes starting at +FIL_PAGE_FILE_FLUSH_LSN are broken down as follows: */ + +/** Control information version format (u8) */ +static const ulint FIL_PAGE_VERSION = FIL_PAGE_FILE_FLUSH_LSN; + +/** Compression algorithm (u8) */ +static const ulint FIL_PAGE_ALGORITHM_V1 = FIL_PAGE_VERSION + 1; + +/** Original page type (u16) */ +static const ulint FIL_PAGE_ORIGINAL_TYPE_V1 = FIL_PAGE_ALGORITHM_V1 + 1; + +/** Original data size in bytes (u16)*/ +static const ulint FIL_PAGE_ORIGINAL_SIZE_V1 = FIL_PAGE_ORIGINAL_TYPE_V1 + 2; + +/** Size after compression (u16)*/ +static const ulint FIL_PAGE_COMPRESS_SIZE_V1 = FIL_PAGE_ORIGINAL_SIZE_V1 + 2; + #define FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID 34 /*!< starting from 4.1.x this contains the space id of the page */ #define FIL_PAGE_SPACE_ID FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID @@ -162,7 +180,8 @@ extern fil_addr_t fil_addr_null; #define FIL_PAGE_TYPE_BLOB 10 /*!< Uncompressed BLOB page */ #define FIL_PAGE_TYPE_ZBLOB 11 /*!< First compressed BLOB page */ #define FIL_PAGE_TYPE_ZBLOB2 12 /*!< Subsequent compressed BLOB page */ -#define FIL_PAGE_TYPE_LAST FIL_PAGE_TYPE_ZBLOB2 +#define FIL_PAGE_COMPRESSED 13 /*!< Compressed page */ +#define FIL_PAGE_TYPE_LAST FIL_PAGE_COMPRESSED /*!< Last page type */ /* @} */ diff --git a/storage/innobase/include/fsp0pagecompress.h b/storage/innobase/include/fsp0pagecompress.h index f2cd38481f6..15212227829 100644 --- a/storage/innobase/include/fsp0pagecompress.h +++ b/storage/innobase/include/fsp0pagecompress.h @@ -27,11 +27,15 @@ Created 11/12/2013 Jan Lindström jan.lindstrom@skysql.com #ifndef fsp0pagecompress_h #define fsp0pagecompress_h -#define PAGE_UNCOMPRESSED 0 -#define PAGE_ZLIB_ALGORITHM 1 -#define PAGE_LZ4_ALGORITHM 2 -#define PAGE_LZO_ALGORITHM 3 -#define PAGE_ALGORITHM_LAST PAGE_LZO_ALGORITHM +/* Supported page compression methods */ + +#define PAGE_UNCOMPRESSED 0 +#define PAGE_ZLIB_ALGORITHM 1 +#define PAGE_LZ4_ALGORITHM 2 +#define PAGE_LZO_ALGORITHM 3 +#define PAGE_LZMA_ALGORITHM 4 +#define PAGE_BZIP2_ALGORITHM 5 +#define PAGE_ALGORITHM_LAST PAGE_BZIP2_ALGORITHM /**********************************************************************//** Reads the page compression level from the first page of a tablespace. diff --git a/storage/innobase/include/fsp0pagecompress.ic b/storage/innobase/include/fsp0pagecompress.ic index 65ad90cdfc4..1ba3b7835c9 100644 --- a/storage/innobase/include/fsp0pagecompress.ic +++ b/storage/innobase/include/fsp0pagecompress.ic @@ -151,6 +151,9 @@ fil_get_compression_alg_name( case PAGE_LZO_ALGORITHM: return ("LZO"); break; + case PAGE_LZMA_ALGORITHM: + return ("LZMA"); + break; default: return("UNKNOWN"); ut_error; diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i index 54815c47419..6c299aadb0f 100644 --- a/storage/innobase/include/univ.i +++ b/storage/innobase/include/univ.i @@ -2,6 +2,7 @@ Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. +Copyright (c) 2013, 2014 SkySQL Ab. Portions of this file contain modifications contributed and copyrighted by Google, Inc. Those modifications are gratefully acknowledged and are described @@ -343,6 +344,18 @@ typedef enum innodb_file_formats_enum innodb_file_formats_t; #define IF_LZ4(A,B) B #endif +#ifdef HAVE_LZMA +#define IF_LZMA(A,B) A +#else +#define IF_LZMA(A,B) B +#endif + +#ifdef HAVE_BZIP2 +#define IF_BZIP2(A,B) A +#else +#define IF_BZIP2(A,B) B +#endif + /** The universal page size of the database */ #define UNIV_PAGE_SIZE ((ulint) srv_page_size) |