Commit b5cdc5ad authored by Jan Lindström's avatar Jan Lindström

Fix some compiler warnings and small errors on code.

parent 972a14b5
...@@ -325,7 +325,7 @@ fil_decompress_page( ...@@ -325,7 +325,7 @@ fil_decompress_page(
if (err != (int)actual_size) { if (err != (int)actual_size) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Corruption: Page is marked as compressed\n" "InnoDB: Corruption: Page is marked as compressed\n"
"InnoDB: but decompression read only %d bytes.\n" "InnoDB: but decompression read only %ld bytes.\n"
"InnoDB: size %lu len %lu\n", "InnoDB: size %lu len %lu\n",
err, actual_size, len); err, actual_size, len);
fflush(stderr); fflush(stderr);
...@@ -342,7 +342,7 @@ fil_decompress_page( ...@@ -342,7 +342,7 @@ fil_decompress_page(
if (err != LZO_E_OK || (olen == 0 || olen > UNIV_PAGE_SIZE)) { if (err != LZO_E_OK || (olen == 0 || olen > UNIV_PAGE_SIZE)) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Corruption: Page is marked as compressed\n" "InnoDB: Corruption: Page is marked as compressed\n"
"InnoDB: but decompression read only %d bytes.\n" "InnoDB: but decompression read only %ld bytes.\n"
"InnoDB: size %lu len %lu\n", "InnoDB: size %lu len %lu\n",
olen, actual_size, len); olen, actual_size, len);
fflush(stderr); fflush(stderr);
......
...@@ -17324,6 +17324,9 @@ ib_senderrf( ...@@ -17324,6 +17324,9 @@ ib_senderrf(
case IB_LOG_LEVEL_FATAL: case IB_LOG_LEVEL_FATAL:
l = 0; l = 0;
break; break;
default:
l = 0;
break;
} }
my_printv_error(code, format, MYF(l), args); my_printv_error(code, format, MYF(l), args);
......
...@@ -133,9 +133,6 @@ extern fil_addr_t fil_addr_null; ...@@ -133,9 +133,6 @@ extern fil_addr_t fil_addr_null;
#define FIL_PAGE_COMPRESSED_SIZE 2 /*!< Number of bytes used to store #define FIL_PAGE_COMPRESSED_SIZE 2 /*!< Number of bytes used to store
actual payload data size on actual payload data size on
compressed pages. */ compressed pages. */
#define FIL_PAGE_COMPRESSION_ZLIB 1 /*!< Compressin algorithm ZLIB. */
#define FIL_PAGE_COMPRESSION_LZ4 2 /*!< Compressin algorithm LZ4. */
/* @} */ /* @} */
/** File page trailer @{ */ /** File page trailer @{ */
#define FIL_PAGE_END_LSN_OLD_CHKSUM 8 /*!< the low 4 bytes of this are used #define FIL_PAGE_END_LSN_OLD_CHKSUM 8 /*!< the low 4 bytes of this are used
......
...@@ -22,12 +22,6 @@ this program; if not, write to the Free Software Foundation, Inc., ...@@ -22,12 +22,6 @@ this program; if not, write to the Free Software Foundation, Inc.,
#include "fsp0fsp.h" #include "fsp0fsp.h"
#include "fsp0pagecompress.h" #include "fsp0pagecompress.h"
#define PAGE_UNCOMPRESSED 0
#define PAGE_ZLIB_ALGORITHM 1
#define PAGE_LZ4_ALGORITHM 2
#define PAGE_LZO_ALGORITHM 3
#define PAGE_ALGORITHM_LAST PAGE_LZO_ALGORITHM
/******************************************************************//** /******************************************************************//**
@file include/fil0pagecompress.h @file include/fil0pagecompress.h
Helper functions for extracting/storing page compression and Helper functions for extracting/storing page compression and
......
/***************************************************************************** /*****************************************************************************
Copyright (C) 2013 SkySQL Ab. All Rights Reserved. Copyright (C) 2013, 2014 SkySQL Ab. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
...@@ -27,6 +27,12 @@ Created 11/12/2013 Jan Lindström jan.lindstrom@skysql.com ...@@ -27,6 +27,12 @@ Created 11/12/2013 Jan Lindström jan.lindstrom@skysql.com
#ifndef fsp0pagecompress_h #ifndef fsp0pagecompress_h
#define fsp0pagecompress_h #define fsp0pagecompress_h
#define PAGE_UNCOMPRESSED 0
#define PAGE_ZLIB_ALGORITHM 1
#define PAGE_LZ4_ALGORITHM 2
#define PAGE_LZO_ALGORITHM 3
#define PAGE_ALGORITHM_LAST PAGE_LZO_ALGORITHM
/**********************************************************************//** /**********************************************************************//**
Reads the page compression level from the first page of a tablespace. Reads the page compression level from the first page of a tablespace.
@return page compression level, or 0 if uncompressed */ @return page compression level, or 0 if uncompressed */
......
...@@ -24,8 +24,6 @@ compression and atomic writes information to file space. ...@@ -24,8 +24,6 @@ compression and atomic writes information to file space.
Created 11/12/2013 Jan Lindström jan.lindstrom@skysql.com Created 11/12/2013 Jan Lindström jan.lindstrom@skysql.com
***********************************************************************/ ***********************************************************************/
#include "fsp0fsp.h"
/********************************************************************//** /********************************************************************//**
Determine if the tablespace is page compressed from dict_table_t::flags. Determine if the tablespace is page compressed from dict_table_t::flags.
@return TRUE if page compressed, FALSE if not page compressed */ @return TRUE if page compressed, FALSE if not page compressed */
...@@ -141,14 +139,21 @@ fil_get_compression_alg_name( ...@@ -141,14 +139,21 @@ fil_get_compression_alg_name(
ulint comp_alg) /*!<in: compression algorithm number */ ulint comp_alg) /*!<in: compression algorithm number */
{ {
switch(comp_alg) { switch(comp_alg) {
case FIL_PAGE_COMPRESSION_ZLIB: case PAGE_UNCOMPRESSED:
return ("uncompressed");
break;
case PAGE_ZLIB_ALGORITHM:
return ("ZLIB"); return ("ZLIB");
break; break;
case FIL_PAGE_COMPRESSION_LZ4: case PAGE_LZ4_ALGORITHM:
return ("LZ4"); return ("LZ4");
break; break;
case PAGE_LZO_ALGORITHM:
return ("LZO");
break;
default: default:
return("UNKNOWN"); return("UNKNOWN");
ut_error;
break; break;
} }
} }
......
...@@ -152,6 +152,7 @@ enum os_file_create_t { ...@@ -152,6 +152,7 @@ enum os_file_create_t {
#define OS_FILE_AIO_INTERRUPTED 79 #define OS_FILE_AIO_INTERRUPTED 79
#define OS_FILE_OPERATION_ABORTED 80 #define OS_FILE_OPERATION_ABORTED 80
#define OS_FILE_OPERATION_NOT_SUPPORTED 125 #define OS_FILE_OPERATION_NOT_SUPPORTED 125
#define OS_FILE_ERROR_MAX 200
/* @} */ /* @} */
/** Types for aio operations @{ */ /** Types for aio operations @{ */
......
...@@ -244,7 +244,9 @@ extern my_bool srv_use_native_aio; ...@@ -244,7 +244,9 @@ extern my_bool srv_use_native_aio;
extern my_bool srv_use_trim; extern my_bool srv_use_trim;
/* Use posix fallocate */ /* Use posix fallocate */
#ifdef HAVE_POSIX_FALLOCATE
extern my_bool srv_use_posix_fallocate; extern my_bool srv_use_posix_fallocate;
#endif
/* Use atomic writes i.e disable doublewrite buffer */ /* Use atomic writes i.e disable doublewrite buffer */
extern my_bool srv_use_atomic_writes; extern my_bool srv_use_atomic_writes;
......
...@@ -18468,6 +18468,9 @@ ib_senderrf( ...@@ -18468,6 +18468,9 @@ ib_senderrf(
case IB_LOG_LEVEL_FATAL: case IB_LOG_LEVEL_FATAL:
l = 0; l = 0;
break; break;
default:
l = 0;
break;
} }
my_printv_error(code, format, MYF(l), args); my_printv_error(code, format, MYF(l), args);
......
...@@ -22,12 +22,6 @@ this program; if not, write to the Free Software Foundation, Inc., ...@@ -22,12 +22,6 @@ this program; if not, write to the Free Software Foundation, Inc.,
#include "fsp0fsp.h" #include "fsp0fsp.h"
#include "fsp0pagecompress.h" #include "fsp0pagecompress.h"
#define PAGE_UNCOMPRESSED 0
#define PAGE_ZLIB_ALGORITHM 1
#define PAGE_LZ4_ALGORITHM 2
#define PAGE_LZO_ALGORITHM 3
#define PAGE_ALGORITHM_LAST PAGE_LZO_ALGORITHM
/******************************************************************//** /******************************************************************//**
@file include/fil0pagecompress.h @file include/fil0pagecompress.h
Helper functions for extracting/storing page compression and Helper functions for extracting/storing page compression and
......
/***************************************************************************** /*****************************************************************************
Copyright (C) 2013 SkySQL Ab. All Rights Reserved. Copyright (C) 2013, 2014 SkySQL Ab. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
...@@ -27,6 +27,12 @@ Created 11/12/2013 Jan Lindström jan.lindstrom@skysql.com ...@@ -27,6 +27,12 @@ Created 11/12/2013 Jan Lindström jan.lindstrom@skysql.com
#ifndef fsp0pagecompress_h #ifndef fsp0pagecompress_h
#define fsp0pagecompress_h #define fsp0pagecompress_h
#define PAGE_UNCOMPRESSED 0
#define PAGE_ZLIB_ALGORITHM 1
#define PAGE_LZ4_ALGORITHM 2
#define PAGE_LZO_ALGORITHM 3
#define PAGE_ALGORITHM_LAST PAGE_LZO_ALGORITHM
/**********************************************************************//** /**********************************************************************//**
Reads the page compression level from the first page of a tablespace. Reads the page compression level from the first page of a tablespace.
@return page compression level, or 0 if uncompressed */ @return page compression level, or 0 if uncompressed */
......
...@@ -24,9 +24,6 @@ compression and atomic writes information to file space. ...@@ -24,9 +24,6 @@ compression and atomic writes information to file space.
Created 11/12/2013 Jan Lindström jan.lindstrom@skysql.com Created 11/12/2013 Jan Lindström jan.lindstrom@skysql.com
***********************************************************************/ ***********************************************************************/
#include "fsp0fsp.h"
/********************************************************************//** /********************************************************************//**
Determine if the tablespace is page compressed from dict_table_t::flags. Determine if the tablespace is page compressed from dict_table_t::flags.
@return TRUE if page compressed, FALSE if not page compressed */ @return TRUE if page compressed, FALSE if not page compressed */
...@@ -142,14 +139,21 @@ fil_get_compression_alg_name( ...@@ -142,14 +139,21 @@ fil_get_compression_alg_name(
ulint comp_alg) /*!<in: compression algorithm number */ ulint comp_alg) /*!<in: compression algorithm number */
{ {
switch(comp_alg) { switch(comp_alg) {
case FIL_PAGE_COMPRESSION_ZLIB: case PAGE_UNCOMPRESSED:
return ("uncompressed");
break;
case PAGE_ZLIB_ALGORITHM:
return ("ZLIB"); return ("ZLIB");
break; break;
case FIL_PAGE_COMPRESSION_LZ4: case PAGE_LZ4_ALGORITHM:
return ("LZ4"); return ("LZ4");
break; break;
case PAGE_LZO_ALGORITHM:
return ("LZO");
break;
default: default:
return("UNKNOWN"); return("UNKNOWN");
ut_error;
break; break;
} }
} }
......
...@@ -157,6 +157,7 @@ enum os_file_create_t { ...@@ -157,6 +157,7 @@ enum os_file_create_t {
#define OS_FILE_AIO_INTERRUPTED 79 #define OS_FILE_AIO_INTERRUPTED 79
#define OS_FILE_OPERATION_ABORTED 80 #define OS_FILE_OPERATION_ABORTED 80
#define OS_FILE_OPERATION_NOT_SUPPORTED 125 #define OS_FILE_OPERATION_NOT_SUPPORTED 125
#define OS_FILE_ERROR_MAX 200
/* @} */ /* @} */
/** Types for aio operations @{ */ /** Types for aio operations @{ */
......
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