diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-04-03 09:46:49 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-04-03 09:46:49 +0300 |
commit | c0fca2863bcbd7cd231f1aa747b4f8d999e3a00e (patch) | |
tree | 81bffdb7541b3957dde9d7b689baa7b43375ce67 /storage/innobase/include/dict0dict.ic | |
parent | 65d758aa891bdafca6c881d3e7075979de3395e9 (diff) | |
download | mariadb-git-c0fca2863bcbd7cd231f1aa747b4f8d999e3a00e.tar.gz |
Fix -Wnonnull-compare
InnoDB and XtraDB had redundant assertions for checking that
function parameters that were declared as nonnull were not NULL.
Diffstat (limited to 'storage/innobase/include/dict0dict.ic')
-rw-r--r-- | storage/innobase/include/dict0dict.ic | 42 |
1 files changed, 3 insertions, 39 deletions
diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.ic index bc72d441081..60c33fc0679 100644 --- a/storage/innobase/include/dict0dict.ic +++ b/storage/innobase/include/dict0dict.ic @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2013, 2018, MariaDB Corporation. +Copyright (c) 2013, 2019, MariaDB Corporation. 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 @@ -85,9 +85,6 @@ dict_col_type_assert_equal( const dict_col_t* col, /*!< in: column */ const dtype_t* type) /*!< in: data type */ { - ut_ad(col); - ut_ad(type); - ut_ad(col->mtype == type->mtype); ut_ad(col->prtype == type->prtype); //ut_ad(col->len == type->len); @@ -161,8 +158,6 @@ dict_col_get_no( /*============*/ const dict_col_t* col) /*!< in: column */ { - ut_ad(col); - return(col->ind); } @@ -177,8 +172,6 @@ dict_col_get_clust_pos( { ulint i; - ut_ad(col); - ut_ad(clust_index); ut_ad(dict_index_is_clust(clust_index)); for (i = 0; i < clust_index->n_def; i++) { @@ -203,7 +196,6 @@ dict_table_get_first_index( /*=======================*/ const dict_table_t* table) /*!< in: table */ { - ut_ad(table); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); return(UT_LIST_GET_FIRST(((dict_table_t*) table)->indexes)); @@ -218,9 +210,7 @@ dict_table_get_last_index( /*=======================*/ const dict_table_t* table) /*!< in: table */ { - ut_ad(table); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); - return(UT_LIST_GET_LAST((const_cast<dict_table_t*>(table)) ->indexes)); } @@ -234,9 +224,7 @@ dict_table_get_next_index( /*======================*/ const dict_index_t* index) /*!< in: index */ { - ut_ad(index); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); - return(UT_LIST_GET_NEXT(indexes, (dict_index_t*) index)); } #endif /* UNIV_DEBUG */ @@ -252,7 +240,6 @@ dict_index_is_clust( const dict_index_t* index) /*!< in: index */ { ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); - return(index->type & DICT_CLUSTERED); } /********************************************************************//** @@ -265,7 +252,6 @@ dict_index_is_unique( const dict_index_t* index) /*!< in: index */ { ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); - return(index->type & DICT_UNIQUE); } @@ -279,7 +265,6 @@ dict_index_is_ibuf( const dict_index_t* index) /*!< in: index */ { ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); - return(index->type & DICT_IBUF); } @@ -292,9 +277,7 @@ dict_index_is_univ( /*===============*/ const dict_index_t* index) /*!< in: index */ { - ut_ad(index); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); - return(index->type & DICT_UNIVERSAL); } @@ -423,7 +406,6 @@ dict_table_get_nth_col( const dict_table_t* table, /*!< in: table */ ulint pos) /*!< in: position of column */ { - ut_ad(table); ut_ad(pos < table->n_def); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); @@ -465,7 +447,6 @@ dict_table_get_sys_col_no( const dict_table_t* table, /*!< in: table */ ulint sys) /*!< in: DATA_ROW_ID, ... */ { - ut_ad(table); ut_ad(sys < DATA_N_SYS_COLS); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); @@ -499,8 +480,6 @@ dict_table_has_fts_index( /* out: TRUE if table has an FTS index */ dict_table_t* table) /* in: table */ { - ut_ad(table); - return(DICT_TF2_FLAG_IS_SET(table, DICT_TF2_FTS)); } @@ -1049,8 +1028,7 @@ dict_table_x_lock_indexes( { dict_index_t* index; - ut_a(table); - ut_ad(mutex_own(&(dict_sys->mutex))); + ut_ad(mutex_own(&dict_sys->mutex)); /* Loop through each index of the table and lock them */ for (index = dict_table_get_first_index(table); @@ -1091,8 +1069,7 @@ dict_table_x_unlock_indexes( { dict_index_t* index; - ut_a(table); - ut_ad(mutex_own(&(dict_sys->mutex))); + ut_ad(mutex_own(&dict_sys->mutex)); for (index = dict_table_get_first_index(table); index != NULL; @@ -1114,9 +1091,7 @@ dict_index_get_n_fields( representation of index (in the dictionary cache) */ { - ut_ad(index); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); - return(index->n_fields); } @@ -1133,10 +1108,8 @@ dict_index_get_n_unique( const dict_index_t* index) /*!< in: an internal representation of index (in the dictionary cache) */ { - ut_ad(index); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->cached); - return(index->n_uniq); } @@ -1152,7 +1125,6 @@ dict_index_get_n_unique_in_tree( const dict_index_t* index) /*!< in: an internal representation of index (in the dictionary cache) */ { - ut_ad(index); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->cached); @@ -1191,7 +1163,6 @@ dict_index_get_nth_field( const dict_index_t* index, /*!< in: index */ ulint pos) /*!< in: position of field */ { - ut_ad(index); ut_ad(pos < index->n_def); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); @@ -1209,7 +1180,6 @@ dict_index_get_sys_col_pos( const dict_index_t* index, /*!< in: index */ ulint type) /*!< in: DATA_ROW_ID, ... */ { - ut_ad(index); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(!dict_index_is_univ(index)); @@ -1234,8 +1204,6 @@ dict_field_get_col( /*===============*/ const dict_field_t* field) /*!< in: index field */ { - ut_ad(field); - return(field->col); } @@ -1341,7 +1309,6 @@ dict_index_get_page( /*================*/ const dict_index_t* index) /*!< in: index */ { - ut_ad(index); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); return(index->page); @@ -1356,7 +1323,6 @@ dict_index_get_lock( /*================*/ dict_index_t* index) /*!< in: index */ { - ut_ad(index); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); return(&(index->lock)); @@ -1533,9 +1499,7 @@ dict_table_is_corrupted( /*====================*/ const dict_table_t* table) /*!< in: table */ { - ut_ad(table); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); - return(table->corrupted); } |