Skip to content

Commit

Permalink
MDEV-13932: fil0pagecompress.cc fails to compile with lzo 2.10
Browse files Browse the repository at this point in the history
Patch contibuted by Gordon Fisher. Thank you for your contribution!
  • Loading branch information
Jan Lindström committed Sep 29, 2017
1 parent 4d01dd7 commit b8488e5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
12 changes: 10 additions & 2 deletions storage/innobase/fil/fil0pagecompress.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ fil_compress_page(
int comp_level = level;
ulint header_len = FIL_PAGE_DATA + FIL_PAGE_COMPRESSED_SIZE;
ulint write_size = 0;
#if HAVE_LZO
lzo_uint write_size_lzo = write_size;
#endif
/* Cache to avoid change during function execution */
ulint comp_method = innodb_compression_algorithm;
bool allocated = false;
Expand Down Expand Up @@ -207,7 +210,9 @@ fil_compress_page(
#ifdef HAVE_LZO
case PAGE_LZO_ALGORITHM:
err = lzo1x_1_15_compress(
buf, len, out_buf+header_len, &write_size, out_buf+UNIV_PAGE_SIZE);
buf, len, out_buf+header_len, &write_size_lzo, out_buf+UNIV_PAGE_SIZE);

write_size = write_size_lzo;

if (err != LZO_E_OK || write_size > UNIV_PAGE_SIZE-header_len) {
if (space && !space->printed_compression_failure) {
Expand Down Expand Up @@ -604,8 +609,11 @@ fil_decompress_page(
#ifdef HAVE_LZO
case PAGE_LZO_ALGORITHM: {
ulint olen = 0;
lzo_uint olen_lzo = olen;
err = lzo1x_decompress((const unsigned char *)buf+header_len,
actual_size,(unsigned char *)in_buf, &olen, NULL);
actual_size,(unsigned char *)in_buf, &olen_lzo, NULL);

olen = olen_lzo;

if (err != LZO_E_OK || (olen == 0 || olen > UNIV_PAGE_SIZE)) {
ib_logf(IB_LOG_LEVEL_ERROR,
Expand Down
12 changes: 10 additions & 2 deletions storage/xtradb/fil/fil0pagecompress.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ fil_compress_page(
int comp_level = level;
ulint header_len = FIL_PAGE_DATA + FIL_PAGE_COMPRESSED_SIZE;
ulint write_size = 0;
#if HAVE_LZO
lzo_uint write_size_lzo = write_size;
#endif
/* Cache to avoid change during function execution */
ulint comp_method = innodb_compression_algorithm;
bool allocated = false;
Expand Down Expand Up @@ -207,7 +210,9 @@ fil_compress_page(
#ifdef HAVE_LZO
case PAGE_LZO_ALGORITHM:
err = lzo1x_1_15_compress(
buf, len, out_buf+header_len, &write_size, out_buf+UNIV_PAGE_SIZE);
buf, len, out_buf+header_len, &write_size_lzo, out_buf+UNIV_PAGE_SIZE);

write_size = write_size_lzo;

if (err != LZO_E_OK || write_size > UNIV_PAGE_SIZE-header_len) {
if (space && !space->printed_compression_failure) {
Expand Down Expand Up @@ -604,8 +609,11 @@ fil_decompress_page(
#ifdef HAVE_LZO
case PAGE_LZO_ALGORITHM: {
ulint olen = 0;
lzo_uint olen_lzo = olen;
err = lzo1x_decompress((const unsigned char *)buf+header_len,
actual_size,(unsigned char *)in_buf, &olen, NULL);
actual_size,(unsigned char *)in_buf, &olen_lzo, NULL);

olen = olen_lzo;

if (err != LZO_E_OK || (olen == 0 || olen > UNIV_PAGE_SIZE)) {
ib_logf(IB_LOG_LEVEL_ERROR,
Expand Down

0 comments on commit b8488e5

Please sign in to comment.