1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

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

Fixed bug on function call when InnoDB plugin is used.
This commit is contained in:
Jan Lindström
2014-04-23 19:23:11 +03:00
parent 271ea3c86e
commit 2d340f9a67
6 changed files with 12 additions and 5 deletions

View File

@@ -4997,7 +4997,7 @@ retry:
"space for file \'%s\' failed. Current size "
INT64PF ", desired size " INT64PF "\n",
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;
} else {
success = TRUE;

View File

@@ -70,6 +70,8 @@ static ulint srv_data_read, srv_data_written;
#include "lzo/lzo1x.h"
#endif
/* Used for debugging */
//#define UNIV_PAGECOMPRESS_DEBUG 1
/****************************************************************//**
For page compressed pages compress the page before actual write
@@ -145,7 +147,7 @@ fil_compress_page(
err = lzo1x_1_15_compress(
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,
"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);

View File

@@ -1318,8 +1318,10 @@ os_file_handle_error_no_exit(
/*=========================*/
const char* name, /*!< in: name of a file or NULL */
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. */
const char* file, /*!< in: file name */
const ulint line); /*!< in: line */
#ifndef UNIV_NONINL
#include "os0file.ic"

View File

@@ -370,7 +370,6 @@ os_slot_alloc_page_buf(
/****************************************************************//**
Does error handling when a file operation fails.
@return TRUE if we should retry the operation */
static
ibool
os_file_handle_error_no_exit(
/*=========================*/
@@ -6337,6 +6336,7 @@ os_slot_alloc_page_buf(
byte* cbuf2;
byte* cbuf;
/* We allocate extra to avoid memory overwrite on compression */
cbuf2 = static_cast<byte *>(ut_malloc(UNIV_PAGE_SIZE*2));
cbuf = static_cast<byte *>(ut_align(cbuf2, UNIV_PAGE_SIZE));
slot->page_compression_page = static_cast<byte *>(cbuf2);

View File

@@ -70,6 +70,8 @@ static ulint srv_data_read, srv_data_written;
#include "lzo/lzo1x.h"
#endif
/* Used for debugging */
//#define UNIV_PAGECOMPRESS_DEBUG 1
/****************************************************************//**
For page compressed pages compress the page before actual write
@@ -145,7 +147,7 @@ fil_compress_page(
err = lzo1x_1_15_compress(
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,
"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);

View File

@@ -6406,6 +6406,7 @@ os_slot_alloc_page_buf(
byte* cbuf2;
byte* cbuf;
/* We allocate extra to avoid memory overwrite on compression */
cbuf2 = static_cast<byte *>(ut_malloc(UNIV_PAGE_SIZE*2));
cbuf = static_cast<byte *>(ut_align(cbuf2, UNIV_PAGE_SIZE));
slot->page_compression_page = static_cast<byte *>(cbuf2);