Skip to content

Commit 5a61516

Browse files
committed
Merge remote-tracking branch 'origin/10.1' into 10.1-serg-merge
2 parents ac4d784 + 6a85b10 commit 5a61516

File tree

15 files changed

+47
-41
lines changed

15 files changed

+47
-41
lines changed

cmake/lzo.cmake

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
MACRO (MYSQL_CHECK_LZO_STATIC)
1616

17-
CHECK_INCLUDE_FILES(lzo/lzo1x.h HAVE_LZO_H)
18-
CHECK_LIBRARY_EXISTS(liblzo2.a lzo1x_1_compress "" HAVE_LZO_LIB)
17+
#CHECK_INCLUDE_FILES(lzo/lzo1x.h HAVE_LZO_H)
18+
#CHECK_LIBRARY_EXISTS(liblzo2.a lzo1x_1_compress "" HAVE_LZO_LIB)
1919

2020
IF(HAVE_LZO_LIB AND HAVE_LZO_H)
2121
ADD_DEFINITIONS(-DHAVE_LZO=1)
@@ -25,10 +25,10 @@ ENDMACRO()
2525

2626
MACRO (MYSQL_CHECK_LZO)
2727

28-
CHECK_INCLUDE_FILES(lzo/lzo1x.h HAVE_LZO_H)
29-
CHECK_LIBRARY_EXISTS(lzo2 lzo1x_1_compress "" HAVE_LZO_LIB)
28+
#CHECK_INCLUDE_FILES(lzo/lzo1x.h HAVE_LZO_H)
29+
#CHECK_LIBRARY_EXISTS(lzo2 lzo1x_1_compress "" HAVE_LZO_SHARED_LIB)
3030

31-
IF(HAVE_LZO_LIB AND HAVE_LZO_H)
31+
IF(HAVE_LZO_SHARED_LIB AND HAVE_LZO_H)
3232
ADD_DEFINITIONS(-DHAVE_LZO=1)
3333
LINK_LIBRARIES(lzo2)
3434
ENDIF()

storage/innobase/fil/fil0fil.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ static ulint srv_data_read, srv_data_written;
6363
#include <linux/fs.h>
6464
#include <sys/ioctl.h>
6565
#include <fcntl.h>
66-
#include <linux/falloc.h>
6766
#endif
6867
#include "row0mysql.h"
6968

