diff --git a/cmake/lzo.cmake b/cmake/lzo.cmake index 596dfdcde8b..5a073a6a8eb 100644 --- a/cmake/lzo.cmake +++ b/cmake/lzo.cmake @@ -14,8 +14,8 @@ MACRO (MYSQL_CHECK_LZO_STATIC) -CHECK_INCLUDE_FILES(lzo/lzo1x.h HAVE_LZO_H) -CHECK_LIBRARY_EXISTS(liblzo2.a lzo1x_1_compress "" HAVE_LZO_LIB) +#CHECK_INCLUDE_FILES(lzo/lzo1x.h HAVE_LZO_H) +#CHECK_LIBRARY_EXISTS(liblzo2.a lzo1x_1_compress "" HAVE_LZO_LIB) IF(HAVE_LZO_LIB AND HAVE_LZO_H) ADD_DEFINITIONS(-DHAVE_LZO=1) @@ -25,10 +25,10 @@ ENDMACRO() MACRO (MYSQL_CHECK_LZO) -CHECK_INCLUDE_FILES(lzo/lzo1x.h HAVE_LZO_H) -CHECK_LIBRARY_EXISTS(lzo2 lzo1x_1_compress "" HAVE_LZO_LIB) +#CHECK_INCLUDE_FILES(lzo/lzo1x.h HAVE_LZO_H) +#CHECK_LIBRARY_EXISTS(lzo2 lzo1x_1_compress "" HAVE_LZO_SHARED_LIB) -IF(HAVE_LZO_LIB AND HAVE_LZO_H) +IF(HAVE_LZO_SHARED_LIB AND HAVE_LZO_H) ADD_DEFINITIONS(-DHAVE_LZO=1) LINK_LIBRARIES(lzo2) ENDIF() diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index 58fa51c52d5..09d969556a6 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -63,7 +63,6 @@ static ulint srv_data_read, srv_data_written; #include #include #include -#include #endif #include "row0mysql.h" diff --git a/storage/innobase/fil/fil0pagecompress.cc b/storage/innobase/fil/fil0pagecompress.cc index 51f584883b5..bf6dd35e2f6 100644 --- a/storage/innobase/fil/fil0pagecompress.cc +++ b/storage/innobase/fil/fil0pagecompress.cc @@ -232,7 +232,7 @@ fil_decompress_page( byte* page_buf, /*!< in: preallocated buffer or NULL */ byte* buf, /*!< out: buffer from which to read; in aio this must be appropriately aligned */ - ulint len, /*!< in: length of output buffer.*/ + ulong len, /*!< in: length of output buffer.*/ ulint* write_size) /*!< in/out: Actual payload size of the compressed data. */ { diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 144e1b1e59c..294ef277a60 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -17006,20 +17006,24 @@ static MYSQL_SYSVAR_BOOL(use_trim, srv_use_trim, "Use trim. Default FALSE.", NULL, NULL, FALSE); -static MYSQL_SYSVAR_LONG(compression_algorithm, innodb_compression_algorithm, - PLUGIN_VAR_OPCMDARG, - "Compression algorithm used on page compression. 1 for zlib, 2 for lz3, 3 for lzo", - NULL, NULL, - PAGE_ZLIB_ALGORITHM, - 0, -#if defined(HAVE_LZO) && defined(HAVE_LZ4) - PAGE_ALGORITHM_LAST, -#elif defined(HAVE_LZ4) && !defined(HAVE_LZO) - PAGE_LZ4_ALGORITHM, +#if defined(HAVE_LZO) +#define default_compression_algorithm PAGE_LZO_ALGORITHM +#elif defined(HAVE_LZ4) +#define default_compression_algorithm PAGE_LZ4_ALGORITHM #else - PAGE_ZLIB_ALGORITHM, +#define default_compression_algorithm PAGE_ZLIB_ALGORITHM #endif - 0); +static const char *page_compression_algorithms[]= { "none", "zlib", "lz4", "lzo", 0 }; +static TYPELIB page_compression_algorithms_typelib= +{ + array_elements(page_compression_algorithms) - 1, 0, + page_compression_algorithms, 0 +}; +static MYSQL_SYSVAR_ENUM(compression_algorithm, innodb_compression_algorithm, + PLUGIN_VAR_OPCMDARG, + "Compression algorithm used on page compression. One of: none, zlib, lz4, or lzo", + NULL, NULL, default_compression_algorithm, + &page_compression_algorithms_typelib); static MYSQL_SYSVAR_LONG(mtflush_threads, srv_mtflush_threads, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, diff --git a/storage/innobase/include/fil0pagecompress.h b/storage/innobase/include/fil0pagecompress.h index 74f6e45f4fb..e3a7ffbcb49 100644 --- a/storage/innobase/include/fil0pagecompress.h +++ b/storage/innobase/include/fil0pagecompress.h @@ -99,7 +99,7 @@ fil_decompress_page( byte* page_buf, /*!< in: preallocated buffer or NULL */ byte* buf, /*!< out: buffer from which to read; in aio this must be appropriately aligned */ - ulint len, /*!< in: length of output buffer.*/ + ulong len, /*!< in: length of output buffer.*/ ulint* write_size); /*!< in/out: Actual payload size of the compressed data. */ diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index 7aec59dcc97..905d4a0afa7 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -252,7 +252,7 @@ extern my_bool srv_use_posix_fallocate; extern my_bool srv_use_atomic_writes; /* Compression algorithm*/ -extern long innodb_compression_algorithm; +extern ulong innodb_compression_algorithm; /* Number of flush threads */ #define MTFLUSH_MAX_WORKER 64 diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index 789a57e3901..71edadea9fc 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -155,7 +155,7 @@ UNIV_INTERN my_bool srv_use_posix_fallocate = FALSE; /* If this flag is TRUE, then we disable doublewrite buffer */ UNIV_INTERN my_bool srv_use_atomic_writes = FALSE; /* If this flag IS TRUE, then we use lz4 to compress/decompress pages */ -UNIV_INTERN long innodb_compression_algorithm = PAGE_ZLIB_ALGORITHM; +UNIV_INTERN ulong innodb_compression_algorithm = PAGE_ZLIB_ALGORITHM; /* Number of threads used for multi-threaded flush */ UNIV_INTERN long srv_mtflush_threads = MTFLUSH_DEFAULT_WORKER; /* If this flag is TRUE, then we will use multi threaded flush. */ diff --git a/storage/xtradb/fil/fil0fil.cc b/storage/xtradb/fil/fil0fil.cc index d482ef5e6ad..ba2dd0aa39b 100644 --- a/storage/xtradb/fil/fil0fil.cc +++ b/storage/xtradb/fil/fil0fil.cc @@ -61,7 +61,6 @@ static ulint srv_data_read, srv_data_written; #include #include #include -#include #endif #include "row0mysql.h" diff --git a/storage/xtradb/fil/fil0pagecompress.cc b/storage/xtradb/fil/fil0pagecompress.cc index 51f584883b5..bf6dd35e2f6 100644 --- a/storage/xtradb/fil/fil0pagecompress.cc +++ b/storage/xtradb/fil/fil0pagecompress.cc @@ -232,7 +232,7 @@ fil_decompress_page( byte* page_buf, /*!< in: preallocated buffer or NULL */ byte* buf, /*!< out: buffer from which to read; in aio this must be appropriately aligned */ - ulint len, /*!< in: length of output buffer.*/ + ulong len, /*!< in: length of output buffer.*/ ulint* write_size) /*!< in/out: Actual payload size of the compressed data. */ { diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 91bd184abdc..8bc8e6d46d7 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -18184,20 +18184,24 @@ static MYSQL_SYSVAR_BOOL(use_trim, srv_use_trim, "Use trim. Default FALSE.", NULL, NULL, FALSE); -static MYSQL_SYSVAR_LONG(compression_algorithm, innodb_compression_algorithm, - PLUGIN_VAR_OPCMDARG, - "Compression algorithm used on page compression. 1 for zlib, 2 for lz3, 3 for lzo", - NULL, NULL, - PAGE_ZLIB_ALGORITHM, - 0, -#if defined(HAVE_LZO) && defined(HAVE_LZ4) - PAGE_ALGORITHM_LAST, -#elif defined(HAVE_LZ4) && !defined(HAVE_LZO) - PAGE_LZ4_ALGORITHM, +#if defined(HAVE_LZO) +#define default_compression_algorithm PAGE_LZO_ALGORITHM +#elif defined(HAVE_LZ4) +#define default_compression_algorithm PAGE_LZ4_ALGORITHM #else - PAGE_ZLIB_ALGORITHM, +#define default_compression_algorithm PAGE_ZLIB_ALGORITHM #endif - 0); +static const char *page_compression_algorithms[]= { "none", "zlib", "lz4", "lzo", 0 }; +static TYPELIB page_compression_algorithms_typelib= +{ + array_elements(page_compression_algorithms) - 1, 0, + page_compression_algorithms, 0 +}; +static MYSQL_SYSVAR_ENUM(compression_algorithm, innodb_compression_algorithm, + PLUGIN_VAR_OPCMDARG, + "Compression algorithm used on page compression. One of: none, zlib, lz4, or lzo", + NULL, NULL, default_compression_algorithm, + &page_compression_algorithms_typelib); static MYSQL_SYSVAR_LONG(mtflush_threads, srv_mtflush_threads, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, diff --git a/storage/xtradb/include/fil0pagecompress.h b/storage/xtradb/include/fil0pagecompress.h index 74f6e45f4fb..e3a7ffbcb49 100644 --- a/storage/xtradb/include/fil0pagecompress.h +++ b/storage/xtradb/include/fil0pagecompress.h @@ -99,7 +99,7 @@ fil_decompress_page( byte* page_buf, /*!< in: preallocated buffer or NULL */ byte* buf, /*!< out: buffer from which to read; in aio this must be appropriately aligned */ - ulint len, /*!< in: length of output buffer.*/ + ulong len, /*!< in: length of output buffer.*/ ulint* write_size); /*!< in/out: Actual payload size of the compressed data. */ diff --git a/storage/xtradb/include/srv0srv.h b/storage/xtradb/include/srv0srv.h index 81b301be8a3..a02c8a96e1a 100644 --- a/storage/xtradb/include/srv0srv.h +++ b/storage/xtradb/include/srv0srv.h @@ -270,7 +270,7 @@ extern my_bool srv_use_posix_fallocate; extern my_bool srv_use_atomic_writes; /* Compression algorithm*/ -extern long innodb_compression_algorithm; +extern ulong innodb_compression_algorithm; /* Number of flush threads */ #define MTFLUSH_MAX_WORKER 64 diff --git a/storage/xtradb/log/log0log.cc b/storage/xtradb/log/log0log.cc index 994471976cf..ee39f5846ca 100644 --- a/storage/xtradb/log/log0log.cc +++ b/storage/xtradb/log/log0log.cc @@ -3043,7 +3043,7 @@ log_archive_do( { ibool calc_new_limit; ib_uint64_t start_lsn; - ib_uint64_t limit_lsn; + ib_uint64_t limit_lsn=0; calc_new_limit = TRUE; loop: diff --git a/storage/xtradb/srv/srv0srv.cc b/storage/xtradb/srv/srv0srv.cc index 71154129155..7c1058f536f 100644 --- a/storage/xtradb/srv/srv0srv.cc +++ b/storage/xtradb/srv/srv0srv.cc @@ -173,7 +173,7 @@ UNIV_INTERN my_bool srv_use_posix_fallocate = FALSE; /* If this flag is TRUE, then we disable doublewrite buffer */ UNIV_INTERN my_bool srv_use_atomic_writes = FALSE; /* If this flag IS TRUE, then we use lz4 to compress/decompress pages */ -UNIV_INTERN long innodb_compression_algorithm = PAGE_ZLIB_ALGORITHM; +UNIV_INTERN ulong innodb_compression_algorithm = PAGE_ZLIB_ALGORITHM; /* Number of threads used for multi-threaded flush */ UNIV_INTERN long srv_mtflush_threads = MTFLUSH_DEFAULT_WORKER; /* If this flag is TRUE, then we will use multi threaded flush. */ diff --git a/storage/xtradb/srv/srv0start.cc b/storage/xtradb/srv/srv0start.cc index aa1ab8a2288..efc75dea34b 100644 --- a/storage/xtradb/srv/srv0start.cc +++ b/storage/xtradb/srv/srv0start.cc @@ -1558,7 +1558,7 @@ innobase_start_or_create_for_mysql(void) lsn_t min_flushed_lsn; lsn_t max_flushed_lsn; #ifdef UNIV_LOG_ARCHIVE - lsn_t min_arch_log_no; + lsn_t min_arch_log_no=0; lsn_t max_arch_log_no; #endif /* UNIV_LOG_ARCHIVE */ ulint sum_of_new_sizes;