summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2016-11-25 06:09:00 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2016-11-25 09:09:51 +0200
commit8da33e3a868e7ab4472823f8f3bfab3d5cd1833e (patch)
treeb255d46a4c0afe7c2ad6396eda024989ebea65be
parent1d8eafbeafbc4a77153d6ceb974dbbeff543e648 (diff)
downloadmariadb-git-8da33e3a868e7ab4472823f8f3bfab3d5cd1833e.tar.gz
MDEV-11349 (1/2) Fix some clang 4.0 warnings
In InnoDB and XtraDB functions that declare pointer parameters as nonnull, remove nullness checks, because GCC would optimize them away anyway. Use #ifdef instead of #if when checking for a configuration flag. Clang says that left shifts of negative values are undefined. So, use ~0U instead of ~0 in a number of macros. Some functions that were defined as UNIV_INLINE were declared as UNIV_INTERN. Consistently use the same type of linkage. ibuf_merge_or_delete_for_page() could pass bitmap_page=NULL to buf_page_print(), conflicting with the __attribute__((nonnull)).
-rw-r--r--storage/innobase/btr/btr0cur.cc4
-rw-r--r--storage/innobase/dict/dict0dict.cc7
-rw-r--r--storage/innobase/handler/ha_innodb.cc2
-rw-r--r--storage/innobase/ibuf/ibuf0ibuf.cc10
-rw-r--r--storage/innobase/include/buf0buf.h2
-rw-r--r--storage/innobase/include/dict0mem.h12
-rw-r--r--storage/innobase/include/fil0pagecompress.h18
-rw-r--r--storage/innobase/include/fsp0fsp.h8
-rw-r--r--storage/innobase/lock/lock0lock.cc1
-rw-r--r--storage/innobase/row/row0merge.cc5
-rw-r--r--storage/innobase/row/row0upd.cc3
-rw-r--r--storage/innobase/sync/sync0sync.cc3
-rw-r--r--storage/xtradb/btr/btr0cur.cc8
-rw-r--r--storage/xtradb/buf/buf0buf.cc9
-rw-r--r--storage/xtradb/dict/dict0dict.cc7
-rw-r--r--storage/xtradb/handler/ha_innodb.cc2
-rw-r--r--storage/xtradb/ibuf/ibuf0ibuf.cc10
-rw-r--r--storage/xtradb/include/dict0mem.h12
-rw-r--r--storage/xtradb/include/fil0pagecompress.h18
-rw-r--r--storage/xtradb/include/fsp0fsp.h15
-rw-r--r--storage/xtradb/include/page0page.ic3
-rw-r--r--storage/xtradb/lock/lock0lock.cc1
-rw-r--r--storage/xtradb/page/page0zip.cc4
-rw-r--r--storage/xtradb/row/row0merge.cc5
-rw-r--r--storage/xtradb/row/row0upd.cc3
-rw-r--r--storage/xtradb/sync/sync0sync.cc3
26 files changed, 74 insertions, 101 deletions
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc
index 18f193094e2..77b915bce92 100644
--- a/storage/innobase/btr/btr0cur.cc
+++ b/storage/innobase/btr/btr0cur.cc
@@ -3038,7 +3038,7 @@ btr_cur_del_mark_set_clust_rec(
ut_ad(page_is_leaf(page_align(rec)));
#ifdef UNIV_DEBUG
- if (btr_cur_print_record_ops && (thr != NULL)) {
+ if (btr_cur_print_record_ops) {
btr_cur_trx_report(thr_get_trx(thr)->id, index, "del mark ");
rec_print_new(stderr, rec, offsets);
}
@@ -3186,7 +3186,7 @@ btr_cur_del_mark_set_sec_rec(
rec = btr_cur_get_rec(cursor);
#ifdef UNIV_DEBUG
- if (btr_cur_print_record_ops && (thr != NULL)) {
+ if (btr_cur_print_record_ops) {
btr_cur_trx_report(thr_get_trx(thr)->id, cursor->index,
"del mark ");
rec_print(stderr, rec, cursor->index);
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc
index 0310e5e1d66..4685ba3085d 100644
--- a/storage/innobase/dict/dict0dict.cc
+++ b/storage/innobase/dict/dict0dict.cc
@@ -6317,15 +6317,10 @@ dict_set_corrupted_index_cache_only(
/* Mark the table as corrupted only if the clustered index
is corrupted */
if (dict_index_is_clust(index)) {
- dict_table_t* corrupt_table;
-
- corrupt_table = (table != NULL) ? table : index->table;
ut_ad((index->table != NULL) || (table != NULL)
|| index->table == table);
- if (corrupt_table) {
- corrupt_table->corrupted = TRUE;
- }
+ table->corrupted = TRUE;
}
index->type |= DICT_CORRUPT;
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 79d8ae0dc81..553d48aa48f 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -18659,7 +18659,7 @@ wsrep_fake_trx_id(
trx_id_t trx_id = trx_sys_get_new_trx_id();
mutex_exit(&trx_sys->mutex);
- (void *)wsrep_ws_handle_for_trx(wsrep_thd_ws_handle(thd), trx_id);
+ wsrep_ws_handle_for_trx(wsrep_thd_ws_handle(thd), trx_id);
}
#endif /* WITH_WSREP */
diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc
index fcf0388d80a..08f2967a495 100644
--- a/storage/innobase/ibuf/ibuf0ibuf.cc
+++ b/storage/innobase/ibuf/ibuf0ibuf.cc
@@ -4690,8 +4690,14 @@ ibuf_merge_or_delete_for_page(
bitmap_page = ibuf_bitmap_get_map_page(space, page_no,
zip_size, &mtr);
- buf_page_print(bitmap_page, 0,
- BUF_PAGE_PRINT_NO_CRASH);
+ if (bitmap_page == NULL)
+ {
+ fputs("InnoDB: cannot retrieve bitmap page\n",
+ stderr);
+ } else {
+ buf_page_print(bitmap_page, 0,
+ BUF_PAGE_PRINT_NO_CRASH);
+ }
ibuf_mtr_commit(&mtr);
fputs("\nInnoDB: Dump of the page:\n", stderr);
diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
index c737f3a6f1d..d7de9d81ca2 100644
--- a/storage/innobase/include/buf0buf.h
+++ b/storage/innobase/include/buf0buf.h
@@ -1920,7 +1920,7 @@ protected:
/** Buffer pool instance */
const buf_pool_t* m_buf_pool;
-#if UNIV_DEBUG
+#ifdef UNIV_DEBUG
/** mutex that protects access to the m_hp. */
const ib_mutex_t* m_mutex;
#endif /* UNIV_DEBUG */
diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h
index f2d72de39e5..902b960eaa3 100644
--- a/storage/innobase/include/dict0mem.h
+++ b/storage/innobase/include/dict0mem.h
@@ -159,7 +159,7 @@ DEFAULT=0, ON = 1, OFF = 2
+ DICT_TF_WIDTH_PAGE_ENCRYPTION_KEY)
/** A mask of all the known/used bits in table flags */
-#define DICT_TF_BIT_MASK (~(~0 << DICT_TF_BITS))
+#define DICT_TF_BIT_MASK (~(~0U << DICT_TF_BITS))
/** Zero relative shift position of the COMPACT field */
#define DICT_TF_POS_COMPACT 0
@@ -208,23 +208,23 @@ DEFAULT=0, ON = 1, OFF = 2
<< DICT_TF_POS_DATA_DIR)
/** Bit mask of the PAGE_COMPRESSION field */
#define DICT_TF_MASK_PAGE_COMPRESSION \
- ((~(~0 << DICT_TF_WIDTH_PAGE_COMPRESSION)) \
+ ((~(~0U << DICT_TF_WIDTH_PAGE_COMPRESSION)) \
<< DICT_TF_POS_PAGE_COMPRESSION)
/** Bit mask of the PAGE_COMPRESSION_LEVEL field */
#define DICT_TF_MASK_PAGE_COMPRESSION_LEVEL \
- ((~(~0 << DICT_TF_WIDTH_PAGE_COMPRESSION_LEVEL)) \
+ ((~(~0U << DICT_TF_WIDTH_PAGE_COMPRESSION_LEVEL)) \
<< DICT_TF_POS_PAGE_COMPRESSION_LEVEL)
/** Bit mask of the ATOMIC_WRITES field */
#define DICT_TF_MASK_ATOMIC_WRITES \
- ((~(~0 << DICT_TF_WIDTH_ATOMIC_WRITES)) \
+ ((~(~0U << DICT_TF_WIDTH_ATOMIC_WRITES)) \
<< DICT_TF_POS_ATOMIC_WRITES)
/** Bit mask of the PAGE_ENCRYPTION field */
#define DICT_TF_MASK_PAGE_ENCRYPTION \
- ((~(~0 << DICT_TF_WIDTH_PAGE_ENCRYPTION)) \
+ ((~(~0U << DICT_TF_WIDTH_PAGE_ENCRYPTION)) \
<< DICT_TF_POS_PAGE_ENCRYPTION)
/** Bit mask of the PAGE_ENCRYPTION_KEY field */
#define DICT_TF_MASK_PAGE_ENCRYPTION_KEY \
- ((~(~0 << DICT_TF_WIDTH_PAGE_ENCRYPTION_KEY)) \
+ ((~(~0U << DICT_TF_WIDTH_PAGE_ENCRYPTION_KEY)) \
<< DICT_TF_POS_PAGE_ENCRYPTION_KEY)
/** Return the value of the COMPACT field */
diff --git a/storage/innobase/include/fil0pagecompress.h b/storage/innobase/include/fil0pagecompress.h
index 99a05f14ffe..10db59fb218 100644
--- a/storage/innobase/include/fil0pagecompress.h
+++ b/storage/innobase/include/fil0pagecompress.h
@@ -34,7 +34,7 @@ Created 11/12/2013 Jan Lindström jan.lindstrom@skysql.com
Returns the page compression level flag of the space, or 0 if the space
is not compressed. The tablespace must be cached in the memory cache.
@return page compression level if page compressed, ULINT_UNDEFINED if space not found */
-UNIV_INTERN
+UNIV_INLINE
ulint
fil_space_get_page_compression_level(
/*=================================*/
@@ -43,7 +43,7 @@ fil_space_get_page_compression_level(
Returns the page compression flag of the space, or false if the space
is not compressed. The tablespace must be cached in the memory cache.
@return true if page compressed, false if not or space not found */
-UNIV_INTERN
+UNIV_INLINE
ibool
fil_space_is_page_compressed(
/*=========================*/
@@ -61,7 +61,7 @@ fil_space_get_page_compressed(
Returns the atomic writes flag of the space, or false if the space
is not using atomic writes. The tablespace must be cached in the memory cache.
@return atomic write table option value */
-UNIV_INTERN
+UNIV_INLINE
atomic_writes_t
fil_space_get_atomic_writes(
/*=========================*/
@@ -69,7 +69,7 @@ fil_space_get_atomic_writes(
/*******************************************************************//**
Find out wheather the page is index page or not
@return true if page type index page, false if not */
-UNIV_INTERN
+UNIV_INLINE
ibool
fil_page_is_index_page(
/*===================*/
@@ -79,7 +79,7 @@ fil_page_is_index_page(
Get the name of the compression algorithm used for page
compression.
@return compression algorithm name or "UNKNOWN" if not known*/
-UNIV_INTERN
+UNIV_INLINE
const char*
fil_get_compression_alg_name(
/*=========================*/
@@ -136,7 +136,7 @@ fil_node_get_space_id(
/****************************************************************//**
Get block size from fil node
@return block size*/
-UNIV_INTERN
+UNIV_INLINE
ulint
fil_node_get_block_size(
fil_node_t* node); /*!< in: Node where to get block
@@ -144,7 +144,7 @@ fil_node_get_block_size(
/*******************************************************************//**
Find out wheather the page is page compressed
@return true if page is page compressed*/
-UNIV_INTERN
+UNIV_INLINE
ibool
fil_page_is_compressed(
/*===================*/
@@ -153,7 +153,7 @@ fil_page_is_compressed(
/*******************************************************************//**
Find out wheather the page is page compressed
@return true if page is page compressed*/
-UNIV_INTERN
+UNIV_INLINE
ibool
fil_page_is_compressed_encrypted(
/*=============================*/
@@ -162,7 +162,7 @@ fil_page_is_compressed_encrypted(
/*******************************************************************//**
Find out wheather the page is page compressed with lzo method
@return true if page is page compressed with lzo method*/
-UNIV_INTERN
+UNIV_INLINE
ibool
fil_page_is_lzo_compressed(
/*=======================*/
diff --git a/storage/innobase/include/fsp0fsp.h b/storage/innobase/include/fsp0fsp.h
index b9ff05b4bd4..abcd5721a47 100644
--- a/storage/innobase/include/fsp0fsp.h
+++ b/storage/innobase/include/fsp0fsp.h
@@ -129,19 +129,19 @@ dictionary */
<< FSP_FLAGS_POS_DATA_DIR)
/** Bit mask of the DATA_DIR field */
#define FSP_FLAGS_MASK_DATA_DIR_ORACLE \
- ((~(~0 << FSP_FLAGS_WIDTH_DATA_DIR)) \
+ ((~(~0U << FSP_FLAGS_WIDTH_DATA_DIR)) \
<< FSP_FLAGS_POS_DATA_DIR_ORACLE)
/** Bit mask of the PAGE_COMPRESSION field */
#define FSP_FLAGS_MASK_PAGE_COMPRESSION \
- ((~(~0 << FSP_FLAGS_WIDTH_PAGE_COMPRESSION)) \
+ ((~(~0U << FSP_FLAGS_WIDTH_PAGE_COMPRESSION)) \
<< FSP_FLAGS_POS_PAGE_COMPRESSION)
/** Bit mask of the PAGE_COMPRESSION_LEVEL field */
#define FSP_FLAGS_MASK_PAGE_COMPRESSION_LEVEL \
- ((~(~0 << FSP_FLAGS_WIDTH_PAGE_COMPRESSION_LEVEL)) \
+ ((~(~0U << FSP_FLAGS_WIDTH_PAGE_COMPRESSION_LEVEL)) \
<< FSP_FLAGS_POS_PAGE_COMPRESSION_LEVEL)
/** Bit mask of the ATOMIC_WRITES field */
#define FSP_FLAGS_MASK_ATOMIC_WRITES \
- ((~(~0 << FSP_FLAGS_WIDTH_ATOMIC_WRITES)) \
+ ((~(~0U << FSP_FLAGS_WIDTH_ATOMIC_WRITES)) \
<< FSP_FLAGS_POS_ATOMIC_WRITES)
/** Return the value of the POST_ANTELOPE field */
#define FSP_FLAGS_GET_POST_ANTELOPE(flags) \
diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc
index c4f9b767afe..9f15c7b3b37 100644
--- a/storage/innobase/lock/lock0lock.cc
+++ b/storage/innobase/lock/lock0lock.cc
@@ -2366,7 +2366,6 @@ lock_queue_validate(
ulint space;
ulint page_no;
ulint rec_fold;
- hash_table_t* hash;
hash_cell_t* cell;
lock_t* next;
bool wait_lock = false;
diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc
index bdedd0da85c..12b3cf1f572 100644
--- a/storage/innobase/row/row0merge.cc
+++ b/storage/innobase/row/row0merge.cc
@@ -4192,9 +4192,10 @@ wait_again:
(total_static_cost + total_dynamic_cost)
* PCT_COST_MERGESORT_INDEX * 100;
- bufend = innobase_convert_name(buf, sizeof buf,
+ bufend = innobase_convert_name(
+ buf, sizeof buf,
indexes[i]->name, strlen(indexes[i]->name),
- trx ? trx->mysql_thd : NULL,
+ trx->mysql_thd,
FALSE);
buf[bufend - buf]='\0';
diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc
index 60b490228b1..54bf50cba3d 100644
--- a/storage/innobase/row/row0upd.cc
+++ b/storage/innobase/row/row0upd.cc
@@ -2789,9 +2789,6 @@ row_upd(
{
dberr_t err = DB_SUCCESS;
- ut_ad(node != NULL);
- ut_ad(thr != NULL);
-
if (UNIV_LIKELY(node->in_mysql_interface)) {
/* We do not get the cmpl_info value from the MySQL
diff --git a/storage/innobase/sync/sync0sync.cc b/storage/innobase/sync/sync0sync.cc
index 3e3ce353724..e4e5bd7109f 100644
--- a/storage/innobase/sync/sync0sync.cc
+++ b/storage/innobase/sync/sync0sync.cc
@@ -222,9 +222,6 @@ UNIV_INTERN mysql_pfs_key_t mutex_list_mutex_key;
/** Latching order checks start when this is set TRUE */
UNIV_INTERN ibool sync_order_checks_on = FALSE;
-/** Number of slots reserved for each OS thread in the sync level array */
-static const ulint SYNC_THREAD_N_LEVELS = 10000;
-
/** Array for tracking sync levels per thread. */
typedef std::vector<sync_level_t> sync_arr_t;
diff --git a/storage/xtradb/btr/btr0cur.cc b/storage/xtradb/btr/btr0cur.cc
index 5449397f832..afe2c181594 100644
--- a/storage/xtradb/btr/btr0cur.cc
+++ b/storage/xtradb/btr/btr0cur.cc
@@ -1862,9 +1862,7 @@ btr_cur_upd_lock_and_undo(
const rec_t* rec;
dberr_t err;
- ut_ad((thr != NULL) || (flags & BTR_NO_LOCKING_FLAG));
-
- if (UNIV_UNLIKELY(thr && thr_get_trx(thr)->fake_changes)) {
+ if (UNIV_UNLIKELY(thr_get_trx(thr)->fake_changes)) {
/* skip LOCK, UNDO */
return(DB_SUCCESS);
}
@@ -3211,7 +3209,7 @@ btr_cur_del_mark_set_clust_rec(
ut_ad(page_is_leaf(page_align(rec)));
#ifdef UNIV_DEBUG
- if (btr_cur_print_record_ops && (thr != NULL)) {
+ if (btr_cur_print_record_ops) {
btr_cur_trx_report(thr_get_trx(thr)->id, index, "del mark ");
rec_print_new(stderr, rec, offsets);
}
@@ -3369,7 +3367,7 @@ btr_cur_del_mark_set_sec_rec(
rec = btr_cur_get_rec(cursor);
#ifdef UNIV_DEBUG
- if (btr_cur_print_record_ops && (thr != NULL)) {
+ if (btr_cur_print_record_ops) {
btr_cur_trx_report(thr_get_trx(thr)->id, cursor->index,
"del mark ");
rec_print(stderr, rec, cursor->index);
diff --git a/storage/xtradb/buf/buf0buf.cc b/storage/xtradb/buf/buf0buf.cc
index 8cf8ab3975e..50a13da262c 100644
--- a/storage/xtradb/buf/buf0buf.cc
+++ b/storage/xtradb/buf/buf0buf.cc
@@ -946,13 +946,6 @@ buf_page_print(
#endif /* !UNIV_HOTBACKUP */
ulint size = zip_size;
- if (!read_buf) {
- fprintf(stderr,
- " InnoDB: Not dumping page as (in memory) pointer "
- "is NULL\n");
- return;
- }
-
if (!size) {
size = UNIV_PAGE_SIZE;
}
@@ -4702,7 +4695,7 @@ buf_page_io_complete(
if (io_type == BUF_IO_READ) {
ulint read_page_no;
ulint read_space_id;
- byte* frame = NULL;
+ byte* frame;
if (!buf_page_decrypt_after_read(bpage)) {
/* encryption error! */
diff --git a/storage/xtradb/dict/dict0dict.cc b/storage/xtradb/dict/dict0dict.cc
index 2f0b09ec419..ae928306db2 100644
--- a/storage/xtradb/dict/dict0dict.cc
+++ b/storage/xtradb/dict/dict0dict.cc
@@ -6317,15 +6317,10 @@ dict_set_corrupted_index_cache_only(
/* Mark the table as corrupted only if the clustered index
is corrupted */
if (dict_index_is_clust(index)) {
- dict_table_t* corrupt_table;
-
- corrupt_table = (table != NULL) ? table : index->table;
ut_ad((index->table != NULL) || (table != NULL)
|| index->table == table);
- if (corrupt_table) {
- corrupt_table->corrupted = TRUE;
- }
+ table->corrupted = TRUE;
}
index->type |= DICT_CORRUPT;
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index 01014a553ec..fd3ef644673 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -20248,7 +20248,7 @@ wsrep_fake_trx_id(
trx_id_t trx_id = trx_sys_get_new_trx_id();
mutex_exit(&trx_sys->mutex);
- (void *)wsrep_ws_handle_for_trx(wsrep_thd_ws_handle(thd), trx_id);
+ wsrep_ws_handle_for_trx(wsrep_thd_ws_handle(thd), trx_id);
}
#endif /* WITH_WSREP */
diff --git a/storage/xtradb/ibuf/ibuf0ibuf.cc b/storage/xtradb/ibuf/ibuf0ibuf.cc
index 13597d38433..c1d735eecdd 100644
--- a/storage/xtradb/ibuf/ibuf0ibuf.cc
+++ b/storage/xtradb/ibuf/ibuf0ibuf.cc
@@ -4732,8 +4732,14 @@ ibuf_merge_or_delete_for_page(
bitmap_page = ibuf_bitmap_get_map_page(space, page_no,
zip_size, &mtr);
- buf_page_print(bitmap_page, 0,
- BUF_PAGE_PRINT_NO_CRASH);
+ if (bitmap_page == NULL)
+ {
+ fputs("InnoDB: cannot retrieve bitmap page\n",
+ stderr);
+ } else {
+ buf_page_print(bitmap_page, 0,
+ BUF_PAGE_PRINT_NO_CRASH);
+ }
ibuf_mtr_commit(&mtr);
fputs("\nInnoDB: Dump of the page:\n", stderr);
diff --git a/storage/xtradb/include/dict0mem.h b/storage/xtradb/include/dict0mem.h
index 29f5b8fe814..96c85cd8a99 100644
--- a/storage/xtradb/include/dict0mem.h
+++ b/storage/xtradb/include/dict0mem.h
@@ -164,7 +164,7 @@ DEFAULT=0, ON = 1, OFF = 2
+ DICT_TF_WIDTH_PAGE_ENCRYPTION_KEY)
/** A mask of all the known/used bits in table flags */
-#define DICT_TF_BIT_MASK (~(~0 << DICT_TF_BITS))
+#define DICT_TF_BIT_MASK (~(~0U << DICT_TF_BITS))
/** Zero relative shift position of the COMPACT field */
#define DICT_TF_POS_COMPACT 0
@@ -215,23 +215,23 @@ DEFAULT=0, ON = 1, OFF = 2
<< DICT_TF_POS_DATA_DIR)
/** Bit mask of the PAGE_COMPRESSION field */
#define DICT_TF_MASK_PAGE_COMPRESSION \
- ((~(~0 << DICT_TF_WIDTH_PAGE_COMPRESSION)) \
+ ((~(~0U << DICT_TF_WIDTH_PAGE_COMPRESSION)) \
<< DICT_TF_POS_PAGE_COMPRESSION)
/** Bit mask of the PAGE_COMPRESSION_LEVEL field */
#define DICT_TF_MASK_PAGE_COMPRESSION_LEVEL \
- ((~(~0 << DICT_TF_WIDTH_PAGE_COMPRESSION_LEVEL)) \
+ ((~(~0U << DICT_TF_WIDTH_PAGE_COMPRESSION_LEVEL)) \
<< DICT_TF_POS_PAGE_COMPRESSION_LEVEL)
/** Bit mask of the ATOMIC_WRITES field */
#define DICT_TF_MASK_ATOMIC_WRITES \
- ((~(~0 << DICT_TF_WIDTH_ATOMIC_WRITES)) \
+ ((~(~0U << DICT_TF_WIDTH_ATOMIC_WRITES)) \
<< DICT_TF_POS_ATOMIC_WRITES)
/** Bit mask of the PAGE_ENCRYPTION field */
#define DICT_TF_MASK_PAGE_ENCRYPTION \
- ((~(~0L << DICT_TF_WIDTH_PAGE_ENCRYPTION)) \
+ ((~(~0U << DICT_TF_WIDTH_PAGE_ENCRYPTION)) \
<< DICT_TF_POS_PAGE_ENCRYPTION)
/** Bit mask of the PAGE_ENCRYPTION_KEY field */
#define DICT_TF_MASK_PAGE_ENCRYPTION_KEY \
- ((~(~0L << DICT_TF_WIDTH_PAGE_ENCRYPTION_KEY)) \
+ ((~(~0U << DICT_TF_WIDTH_PAGE_ENCRYPTION_KEY)) \
<< DICT_TF_POS_PAGE_ENCRYPTION_KEY)
/** Return the value of the COMPACT field */
diff --git a/storage/xtradb/include/fil0pagecompress.h b/storage/xtradb/include/fil0pagecompress.h
index 99a05f14ffe..10db59fb218 100644
--- a/storage/xtradb/include/fil0pagecompress.h
+++ b/storage/xtradb/include/fil0pagecompress.h
@@ -34,7 +34,7 @@ Created 11/12/2013 Jan Lindström jan.lindstrom@skysql.com
Returns the page compression level flag of the space, or 0 if the space
is not compressed. The tablespace must be cached in the memory cache.
@return page compression level if page compressed, ULINT_UNDEFINED if space not found */
-UNIV_INTERN
+UNIV_INLINE
ulint
fil_space_get_page_compression_level(
/*=================================*/
@@ -43,7 +43,7 @@ fil_space_get_page_compression_level(
Returns the page compression flag of the space, or false if the space
is not compressed. The tablespace must be cached in the memory cache.
@return true if page compressed, false if not or space not found */
-UNIV_INTERN
+UNIV_INLINE
ibool
fil_space_is_page_compressed(
/*=========================*/
@@ -61,7 +61,7 @@ fil_space_get_page_compressed(
Returns the atomic writes flag of the space, or false if the space
is not using atomic writes. The tablespace must be cached in the memory cache.
@return atomic write table option value */
-UNIV_INTERN
+UNIV_INLINE
atomic_writes_t
fil_space_get_atomic_writes(
/*=========================*/
@@ -69,7 +69,7 @@ fil_space_get_atomic_writes(
/*******************************************************************//**
Find out wheather the page is index page or not
@return true if page type index page, false if not */
-UNIV_INTERN
+UNIV_INLINE
ibool
fil_page_is_index_page(
/*===================*/
@@ -79,7 +79,7 @@ fil_page_is_index_page(
Get the name of the compression algorithm used for page
compression.
@return compression algorithm name or "UNKNOWN" if not known*/
-UNIV_INTERN
+UNIV_INLINE
const char*
fil_get_compression_alg_name(
/*=========================*/
@@ -136,7 +136,7 @@ fil_node_get_space_id(
/****************************************************************//**
Get block size from fil node
@return block size*/
-UNIV_INTERN
+UNIV_INLINE
ulint
fil_node_get_block_size(
fil_node_t* node); /*!< in: Node where to get block
@@ -144,7 +144,7 @@ fil_node_get_block_size(
/*******************************************************************//**
Find out wheather the page is page compressed
@return true if page is page compressed*/
-UNIV_INTERN
+UNIV_INLINE
ibool
fil_page_is_compressed(
/*===================*/
@@ -153,7 +153,7 @@ fil_page_is_compressed(
/*******************************************************************//**
Find out wheather the page is page compressed
@return true if page is page compressed*/
-UNIV_INTERN
+UNIV_INLINE
ibool
fil_page_is_compressed_encrypted(
/*=============================*/
@@ -162,7 +162,7 @@ fil_page_is_compressed_encrypted(
/*******************************************************************//**
Find out wheather the page is page compressed with lzo method
@return true if page is page compressed with lzo method*/
-UNIV_INTERN
+UNIV_INLINE
ibool
fil_page_is_lzo_compressed(
/*=======================*/
diff --git a/storage/xtradb/include/fsp0fsp.h b/storage/xtradb/include/fsp0fsp.h
index 9212328f724..551a8c9ef97 100644
--- a/storage/xtradb/include/fsp0fsp.h
+++ b/storage/xtradb/include/fsp0fsp.h
@@ -128,21 +128,20 @@ dictionary */
<< FSP_FLAGS_POS_DATA_DIR)
/** Bit mask of the DATA_DIR field */
#define FSP_FLAGS_MASK_DATA_DIR_ORACLE \
- ((~(~0 << FSP_FLAGS_WIDTH_DATA_DIR)) \
+ ((~(~0U << FSP_FLAGS_WIDTH_DATA_DIR)) \
<< FSP_FLAGS_POS_DATA_DIR_ORACLE)
/** Bit mask of the PAGE_COMPRESSION field */
-#define FSP_FLAGS_MASK_PAGE_COMPRESSION \
- ((~(~0 << FSP_FLAGS_WIDTH_PAGE_COMPRESSION)) \
+#define FSP_FLAGS_MASK_PAGE_COMPRESSION \
+ ((~(~0U << FSP_FLAGS_WIDTH_PAGE_COMPRESSION)) \
<< FSP_FLAGS_POS_PAGE_COMPRESSION)
/** Bit mask of the PAGE_COMPRESSION_LEVEL field */
-#define FSP_FLAGS_MASK_PAGE_COMPRESSION_LEVEL \
- ((~(~0 << FSP_FLAGS_WIDTH_PAGE_COMPRESSION_LEVEL)) \
+#define FSP_FLAGS_MASK_PAGE_COMPRESSION_LEVEL \
+ ((~(~0U << FSP_FLAGS_WIDTH_PAGE_COMPRESSION_LEVEL)) \
<< FSP_FLAGS_POS_PAGE_COMPRESSION_LEVEL)
/** Bit mask of the ATOMIC_WRITES field */
-#define FSP_FLAGS_MASK_ATOMIC_WRITES \
- ((~(~0 << FSP_FLAGS_WIDTH_ATOMIC_WRITES)) \
+#define FSP_FLAGS_MASK_ATOMIC_WRITES \
+ ((~(~0U << FSP_FLAGS_WIDTH_ATOMIC_WRITES)) \
<< FSP_FLAGS_POS_ATOMIC_WRITES)
-
/** Return the value of the POST_ANTELOPE field */
#define FSP_FLAGS_GET_POST_ANTELOPE(flags) \
((flags & FSP_FLAGS_MASK_POST_ANTELOPE) \
diff --git a/storage/xtradb/include/page0page.ic b/storage/xtradb/include/page0page.ic
index efa5e855eb7..5cf92fd5d8d 100644
--- a/storage/xtradb/include/page0page.ic
+++ b/storage/xtradb/include/page0page.ic
@@ -275,9 +275,6 @@ page_is_leaf(
/*=========*/
const page_t* page) /*!< in: page */
{
- if (!page) {
- return(FALSE);
- }
return(!*(const uint16*) (page + (PAGE_HEADER + PAGE_LEVEL)));
}
diff --git a/storage/xtradb/lock/lock0lock.cc b/storage/xtradb/lock/lock0lock.cc
index c56bc5e52ed..13edfb2e7ea 100644
--- a/storage/xtradb/lock/lock0lock.cc
+++ b/storage/xtradb/lock/lock0lock.cc
@@ -2156,7 +2156,6 @@ lock_queue_validate(
ulint space;
ulint page_no;
ulint rec_fold;
- hash_table_t* hash;
hash_cell_t* cell;
lock_t* next;
bool wait_lock = false;
diff --git a/storage/xtradb/page/page0zip.cc b/storage/xtradb/page/page0zip.cc
index 63d6fe225c2..04340c0f3d2 100644
--- a/storage/xtradb/page/page0zip.cc
+++ b/storage/xtradb/page/page0zip.cc
@@ -1250,10 +1250,6 @@ page_zip_compress(
anytime. */
my_bool cmp_per_index_enabled = srv_cmp_per_index_enabled;
- if (!page) {
- return(FALSE);
- }
-
ut_a(page_is_comp(page));
ut_a(fil_page_get_type(page) == FIL_PAGE_INDEX);
ut_ad(page_simple_validate_new((page_t*) page));
diff --git a/storage/xtradb/row/row0merge.cc b/storage/xtradb/row/row0merge.cc
index 9f154a712f4..22ae1eac452 100644
--- a/storage/xtradb/row/row0merge.cc
+++ b/storage/xtradb/row/row0merge.cc
@@ -4203,9 +4203,10 @@ wait_again:
(total_static_cost + total_dynamic_cost)
* PCT_COST_MERGESORT_INDEX * 100;
- bufend = innobase_convert_name(buf, sizeof buf,
+ bufend = innobase_convert_name(
+ buf, sizeof buf,
indexes[i]->name, strlen(indexes[i]->name),
- trx ? trx->mysql_thd : NULL,
+ trx->mysql_thd,
FALSE);
buf[bufend - buf]='\0';
diff --git a/storage/xtradb/row/row0upd.cc b/storage/xtradb/row/row0upd.cc
index 924b4ccca0d..6288251da77 100644
--- a/storage/xtradb/row/row0upd.cc
+++ b/storage/xtradb/row/row0upd.cc
@@ -2822,9 +2822,6 @@ row_upd(
{
dberr_t err = DB_SUCCESS;
- ut_ad(node != NULL);
- ut_ad(thr != NULL);
-
if (UNIV_LIKELY(node->in_mysql_interface)) {
/* We do not get the cmpl_info value from the MySQL
diff --git a/storage/xtradb/sync/sync0sync.cc b/storage/xtradb/sync/sync0sync.cc
index 7458a052224..5c4b45eb3c0 100644
--- a/storage/xtradb/sync/sync0sync.cc
+++ b/storage/xtradb/sync/sync0sync.cc
@@ -223,9 +223,6 @@ UNIV_INTERN mysql_pfs_key_t mutex_list_mutex_key;
/** Latching order checks start when this is set TRUE */
UNIV_INTERN ibool sync_order_checks_on = FALSE;
-/** Number of slots reserved for each OS thread in the sync level array */
-static const ulint SYNC_THREAD_N_LEVELS = 10000;
-
/** Array for tracking sync levels per thread. */
typedef std::vector<sync_level_t> sync_arr_t;