storage/innobase/fil/fil0pagecompress.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ fil_decompress_page(
232232
byte* page_buf, /*!< in: preallocated buffer or NULL */
233233
byte* buf, /*!< out: buffer from which to read; in aio
234234
this must be appropriately aligned */
235-
ulint len, /*!< in: length of output buffer.*/
235+
ulong len, /*!< in: length of output buffer.*/
236236
ulint* write_size) /*!< in/out: Actual payload size of
237237
the compressed data. */
238238
{

storage/innobase/handler/ha_innodb.cc

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17006,20 +17006,24 @@ static MYSQL_SYSVAR_BOOL(use_trim, srv_use_trim,
1700617006
"Use trim. Default FALSE.",
1700717007
NULL, NULL, FALSE);
1700817008

17009-
static MYSQL_SYSVAR_LONG(compression_algorithm, innodb_compression_algorithm,
17010-
PLUGIN_VAR_OPCMDARG,
17011-
"Compression algorithm used on page compression. 1 for zlib, 2 for lz3, 3 for lzo",
17012-
NULL, NULL,
17013-
PAGE_ZLIB_ALGORITHM,
17014-
0,
17015-
#if defined(HAVE_LZO) && defined(HAVE_LZ4)
17016-
PAGE_ALGORITHM_LAST,
17017-
#elif defined(HAVE_LZ4) && !defined(HAVE_LZO)
17018-
PAGE_LZ4_ALGORITHM,
17009+
#if defined(HAVE_LZO)
17010+
#define default_compression_algorithm PAGE_LZO_ALGORITHM
17011+
#elif defined(HAVE_LZ4)
17012+
#define default_compression_algorithm PAGE_LZ4_ALGORITHM
1701917013
#else
17020-
PAGE_ZLIB_ALGORITHM,
17014+
#define default_compression_algorithm PAGE_ZLIB_ALGORITHM
1702117015
#endif
17022-
0);
17016+
static const char *page_compression_algorithms[]= { "none", "zlib", "lz4", "lzo", 0 };
17017+
static TYPELIB page_compression_algorithms_typelib=
17018+
{
17019+
array_elements(page_compression_algorithms) - 1, 0,
17020+
page_compression_algorithms, 0
17021+
};
17022+
static MYSQL_SYSVAR_ENUM(compression_algorithm, innodb_compression_algorithm,
17023+
PLUGIN_VAR_OPCMDARG,
17024+
"Compression algorithm used on page compression. One of: none, zlib, lz4, or lzo",
17025+
NULL, NULL, default_compression_algorithm,
17026+
&page_compression_algorithms_typelib);
1702317027

1702417028
static MYSQL_SYSVAR_LONG(mtflush_threads, srv_mtflush_threads,
1702517029
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,

storage/innobase/include/fil0pagecompress.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ fil_decompress_page(
9999
byte* page_buf, /*!< in: preallocated buffer or NULL */
100100
byte* buf, /*!< out: buffer from which to read; in aio
101101
this must be appropriately aligned */
102-
ulint len, /*!< in: length of output buffer.*/
102+
ulong len, /*!< in: length of output buffer.*/
103103
ulint* write_size); /*!< in/out: Actual payload size of
104104
the compressed data. */
105105

storage/innobase/include/srv0srv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ extern my_bool srv_use_posix_fallocate;
252252
extern my_bool srv_use_atomic_writes;
253253

254254
/* Compression algorithm*/
255-
extern long innodb_compression_algorithm;
255+
extern ulong innodb_compression_algorithm;
256256

257257
/* Number of flush threads */
258258
#define MTFLUSH_MAX_WORKER 64

storage/innobase/srv/srv0srv.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ UNIV_INTERN my_bool srv_use_posix_fallocate = FALSE;
155155
/* If this flag is TRUE, then we disable doublewrite buffer */
156156
UNIV_INTERN my_bool srv_use_atomic_writes = FALSE;
157157
/* If this flag IS TRUE, then we use lz4 to compress/decompress pages */
158-
UNIV_INTERN long innodb_compression_algorithm = PAGE_ZLIB_ALGORITHM;
158+
UNIV_INTERN ulong innodb_compression_algorithm = PAGE_ZLIB_ALGORITHM;
159159
/* Number of threads used for multi-threaded flush */
160160
UNIV_INTERN long srv_mtflush_threads = MTFLUSH_DEFAULT_WORKER;
161161
/* If this flag is TRUE, then we will use multi threaded flush. */

storage/xtradb/fil/fil0fil.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ static ulint srv_data_read, srv_data_written;
6161
#include <linux/fs.h>
6262
#include <sys/ioctl.h>
6363
#include <fcntl.h>
64-
#include <linux/falloc.h>
6564
#endif
6665
#include "row0mysql.h"
6766

storage/xtradb/fil/fil0pagecompress.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ fil_decompress_page(
232232
byte* page_buf, /*!< in: preallocated buffer or NULL */
233233
byte* buf, /*!< out: buffer from which to read; in aio
234234
this must be appropriately aligned */
235-
ulint len, /*!< in: length of output buffer.*/
235+
ulong len, /*!< in: length of output buffer.*/
236236
ulint* write_size) /*!< in/out: Actual payload size of
237237
the compressed data. */
238238
{

storage/xtradb/handler/ha_innodb.cc

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18184,20 +18184,24 @@ static MYSQL_SYSVAR_BOOL(use_trim, srv_use_trim,
1818418184
"Use trim. Default FALSE.",
1818518185
NULL, NULL, FALSE);
1818618186

18187-
static MYSQL_SYSVAR_LONG(compression_algorithm, innodb_compression_algorithm,
18188-
PLUGIN_VAR_OPCMDARG,
18189-
"Compression algorithm used on page compression. 1 for zlib, 2 for lz3, 3 for lzo",
18190-
NULL, NULL,
18191-
PAGE_ZLIB_ALGORITHM,
18192-
0,
18193-
#if defined(HAVE_LZO) && defined(HAVE_LZ4)
18194-
PAGE_ALGORITHM_LAST,
18195-
#elif defined(HAVE_LZ4) && !defined(HAVE_LZO)
18196-
PAGE_LZ4_ALGORITHM,
18187+
#if defined(HAVE_LZO)
18188+
#define default_compression_algorithm PAGE_LZO_ALGORITHM
18189+
#elif defined(HAVE_LZ4)
18190+
#define default_compression_algorithm PAGE_LZ4_ALGORITHM
1819718191
#else
18198-
PAGE_ZLIB_ALGORITHM,
18192+
#define default_compression_algorithm PAGE_ZLIB_ALGORITHM
1819918193
#endif
18200-
0);
18194+
static const char *page_compression_algorithms[]= { "none", "zlib", "lz4", "lzo", 0 };
18195+
static TYPELIB page_compression_algorithms_typelib=
18196+
{
18197+
array_elements(page_compression_algorithms) - 1, 0,
18198+
page_compression_algorithms, 0
18199+
};
18200+
static MYSQL_SYSVAR_ENUM(compression_algorithm, innodb_compression_algorithm,
18201+
PLUGIN_VAR_OPCMDARG,
18202+
"Compression algorithm used on page compression. One of: none, zlib, lz4, or lzo",
18203+
NULL, NULL, default_compression_algorithm,
18204+
&page_compression_algorithms_typelib);
1820118205

1820218206
static MYSQL_SYSVAR_LONG(mtflush_threads, srv_mtflush_threads,
1820318207
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,

0 commit comments

Comments
 (0)