Skip to content

Commit b5cdc5a

Browse files
author
Jan Lindström
committed
Fix some compiler warnings and small errors on code.
1 parent 972a14b commit b5cdc5a

File tree

13 files changed

+44
-28
lines changed

13 files changed

+44
-28
lines changed

storage/innobase/fil/fil0pagecompress.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ fil_decompress_page(
325325
if (err != (int)actual_size) {
326326
fprintf(stderr,
327327
"InnoDB: Corruption: Page is marked as compressed\n"
328-
"InnoDB: but decompression read only %d bytes.\n"
328+
"InnoDB: but decompression read only %ld bytes.\n"
329329
"InnoDB: size %lu len %lu\n",
330330
err, actual_size, len);
331331
fflush(stderr);
@@ -342,7 +342,7 @@ fil_decompress_page(
342342
if (err != LZO_E_OK || (olen == 0 || olen > UNIV_PAGE_SIZE)) {
343343
fprintf(stderr,
344344
"InnoDB: Corruption: Page is marked as compressed\n"
345-
"InnoDB: but decompression read only %d bytes.\n"
345+
"InnoDB: but decompression read only %ld bytes.\n"
346346
"InnoDB: size %lu len %lu\n",
347347
olen, actual_size, len);
348348
fflush(stderr);

storage/innobase/handler/ha_innodb.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17324,6 +17324,9 @@ ib_senderrf(
1732417324
case IB_LOG_LEVEL_FATAL:
1732517325
l = 0;
1732617326
break;
17327+
default:
17328+
l = 0;
17329+
break;
1732717330
}
1732817331

1732917332
my_printv_error(code, format, MYF(l), args);

storage/innobase/include/fil0fil.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,6 @@ extern fil_addr_t fil_addr_null;
133133
#define FIL_PAGE_COMPRESSED_SIZE 2 /*!< Number of bytes used to store
134134
actual payload data size on
135135
compressed pages. */
136-
#define FIL_PAGE_COMPRESSION_ZLIB 1 /*!< Compressin algorithm ZLIB. */
137-
#define FIL_PAGE_COMPRESSION_LZ4 2 /*!< Compressin algorithm LZ4. */
138-
139136
/* @} */
140137
/** File page trailer @{ */
141138
#define FIL_PAGE_END_LSN_OLD_CHKSUM 8 /*!< the low 4 bytes of this are used

storage/innobase/include/fil0pagecompress.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ this program; if not, write to the Free Software Foundation, Inc.,
2222
#include "fsp0fsp.h"
2323
#include "fsp0pagecompress.h"
2424

25-
#define PAGE_UNCOMPRESSED 0
26-
#define PAGE_ZLIB_ALGORITHM 1
27-
#define PAGE_LZ4_ALGORITHM 2
28-
#define PAGE_LZO_ALGORITHM 3
29-
#define PAGE_ALGORITHM_LAST PAGE_LZO_ALGORITHM
30-
3125
/******************************************************************//**
3226
@file include/fil0pagecompress.h
3327
Helper functions for extracting/storing page compression and

storage/innobase/include/fsp0pagecompress.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
3-
Copyright (C) 2013 SkySQL Ab. All Rights Reserved.
3+
Copyright (C) 2013, 2014 SkySQL Ab. All Rights Reserved.
44
55
This program is free software; you can redistribute it and/or modify it under
66
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
2727
#ifndef fsp0pagecompress_h
2828
#define fsp0pagecompress_h
2929

30+
#define PAGE_UNCOMPRESSED 0
31+
#define PAGE_ZLIB_ALGORITHM 1
32+
#define PAGE_LZ4_ALGORITHM 2
33+
#define PAGE_LZO_ALGORITHM 3
34+
#define PAGE_ALGORITHM_LAST PAGE_LZO_ALGORITHM
35+
3036
/**********************************************************************//**
3137
Reads the page compression level from the first page of a tablespace.
3238
@return page compression level, or 0 if uncompressed */

storage/innobase/include/fsp0pagecompress.ic

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ compression and atomic writes information to file space.
2424
Created 11/12/2013 Jan Lindström jan.lindstrom@skysql.com
2525
***********************************************************************/
2626

27-
#include "fsp0fsp.h"
28-
2927
/********************************************************************//**
3028
Determine if the tablespace is page compressed from dict_table_t::flags.
3129
@return TRUE if page compressed, FALSE if not page compressed */
@@ -141,14 +139,21 @@ fil_get_compression_alg_name(
141139
ulint comp_alg) /*!<in: compression algorithm number */
142140
{
143141
switch(comp_alg) {
144-
case FIL_PAGE_COMPRESSION_ZLIB:
142+
case PAGE_UNCOMPRESSED:
143+
return ("uncompressed");
144+
break;
145+
case PAGE_ZLIB_ALGORITHM:
145146
return ("ZLIB");
146147
break;
147-
case FIL_PAGE_COMPRESSION_LZ4:
148+
case PAGE_LZ4_ALGORITHM:
148149
return ("LZ4");
149150
break;
151+
case PAGE_LZO_ALGORITHM:
152+
return ("LZO");
153+
break;
150154
default:
151155
return("UNKNOWN");
156+
ut_error;
152157
break;
153158
}
154159
}

storage/innobase/include/os0file.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ enum os_file_create_t {
152152
#define OS_FILE_AIO_INTERRUPTED 79
153153
#define OS_FILE_OPERATION_ABORTED 80
154154
#define OS_FILE_OPERATION_NOT_SUPPORTED 125
155+
#define OS_FILE_ERROR_MAX 200
155156
/* @} */
156157

157158
/** Types for aio operations @{ */

storage/innobase/include/srv0srv.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,9 @@ extern my_bool srv_use_native_aio;
244244
extern my_bool srv_use_trim;
245245

246246
/* Use posix fallocate */
247+
#ifdef HAVE_POSIX_FALLOCATE
247248
extern my_bool srv_use_posix_fallocate;
249+
#endif
248250

249251
/* Use atomic writes i.e disable doublewrite buffer */
250252
extern my_bool srv_use_atomic_writes;

storage/xtradb/handler/ha_innodb.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18468,6 +18468,9 @@ ib_senderrf(
1846818468
case IB_LOG_LEVEL_FATAL:
1846918469
l = 0;
1847018470
break;
18471+
default:
18472+
l = 0;
18473+
break;
1847118474
}
1847218475

1847318476
my_printv_error(code, format, MYF(l), args);

storage/xtradb/include/fil0pagecompress.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ this program; if not, write to the Free Software Foundation, Inc.,
2222
#include "fsp0fsp.h"
2323
#include "fsp0pagecompress.h"
2424

25-
#define PAGE_UNCOMPRESSED 0
26-
#define PAGE_ZLIB_ALGORITHM 1
27-
#define PAGE_LZ4_ALGORITHM 2
28-
#define PAGE_LZO_ALGORITHM 3
29-
#define PAGE_ALGORITHM_LAST PAGE_LZO_ALGORITHM
30-
3125
/******************************************************************//**
3226
@file include/fil0pagecompress.h
3327
Helper functions for extracting/storing page compression and

storage/xtradb/include/fsp0pagecompress.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
3-
Copyright (C) 2013 SkySQL Ab. All Rights Reserved.
3+
Copyright (C) 2013, 2014 SkySQL Ab. All Rights Reserved.
44
55
This program is free software; you can redistribute it and/or modify it under
66
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
2727
#ifndef fsp0pagecompress_h
2828
#define fsp0pagecompress_h
2929

30+
#define PAGE_UNCOMPRESSED 0
31+
#define PAGE_ZLIB_ALGORITHM 1
32+
#define PAGE_LZ4_ALGORITHM 2
33+
#define PAGE_LZO_ALGORITHM 3
34+
#define PAGE_ALGORITHM_LAST PAGE_LZO_ALGORITHM
35+
3036
/**********************************************************************//**
3137
Reads the page compression level from the first page of a tablespace.
3238
@return page compression level, or 0 if uncompressed */

storage/xtradb/include/fsp0pagecompress.ic

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ compression and atomic writes information to file space.
2424
Created 11/12/2013 Jan Lindström jan.lindstrom@skysql.com
2525
***********************************************************************/
2626

27-
#include "fsp0fsp.h"
28-
29-
3027
/********************************************************************//**
3128
Determine if the tablespace is page compressed from dict_table_t::flags.
3229
@return TRUE if page compressed, FALSE if not page compressed */
@@ -142,14 +139,21 @@ fil_get_compression_alg_name(
142139
ulint comp_alg) /*!<in: compression algorithm number */
143140
{
144141
switch(comp_alg) {
145-
case FIL_PAGE_COMPRESSION_ZLIB:
142+
case PAGE_UNCOMPRESSED:
143+
return ("uncompressed");
144+
break;
145+
case PAGE_ZLIB_ALGORITHM:
146146
return ("ZLIB");
147147
break;
148-
case FIL_PAGE_COMPRESSION_LZ4:
148+
case PAGE_LZ4_ALGORITHM:
149149
return ("LZ4");
150150
break;
151+
case PAGE_LZO_ALGORITHM:
152+
return ("LZO");
153+
break;
151154
default:
152155
return("UNKNOWN");
156+
ut_error;
153157
break;
154158
}
155159
}

storage/xtradb/include/os0file.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ enum os_file_create_t {
157157
#define OS_FILE_AIO_INTERRUPTED 79
158158
#define OS_FILE_OPERATION_ABORTED 80
159159
#define OS_FILE_OPERATION_NOT_SUPPORTED 125
160+
#define OS_FILE_ERROR_MAX 200
160161
/* @} */
161162

162163
/** Types for aio operations @{ */

0 commit comments

Comments
 (0)