Commit 2d340f9a authored by Jan Lindström's avatar Jan Lindström

Fixed bug on free buffer space calculation when LZO is used.

Fixed bug on function call when InnoDB plugin is used.
parent 271ea3c8
...@@ -4997,7 +4997,7 @@ retry: ...@@ -4997,7 +4997,7 @@ retry:
"space for file \'%s\' failed. Current size " "space for file \'%s\' failed. Current size "
INT64PF ", desired size " INT64PF "\n", INT64PF ", desired size " INT64PF "\n",
node->name, start_offset, len+start_offset); node->name, start_offset, len+start_offset);
os_file_handle_error_no_exit(node->name, "posix_fallocate", FALSE); os_file_handle_error_no_exit(node->name, "posix_fallocate", FALSE, __FILE__, __LINE__);
success = FALSE; success = FALSE;
} else { } else {
success = TRUE; success = TRUE;
......
...@@ -70,6 +70,8 @@ static ulint srv_data_read, srv_data_written; ...@@ -70,6 +70,8 @@ static ulint srv_data_read, srv_data_written;
#include "lzo/lzo1x.h" #include "lzo/lzo1x.h"
#endif #endif
/* Used for debugging */
//#define UNIV_PAGECOMPRESS_DEBUG 1
/****************************************************************//** /****************************************************************//**
For page compressed pages compress the page before actual write For page compressed pages compress the page before actual write
...@@ -145,7 +147,7 @@ fil_compress_page( ...@@ -145,7 +147,7 @@ fil_compress_page(
err = lzo1x_1_15_compress( err = lzo1x_1_15_compress(
buf, len, out_buf+header_len, &write_size, lzo_mem); buf, len, out_buf+header_len, &write_size, lzo_mem);
if (err != LZO_E_OK || write_size > len) { if (err != LZO_E_OK || write_size > UNIV_PAGE_SIZE-header_len) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Warning: Compression failed for space %lu name %s len %lu err %d write_size %lu", "InnoDB: Warning: Compression failed for space %lu name %s len %lu err %d write_size %lu",
space_id, fil_space_name(space), len, err, write_size); space_id, fil_space_name(space), len, err, write_size);
......
...@@ -1318,8 +1318,10 @@ os_file_handle_error_no_exit( ...@@ -1318,8 +1318,10 @@ os_file_handle_error_no_exit(
/*=========================*/ /*=========================*/
const char* name, /*!< in: name of a file or NULL */ const char* name, /*!< in: name of a file or NULL */
const char* operation, /*!< in: operation */ const char* operation, /*!< in: operation */
ibool on_error_silent);/*!< in: if TRUE then don't print ibool on_error_silent,/*!< in: if TRUE then don't print
any message to the log. */ any message to the log. */
const char* file, /*!< in: file name */
const ulint line); /*!< in: line */
#ifndef UNIV_NONINL #ifndef UNIV_NONINL
#include "os0file.ic" #include "os0file.ic"
......
...@@ -370,7 +370,6 @@ os_slot_alloc_page_buf( ...@@ -370,7 +370,6 @@ os_slot_alloc_page_buf(
/****************************************************************//** /****************************************************************//**
Does error handling when a file operation fails. Does error handling when a file operation fails.
@return TRUE if we should retry the operation */ @return TRUE if we should retry the operation */
static
ibool ibool
os_file_handle_error_no_exit( os_file_handle_error_no_exit(
/*=========================*/ /*=========================*/
...@@ -6337,6 +6336,7 @@ os_slot_alloc_page_buf( ...@@ -6337,6 +6336,7 @@ os_slot_alloc_page_buf(
byte* cbuf2; byte* cbuf2;
byte* cbuf; byte* cbuf;
/* We allocate extra to avoid memory overwrite on compression */
cbuf2 = static_cast<byte *>(ut_malloc(UNIV_PAGE_SIZE*2)); cbuf2 = static_cast<byte *>(ut_malloc(UNIV_PAGE_SIZE*2));
cbuf = static_cast<byte *>(ut_align(cbuf2, UNIV_PAGE_SIZE)); cbuf = static_cast<byte *>(ut_align(cbuf2, UNIV_PAGE_SIZE));
slot->page_compression_page = static_cast<byte *>(cbuf2); slot->page_compression_page = static_cast<byte *>(cbuf2);
......
...@@ -70,6 +70,8 @@ static ulint srv_data_read, srv_data_written; ...@@ -70,6 +70,8 @@ static ulint srv_data_read, srv_data_written;
#include "lzo/lzo1x.h" #include "lzo/lzo1x.h"
#endif #endif
/* Used for debugging */
//#define UNIV_PAGECOMPRESS_DEBUG 1
/****************************************************************//** /****************************************************************//**
For page compressed pages compress the page before actual write For page compressed pages compress the page before actual write
...@@ -145,7 +147,7 @@ fil_compress_page( ...@@ -145,7 +147,7 @@ fil_compress_page(
err = lzo1x_1_15_compress( err = lzo1x_1_15_compress(
buf, len, out_buf+header_len, &write_size, lzo_mem); buf, len, out_buf+header_len, &write_size, lzo_mem);
if (err != LZO_E_OK || write_size > len) { if (err != LZO_E_OK || write_size > UNIV_PAGE_SIZE-header_len) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Warning: Compression failed for space %lu name %s len %lu err %d write_size %lu", "InnoDB: Warning: Compression failed for space %lu name %s len %lu err %d write_size %lu",
space_id, fil_space_name(space), len, err, write_size); space_id, fil_space_name(space), len, err, write_size);
......
...@@ -6406,6 +6406,7 @@ os_slot_alloc_page_buf( ...@@ -6406,6 +6406,7 @@ os_slot_alloc_page_buf(
byte* cbuf2; byte* cbuf2;
byte* cbuf; byte* cbuf;
/* We allocate extra to avoid memory overwrite on compression */
cbuf2 = static_cast<byte *>(ut_malloc(UNIV_PAGE_SIZE*2)); cbuf2 = static_cast<byte *>(ut_malloc(UNIV_PAGE_SIZE*2));
cbuf = static_cast<byte *>(ut_align(cbuf2, UNIV_PAGE_SIZE)); cbuf = static_cast<byte *>(ut_align(cbuf2, UNIV_PAGE_SIZE));
slot->page_compression_page = static_cast<byte *>(cbuf2); slot->page_compression_page = static_cast<byte *>(cbuf2);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment