From b5cdc5adcfbb0d4380604187192cd089dd3e11b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Thu, 22 May 2014 16:31:31 +0300 Subject: [PATCH] Fix some compiler warnings and small errors on code. --- storage/innobase/fil/fil0pagecompress.cc | 4 ++-- storage/innobase/handler/ha_innodb.cc | 3 +++ storage/innobase/include/fil0fil.h | 3 --- storage/innobase/include/fil0pagecompress.h | 6 ------ storage/innobase/include/fsp0pagecompress.h | 8 +++++++- storage/innobase/include/fsp0pagecompress.ic | 13 +++++++++---- storage/innobase/include/os0file.h | 1 + storage/innobase/include/srv0srv.h | 2 ++ storage/xtradb/handler/ha_innodb.cc | 3 +++ storage/xtradb/include/fil0pagecompress.h | 6 ------ storage/xtradb/include/fsp0pagecompress.h | 8 +++++++- storage/xtradb/include/fsp0pagecompress.ic | 14 +++++++++----- storage/xtradb/include/os0file.h | 1 + 13 files changed, 44 insertions(+), 28 deletions(-) diff --git a/storage/innobase/fil/fil0pagecompress.cc b/storage/innobase/fil/fil0pagecompress.cc index ce7063bc688..a062f914b80 100644 --- a/storage/innobase/fil/fil0pagecompress.cc +++ b/storage/innobase/fil/fil0pagecompress.cc @@ -325,7 +325,7 @@ fil_decompress_page( if (err != (int)actual_size) { fprintf(stderr, "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", err, actual_size, len); fflush(stderr); @@ -342,7 +342,7 @@ fil_decompress_page( if (err != LZO_E_OK || (olen == 0 || olen > UNIV_PAGE_SIZE)) { fprintf(stderr, "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", olen, actual_size, len); fflush(stderr); diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 84a38473b88..67b81710422 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -17324,6 +17324,9 @@ ib_senderrf( case IB_LOG_LEVEL_FATAL: l = 0; break; + default: + l = 0; + break; } my_printv_error(code, format, MYF(l), args); diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h index 71b09f21d67..a1422f3d11b 100644 --- a/storage/innobase/include/fil0fil.h +++ b/storage/innobase/include/fil0fil.h @@ -133,9 +133,6 @@ extern fil_addr_t fil_addr_null; #define FIL_PAGE_COMPRESSED_SIZE 2 /*!< Number of bytes used to store actual payload data size on compressed pages. */ -#define FIL_PAGE_COMPRESSION_ZLIB 1 /*!< Compressin algorithm ZLIB. */ -#define FIL_PAGE_COMPRESSION_LZ4 2 /*!< Compressin algorithm LZ4. */ - /* @} */ /** File page trailer @{ */ #define FIL_PAGE_END_LSN_OLD_CHKSUM 8 /*!< the low 4 bytes of this are used diff --git a/storage/innobase/include/fil0pagecompress.h b/storage/innobase/include/fil0pagecompress.h index 0cc5aeb4678..74f6e45f4fb 100644 --- a/storage/innobase/include/fil0pagecompress.h +++ b/storage/innobase/include/fil0pagecompress.h @@ -22,12 +22,6 @@ this program; if not, write to the Free Software Foundation, Inc., #include "fsp0fsp.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 Helper functions for extracting/storing page compression and diff --git a/storage/innobase/include/fsp0pagecompress.h b/storage/innobase/include/fsp0pagecompress.h index 4913f1d6b29..f2cd38481f6 100644 --- a/storage/innobase/include/fsp0pagecompress.h +++ b/storage/innobase/include/fsp0pagecompress.h @@ -1,6 +1,6 @@ /***************************************************************************** -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 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 #ifndef 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. @return page compression level, or 0 if uncompressed */ diff --git a/storage/innobase/include/fsp0pagecompress.ic b/storage/innobase/include/fsp0pagecompress.ic index 10f9d30d1f8..65ad90cdfc4 100644 --- a/storage/innobase/include/fsp0pagecompress.ic +++ b/storage/innobase/include/fsp0pagecompress.ic @@ -24,8 +24,6 @@ compression and atomic writes information to file space. 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. @return TRUE if page compressed, FALSE if not page compressed */ @@ -141,14 +139,21 @@ fil_get_compression_alg_name( ulint comp_alg) /*!