diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-04-03 10:29:15 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-04-03 10:32:21 +0300 |
commit | dbc716675b183dc972a40dd1320f4bdae04c1f29 (patch) | |
tree | 65550afccea8fc9e0d47ba16a679eef44c7dab1a /storage/innobase/include | |
parent | e3f44d8d0eb0277312391686672f81a460094917 (diff) | |
parent | c0fca2863bcbd7cd231f1aa747b4f8d999e3a00e (diff) | |
download | mariadb-git-dbc716675b183dc972a40dd1320f4bdae04c1f29.tar.gz |
Merge 10.1 into 10.2
Diffstat (limited to 'storage/innobase/include')
-rw-r--r-- | storage/innobase/include/data0data.ic | 29 | ||||
-rw-r--r-- | storage/innobase/include/dict0dict.ic | 49 | ||||
-rw-r--r-- | storage/innobase/include/rem0rec.ic | 22 |
3 files changed, 9 insertions, 91 deletions
diff --git a/storage/innobase/include/data0data.ic b/storage/innobase/include/data0data.ic index 81788885aa5..f8689db54ec 100644 --- a/storage/innobase/include/data0data.ic +++ b/storage/innobase/include/data0data.ic @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, MariaDB Corporation. +Copyright (c) 2017, 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 @@ -43,8 +43,6 @@ dfield_get_type( /*============*/ const dfield_t* field) /*!< in: SQL data field */ { - ut_ad(field); - return((dtype_t*) &(field->type)); } #endif /* UNIV_DEBUG */ @@ -74,7 +72,6 @@ dfield_get_data( /*============*/ const dfield_t* field) /*!< in: field */ { - ut_ad(field); ut_ad((field->len == UNIV_SQL_NULL) || (field->data != &data_error)); @@ -91,7 +88,6 @@ dfield_get_len( /*===========*/ const dfield_t* field) /*!< in: field */ { - ut_ad(field); ut_ad((field->len == UNIV_SQL_NULL) || (field->data != &data_error)); @@ -107,7 +103,6 @@ dfield_set_len( dfield_t* field, /*!< in: field */ ulint len) /*!< in: length or UNIV_SQL_NULL */ { - ut_ad(field); #ifdef UNIV_VALGRIND_DEBUG if (len != UNIV_SQL_NULL) UNIV_MEM_ASSERT_RW(field->data, len); #endif /* UNIV_VALGRIND_DEBUG */ @@ -125,8 +120,6 @@ dfield_is_null( /*===========*/ const dfield_t* field) /*!< in: field */ { - ut_ad(field); - return(field->len == UNIV_SQL_NULL); } @@ -139,9 +132,7 @@ dfield_is_ext( /*==========*/ const dfield_t* field) /*!< in: field */ { - ut_ad(field); ut_ad(!field->ext || field->len >= BTR_EXTERN_FIELD_REF_SIZE); - return(field->ext); } @@ -153,8 +144,6 @@ dfield_set_ext( /*===========*/ dfield_t* field) /*!< in/out: field */ { - ut_ad(field); - field->ext = 1; } @@ -196,8 +185,6 @@ dfield_set_data( const void* data, /*!< in: data */ ulint len) /*!< in: length or UNIV_SQL_NULL */ { - ut_ad(field); - #ifdef UNIV_VALGRIND_DEBUG if (len != UNIV_SQL_NULL) UNIV_MEM_ASSERT_RW(data, len); #endif /* UNIV_VALGRIND_DEBUG */ @@ -215,8 +202,6 @@ dfield_write_mbr( dfield_t* field, /*!< in: field */ const double* mbr) /*!< in: data */ { - ut_ad(field); - #ifdef UNIV_VALGRIND_DEBUG if (len != UNIV_SQL_NULL) UNIV_MEM_ASSERT_RW(data, len); #endif /* UNIV_VALGRIND_DEBUG */ @@ -340,8 +325,6 @@ dtuple_get_info_bits( /*=================*/ const dtuple_t* tuple) /*!< in: tuple */ { - ut_ad(tuple); - return(tuple->info_bits); } @@ -354,8 +337,6 @@ dtuple_set_info_bits( dtuple_t* tuple, /*!< in: tuple */ ulint info_bits) /*!< in: info bits */ { - ut_ad(tuple); - tuple->info_bits = info_bits; } @@ -368,8 +349,6 @@ dtuple_get_n_fields_cmp( /*====================*/ const dtuple_t* tuple) /*!< in: tuple */ { - ut_ad(tuple); - return(tuple->n_fields_cmp); } @@ -383,9 +362,7 @@ dtuple_set_n_fields_cmp( ulint n_fields_cmp) /*!< in: number of fields used in comparisons in rem0cmp.* */ { - ut_ad(tuple); ut_ad(n_fields_cmp <= tuple->n_fields); - tuple->n_fields_cmp = n_fields_cmp; } @@ -398,8 +375,6 @@ dtuple_get_n_fields( /*================*/ const dtuple_t* tuple) /*!< in: tuple */ { - ut_ad(tuple); - return(tuple->n_fields); } @@ -649,7 +624,6 @@ dtuple_get_data_size( ulint i; ulint sum = 0; - ut_ad(tuple); ut_ad(dtuple_check_typed(tuple)); ut_ad(tuple->magic_n == DATA_TUPLE_MAGIC_N); @@ -683,7 +657,6 @@ dtuple_get_n_ext( ulint n_fields = tuple->n_fields; ulint i; - ut_ad(tuple); ut_ad(dtuple_check_typed(tuple)); ut_ad(tuple->magic_n == DATA_TUPLE_MAGIC_N); diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.ic index a10bf769773..6b081640aae 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 @@ -78,9 +78,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); @@ -150,8 +147,6 @@ dict_col_get_no( /*============*/ const dict_col_t* col) /*!< in: column */ { - ut_ad(col); - return(col->ind); } @@ -166,8 +161,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++) { @@ -193,8 +186,6 @@ dict_col_get_index_pos( { ulint i; - ut_ad(col); - for (i = 0; i < index->n_def; i++) { const dict_field_t* field = &index->fields[i]; @@ -216,7 +207,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)); @@ -231,9 +221,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)); } @@ -247,9 +235,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 */ @@ -264,7 +250,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); } @@ -290,7 +275,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); } @@ -303,9 +287,7 @@ dict_index_is_spatial( /*==================*/ const dict_index_t* index) /*!< in: index */ { - ut_ad(index); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); - return(index->type & DICT_SPATIAL); } @@ -318,9 +300,7 @@ dict_index_is_ibuf( /*===============*/ const dict_index_t* index) /*!< in: index */ { - ut_ad(index); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); - return(index->type & DICT_IBUF); } @@ -334,7 +314,6 @@ dict_index_is_sec_or_ibuf( const dict_index_t* index) /*!< in: index */ { ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); - return((index->type & (DICT_CLUSTERED | DICT_IBUF)) != DICT_CLUSTERED); } @@ -350,8 +329,7 @@ dict_table_get_n_user_cols( const dict_table_t* table) /*!< in: table */ { ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); - - return(table->n_cols - dict_table_get_n_sys_cols(table)); + return(table->n_cols - DATA_N_SYS_COLS); } /********************************************************************//** @@ -365,7 +343,6 @@ dict_table_get_n_cols( const dict_table_t* table) /*!< in: table */ { ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); - return(table->n_cols); } @@ -463,7 +440,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); @@ -523,10 +499,8 @@ 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 < dict_table_get_n_sys_cols(table)); + ut_ad(sys < DATA_N_SYS_COLS); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); - return(table->n_cols - dict_table_get_n_sys_cols(table) + sys); } @@ -557,8 +531,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)); } @@ -894,7 +866,6 @@ dict_table_x_lock_indexes( { dict_index_t* index; - ut_a(table); ut_ad(mutex_own(&dict_sys->mutex)); /* Loop through each index of the table and lock them */ @@ -936,7 +907,6 @@ dict_table_x_unlock_indexes( { dict_index_t* index; - ut_a(table); ut_ad(mutex_own(&dict_sys->mutex)); for (index = dict_table_get_first_index(table); @@ -958,9 +928,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); } @@ -977,10 +945,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); } @@ -996,7 +962,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); @@ -1060,7 +1025,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); @@ -1078,7 +1042,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_ibuf(index)); @@ -1102,8 +1065,6 @@ dict_field_get_col( /*===============*/ const dict_field_t* field) /*!< in: index field */ { - ut_ad(field); - return(field->col); } @@ -1208,7 +1169,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); @@ -1223,7 +1183,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)); @@ -1449,9 +1408,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); } diff --git a/storage/innobase/include/rem0rec.ic b/storage/innobase/include/rem0rec.ic index cb1f0d9836f..06bf20d18df 100644 --- a/storage/innobase/include/rem0rec.ic +++ b/storage/innobase/include/rem0rec.ic @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2018, MariaDB Corporation. +Copyright (c) 2017, 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 @@ -372,15 +372,9 @@ rec_set_next_offs_old( rec_t* rec, /*!< in: old-style physical record */ ulint next) /*!< in: offset of the next record */ { - ut_ad(rec); - ut_ad(UNIV_PAGE_SIZE > next); -#if REC_NEXT_MASK != 0xFFFFUL -# error "REC_NEXT_MASK != 0xFFFFUL" -#endif -#if REC_NEXT_SHIFT -# error "REC_NEXT_SHIFT != 0" -#endif - + ut_ad(srv_page_size > next); + compile_time_assert(REC_NEXT_MASK == 0xFFFFUL); + compile_time_assert(REC_NEXT_SHIFT == 0); mach_write_to_2(rec - REC_NEXT, next); } @@ -396,8 +390,7 @@ rec_set_next_offs_new( { ulint field_value; - ut_ad(rec); - ut_ad(UNIV_PAGE_SIZE > next); + ut_ad(srv_page_size > next); if (!next) { field_value = 0; @@ -959,7 +952,6 @@ rec_offs_set_n_alloc( must be allocated */ ulint n_alloc) /*!< in: number of elements */ { - ut_ad(offsets); ut_ad(n_alloc > REC_OFFS_HEADER_SIZE); UNIV_MEM_ALLOC(offsets, n_alloc * sizeof *offsets); offsets[0] = n_alloc; @@ -1077,7 +1069,6 @@ rec_get_nth_field_offs( ulint offs; ulint length; ut_ad(n < rec_offs_n_fields(offsets)); - ut_ad(len); if (n == 0) { offs = 0; @@ -1425,7 +1416,6 @@ rec_set_nth_field( byte* data2; ulint len2; - ut_ad(rec); ut_ad(rec_offs_validate(rec, NULL, offsets)); if (len == UNIV_SQL_NULL) { @@ -1628,8 +1618,6 @@ rec_get_converted_size( ulint data_size; ulint extra_size; - ut_ad(index); - ut_ad(dtuple); ut_ad(dtuple_check_typed(dtuple)); ut_ad(dict_index_is_ibuf(index) |