Fix -Wnonnull-compare

InnoDB and XtraDB had redundant assertions for checking that
function parameters that were declared as nonnull were not NULL.
This commit is contained in:
Marko Mäkelä 2019-04-03 09:46:49 +03:00
parent 65d758aa89
commit c0fca2863b
34 changed files with 48 additions and 321 deletions

View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 2006, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2006, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2018, MariaDB Corporation. Copyright (c) 2018, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -480,7 +480,6 @@ buf_buddy_alloc_low(
{ {
buf_block_t* block; buf_block_t* block;
ut_ad(lru);
ut_ad(buf_pool_mutex_own(buf_pool)); ut_ad(buf_pool_mutex_own(buf_pool));
ut_ad(!mutex_own(&buf_pool->zip_mutex)); ut_ad(!mutex_own(&buf_pool->zip_mutex));
ut_ad(i >= buf_buddy_get_slot(UNIV_ZIP_SIZE_MIN)); ut_ad(i >= buf_buddy_get_slot(UNIV_ZIP_SIZE_MIN));

View File

@ -1,6 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -106,8 +107,6 @@ dtuple_set_n_fields(
dtuple_t* tuple, /*!< in: tuple */ dtuple_t* tuple, /*!< in: tuple */
ulint n_fields) /*!< in: number of fields */ ulint n_fields) /*!< in: number of fields */
{ {
ut_ad(tuple);
tuple->n_fields = n_fields; tuple->n_fields = n_fields;
tuple->n_fields_cmp = n_fields; tuple->n_fields_cmp = n_fields;
} }

View File

@ -940,7 +940,6 @@ dict_index_get_nth_field_pos(
ulint n_fields; ulint n_fields;
ulint pos; ulint pos;
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
field2 = dict_index_get_nth_field(index2, n); field2 = dict_index_get_nth_field(index2, n);
@ -1038,8 +1037,6 @@ dict_table_col_in_clustered_key(
ulint pos; ulint pos;
ulint n_fields; ulint n_fields;
ut_ad(table);
col = dict_table_get_nth_col(table, n); col = dict_table_get_nth_col(table, n);
index = dict_table_get_first_index(table); index = dict_table_get_first_index(table);
@ -1214,7 +1211,6 @@ dict_table_add_system_columns(
dict_table_t* table, /*!< in/out: table */ dict_table_t* table, /*!< in/out: table */
mem_heap_t* heap) /*!< in: temporary heap */ mem_heap_t* heap) /*!< in: temporary heap */
{ {
ut_ad(table);
ut_ad(table->n_def == table->n_cols - DATA_N_SYS_COLS); ut_ad(table->n_def == table->n_cols - DATA_N_SYS_COLS);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
ut_ad(!table->cached); ut_ad(!table->cached);
@ -2024,8 +2020,7 @@ dict_table_change_id_in_cache(
dict_table_t* table, /*!< in/out: table object already in cache */ dict_table_t* table, /*!< in/out: table object already in cache */
table_id_t new_id) /*!< in: new id to set */ table_id_t new_id) /*!< in: new id to set */
{ {
ut_ad(table); ut_ad(mutex_own(&dict_sys->mutex));
ut_ad(mutex_own(&(dict_sys->mutex)));
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
/* Remove the table from the hash table of id's */ /* Remove the table from the hash table of id's */
@ -2051,7 +2046,6 @@ dict_table_remove_from_cache_low(
dict_foreign_t* foreign; dict_foreign_t* foreign;
dict_index_t* index; dict_index_t* index;
ut_ad(table);
ut_ad(dict_lru_validate()); ut_ad(dict_lru_validate());
ut_a(table->n_ref_count == 0); ut_a(table->n_ref_count == 0);
ut_a(table->n_rec_locks == 0); ut_a(table->n_rec_locks == 0);
@ -2496,8 +2490,7 @@ dict_index_add_to_cache(
ulint n_ord; ulint n_ord;
ulint i; ulint i;
ut_ad(index); ut_ad(mutex_own(&dict_sys->mutex));
ut_ad(mutex_own(&(dict_sys->mutex)));
ut_ad(index->n_def == index->n_fields); ut_ad(index->n_def == index->n_fields);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
ut_ad(!dict_index_is_online_ddl(index)); ut_ad(!dict_index_is_online_ddl(index));
@ -5281,7 +5274,6 @@ dict_foreign_parse_drop_constraints(
const char* id; const char* id;
struct charset_info_st* cs; struct charset_info_st* cs;
ut_a(trx);
ut_a(trx->mysql_thd); ut_a(trx->mysql_thd);
cs = innobase_get_charset(trx->mysql_thd); cs = innobase_get_charset(trx->mysql_thd);
@ -5454,9 +5446,8 @@ dict_index_check_search_tuple(
const dict_index_t* index, /*!< in: index tree */ const dict_index_t* index, /*!< in: index tree */
const dtuple_t* tuple) /*!< in: tuple used in a search */ const dtuple_t* tuple) /*!< in: tuple used in a search */
{ {
ut_a(index); ut_ad(dtuple_get_n_fields_cmp(tuple)
ut_a(dtuple_get_n_fields_cmp(tuple) <= dict_index_get_n_unique_in_tree(index));
<= dict_index_get_n_unique_in_tree(index));
return(TRUE); return(TRUE);
} }
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
@ -7120,8 +7111,6 @@ dict_index_zip_success(
/*===================*/ /*===================*/
dict_index_t* index) /*!< in/out: index to be updated. */ dict_index_t* index) /*!< in/out: index to be updated. */
{ {
ut_ad(index);
ulint zip_threshold = zip_failure_threshold_pct; ulint zip_threshold = zip_failure_threshold_pct;
if (!zip_threshold) { if (!zip_threshold) {
/* Disabled by user. */ /* Disabled by user. */
@ -7143,8 +7132,6 @@ dict_index_zip_failure(
/*===================*/ /*===================*/
dict_index_t* index) /*!< in/out: index to be updated. */ dict_index_t* index) /*!< in/out: index to be updated. */
{ {
ut_ad(index);
ulint zip_threshold = zip_failure_threshold_pct; ulint zip_threshold = zip_failure_threshold_pct;
if (!zip_threshold) { if (!zip_threshold) {
/* Disabled by user. */ /* Disabled by user. */
@ -7172,8 +7159,6 @@ dict_index_zip_pad_optimal_page_size(
ulint min_sz; ulint min_sz;
ulint sz; ulint sz;
ut_ad(index);
if (!zip_failure_threshold_pct) { if (!zip_failure_threshold_pct) {
/* Disabled by user. */ /* Disabled by user. */
return(UNIV_PAGE_SIZE); return(UNIV_PAGE_SIZE);

View File

@ -275,7 +275,6 @@ dict_mem_table_add_col(
dict_col_t* col; dict_col_t* col;
ulint i; ulint i;
ut_ad(table);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
ut_ad(!heap == !name); ut_ad(!heap == !name);

View File

@ -1513,8 +1513,8 @@ name_ok:
index index
@param[in] altered_table MySQL table that is being altered @param[in] altered_table MySQL table that is being altered
@param[in] key_part MySQL key definition @param[in] key_part MySQL key definition
@param[out] index_field index field defition for key_part */ @param[out] index_field index field definition for key_part */
static MY_ATTRIBUTE((nonnull(2,3))) static MY_ATTRIBUTE((nonnull))
void void
innobase_create_index_field_def( innobase_create_index_field_def(
bool new_clustered, bool new_clustered,
@ -1529,10 +1529,6 @@ innobase_create_index_field_def(
DBUG_ENTER("innobase_create_index_field_def"); DBUG_ENTER("innobase_create_index_field_def");
ut_ad(key_part);
ut_ad(index_field);
ut_ad(altered_table);
/* Virtual columns are not stored in InnoDB data dictionary, thus /* Virtual columns are not stored in InnoDB data dictionary, thus
if there is virtual columns we need to skip them to find the if there is virtual columns we need to skip them to find the
correct field. */ correct field. */
@ -1596,8 +1592,6 @@ innobase_create_index_def(
DBUG_ENTER("innobase_create_index_def"); DBUG_ENTER("innobase_create_index_def");
DBUG_ASSERT(!key_clustered || new_clustered); DBUG_ASSERT(!key_clustered || new_clustered);
ut_ad(altered_table);
index->fields = static_cast<index_field_t*>( index->fields = static_cast<index_field_t*>(
mem_heap_alloc(heap, n_fields * sizeof *index->fields)); mem_heap_alloc(heap, n_fields * sizeof *index->fields));
index->ind_type = 0; index->ind_type = 0;
@ -4829,7 +4823,6 @@ innobase_rename_columns_try(
ha_alter_info->alter_info->create_list); ha_alter_info->alter_info->create_list);
uint i = 0; uint i = 0;
DBUG_ASSERT(ctx);
DBUG_ASSERT(ha_alter_info->handler_flags DBUG_ASSERT(ha_alter_info->handler_flags
& Alter_inplace_info::ALTER_COLUMN_NAME); & Alter_inplace_info::ALTER_COLUMN_NAME);
@ -5013,7 +5006,6 @@ innobase_update_foreign_try(
ulint i; ulint i;
DBUG_ENTER("innobase_update_foreign_try"); DBUG_ENTER("innobase_update_foreign_try");
DBUG_ASSERT(ctx);
foreign_id = dict_table_get_highest_foreign_id(ctx->new_table); foreign_id = dict_table_get_highest_foreign_id(ctx->new_table);

View File

@ -1,6 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -41,8 +42,6 @@ dfield_get_type(
/*============*/ /*============*/
const dfield_t* field) /*!< in: SQL data field */ const dfield_t* field) /*!< in: SQL data field */
{ {
ut_ad(field);
return((dtype_t*) &(field->type)); return((dtype_t*) &(field->type));
} }
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
@ -72,7 +71,6 @@ dfield_get_data(
/*============*/ /*============*/
const dfield_t* field) /*!< in: field */ const dfield_t* field) /*!< in: field */
{ {
ut_ad(field);
ut_ad((field->len == UNIV_SQL_NULL) ut_ad((field->len == UNIV_SQL_NULL)
|| (field->data != &data_error)); || (field->data != &data_error));
@ -89,7 +87,6 @@ dfield_get_len(
/*===========*/ /*===========*/
const dfield_t* field) /*!< in: field */ const dfield_t* field) /*!< in: field */
{ {
ut_ad(field);
ut_ad((field->len == UNIV_SQL_NULL) ut_ad((field->len == UNIV_SQL_NULL)
|| (field->data != &data_error)); || (field->data != &data_error));
@ -105,7 +102,6 @@ dfield_set_len(
dfield_t* field, /*!< in: field */ dfield_t* field, /*!< in: field */
ulint len) /*!< in: length or UNIV_SQL_NULL */ ulint len) /*!< in: length or UNIV_SQL_NULL */
{ {
ut_ad(field);
#ifdef UNIV_VALGRIND_DEBUG #ifdef UNIV_VALGRIND_DEBUG
if (len != UNIV_SQL_NULL) UNIV_MEM_ASSERT_RW(field->data, len); if (len != UNIV_SQL_NULL) UNIV_MEM_ASSERT_RW(field->data, len);
#endif /* UNIV_VALGRIND_DEBUG */ #endif /* UNIV_VALGRIND_DEBUG */
@ -123,8 +119,6 @@ dfield_is_null(
/*===========*/ /*===========*/
const dfield_t* field) /*!< in: field */ const dfield_t* field) /*!< in: field */
{ {
ut_ad(field);
return(field->len == UNIV_SQL_NULL); return(field->len == UNIV_SQL_NULL);
} }
@ -137,8 +131,6 @@ dfield_is_ext(
/*==========*/ /*==========*/
const dfield_t* field) /*!< in: field */ const dfield_t* field) /*!< in: field */
{ {
ut_ad(field);
return(field->ext); return(field->ext);
} }
@ -150,8 +142,6 @@ dfield_set_ext(
/*===========*/ /*===========*/
dfield_t* field) /*!< in/out: field */ dfield_t* field) /*!< in/out: field */
{ {
ut_ad(field);
field->ext = 1; field->ext = 1;
} }
@ -165,8 +155,6 @@ dfield_set_data(
const void* data, /*!< in: data */ const void* data, /*!< in: data */
ulint len) /*!< in: length or UNIV_SQL_NULL */ ulint len) /*!< in: length or UNIV_SQL_NULL */
{ {
ut_ad(field);
#ifdef UNIV_VALGRIND_DEBUG #ifdef UNIV_VALGRIND_DEBUG
if (len != UNIV_SQL_NULL) UNIV_MEM_ASSERT_RW(data, len); if (len != UNIV_SQL_NULL) UNIV_MEM_ASSERT_RW(data, len);
#endif /* UNIV_VALGRIND_DEBUG */ #endif /* UNIV_VALGRIND_DEBUG */
@ -286,8 +274,6 @@ dtuple_get_info_bits(
/*=================*/ /*=================*/
const dtuple_t* tuple) /*!< in: tuple */ const dtuple_t* tuple) /*!< in: tuple */
{ {
ut_ad(tuple);
return(tuple->info_bits); return(tuple->info_bits);
} }
@ -300,8 +286,6 @@ dtuple_set_info_bits(
dtuple_t* tuple, /*!< in: tuple */ dtuple_t* tuple, /*!< in: tuple */
ulint info_bits) /*!< in: info bits */ ulint info_bits) /*!< in: info bits */
{ {
ut_ad(tuple);
tuple->info_bits = info_bits; tuple->info_bits = info_bits;
} }
@ -314,8 +298,6 @@ dtuple_get_n_fields_cmp(
/*====================*/ /*====================*/
const dtuple_t* tuple) /*!< in: tuple */ const dtuple_t* tuple) /*!< in: tuple */
{ {
ut_ad(tuple);
return(tuple->n_fields_cmp); return(tuple->n_fields_cmp);
} }
@ -329,9 +311,7 @@ dtuple_set_n_fields_cmp(
ulint n_fields_cmp) /*!< in: number of fields used in ulint n_fields_cmp) /*!< in: number of fields used in
comparisons in rem0cmp.* */ comparisons in rem0cmp.* */
{ {
ut_ad(tuple);
ut_ad(n_fields_cmp <= tuple->n_fields); ut_ad(n_fields_cmp <= tuple->n_fields);
tuple->n_fields_cmp = n_fields_cmp; tuple->n_fields_cmp = n_fields_cmp;
} }
@ -344,8 +324,6 @@ dtuple_get_n_fields(
/*================*/ /*================*/
const dtuple_t* tuple) /*!< in: tuple */ const dtuple_t* tuple) /*!< in: tuple */
{ {
ut_ad(tuple);
return(tuple->n_fields); return(tuple->n_fields);
} }
@ -483,7 +461,6 @@ dtuple_get_data_size(
ulint i; ulint i;
ulint sum = 0; ulint sum = 0;
ut_ad(tuple);
ut_ad(dtuple_check_typed(tuple)); ut_ad(dtuple_check_typed(tuple));
ut_ad(tuple->magic_n == DATA_TUPLE_MAGIC_N); ut_ad(tuple->magic_n == DATA_TUPLE_MAGIC_N);
@ -517,7 +494,6 @@ dtuple_get_n_ext(
ulint n_fields = tuple->n_fields; ulint n_fields = tuple->n_fields;
ulint i; ulint i;
ut_ad(tuple);
ut_ad(dtuple_check_typed(tuple)); ut_ad(dtuple_check_typed(tuple));
ut_ad(tuple->magic_n == DATA_TUPLE_MAGIC_N); ut_ad(tuple->magic_n == DATA_TUPLE_MAGIC_N);

View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved. 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 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 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 dict_col_t* col, /*!< in: column */
const dtype_t* type) /*!< in: data type */ const dtype_t* type) /*!< in: data type */
{ {
ut_ad(col);
ut_ad(type);
ut_ad(col->mtype == type->mtype); ut_ad(col->mtype == type->mtype);
ut_ad(col->prtype == type->prtype); ut_ad(col->prtype == type->prtype);
//ut_ad(col->len == type->len); //ut_ad(col->len == type->len);
@ -161,8 +158,6 @@ dict_col_get_no(
/*============*/ /*============*/
const dict_col_t* col) /*!< in: column */ const dict_col_t* col) /*!< in: column */
{ {
ut_ad(col);
return(col->ind); return(col->ind);
} }
@ -177,8 +172,6 @@ dict_col_get_clust_pos(
{ {
ulint i; ulint i;
ut_ad(col);
ut_ad(clust_index);
ut_ad(dict_index_is_clust(clust_index)); ut_ad(dict_index_is_clust(clust_index));
for (i = 0; i < clust_index->n_def; i++) { 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 */ const dict_table_t* table) /*!< in: table */
{ {
ut_ad(table);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
return(UT_LIST_GET_FIRST(((dict_table_t*) table)->indexes)); 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 */ const dict_table_t* table) /*!< in: table */
{ {
ut_ad(table);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
return(UT_LIST_GET_LAST((const_cast<dict_table_t*>(table)) return(UT_LIST_GET_LAST((const_cast<dict_table_t*>(table))
->indexes)); ->indexes));
} }
@ -234,9 +224,7 @@ dict_table_get_next_index(
/*======================*/ /*======================*/
const dict_index_t* index) /*!< in: index */ const dict_index_t* index) /*!< in: index */
{ {
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(UT_LIST_GET_NEXT(indexes, (dict_index_t*) index)); return(UT_LIST_GET_NEXT(indexes, (dict_index_t*) index));
} }
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
@ -252,7 +240,6 @@ dict_index_is_clust(
const dict_index_t* index) /*!< in: index */ const dict_index_t* index) /*!< in: index */
{ {
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(index->type & DICT_CLUSTERED); return(index->type & DICT_CLUSTERED);
} }
/********************************************************************//** /********************************************************************//**
@ -265,7 +252,6 @@ dict_index_is_unique(
const dict_index_t* index) /*!< in: index */ const dict_index_t* index) /*!< in: index */
{ {
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(index->type & DICT_UNIQUE); return(index->type & DICT_UNIQUE);
} }
@ -279,7 +265,6 @@ dict_index_is_ibuf(
const dict_index_t* index) /*!< in: index */ const dict_index_t* index) /*!< in: index */
{ {
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(index->type & DICT_IBUF); return(index->type & DICT_IBUF);
} }
@ -292,9 +277,7 @@ dict_index_is_univ(
/*===============*/ /*===============*/
const dict_index_t* index) /*!< in: index */ const dict_index_t* index) /*!< in: index */
{ {
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(index->type & DICT_UNIVERSAL); return(index->type & DICT_UNIVERSAL);
} }
@ -423,7 +406,6 @@ dict_table_get_nth_col(
const dict_table_t* table, /*!< in: table */ const dict_table_t* table, /*!< in: table */
ulint pos) /*!< in: position of column */ ulint pos) /*!< in: position of column */
{ {
ut_ad(table);
ut_ad(pos < table->n_def); ut_ad(pos < table->n_def);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); 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 */ const dict_table_t* table, /*!< in: table */
ulint sys) /*!< in: DATA_ROW_ID, ... */ ulint sys) /*!< in: DATA_ROW_ID, ... */
{ {
ut_ad(table);
ut_ad(sys < DATA_N_SYS_COLS); ut_ad(sys < DATA_N_SYS_COLS);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); 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 */ /* out: TRUE if table has an FTS index */
dict_table_t* table) /* in: table */ dict_table_t* table) /* in: table */
{ {
ut_ad(table);
return(DICT_TF2_FLAG_IS_SET(table, DICT_TF2_FTS)); return(DICT_TF2_FLAG_IS_SET(table, DICT_TF2_FTS));
} }
@ -1049,8 +1028,7 @@ dict_table_x_lock_indexes(
{ {
dict_index_t* index; 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 */ /* Loop through each index of the table and lock them */
for (index = dict_table_get_first_index(table); for (index = dict_table_get_first_index(table);
@ -1091,8 +1069,7 @@ dict_table_x_unlock_indexes(
{ {
dict_index_t* index; 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); for (index = dict_table_get_first_index(table);
index != NULL; index != NULL;
@ -1114,9 +1091,7 @@ dict_index_get_n_fields(
representation of index (in representation of index (in
the dictionary cache) */ the dictionary cache) */
{ {
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(index->n_fields); return(index->n_fields);
} }
@ -1133,10 +1108,8 @@ dict_index_get_n_unique(
const dict_index_t* index) /*!< in: an internal representation const dict_index_t* index) /*!< in: an internal representation
of index (in the dictionary cache) */ of index (in the dictionary cache) */
{ {
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
ut_ad(index->cached); ut_ad(index->cached);
return(index->n_uniq); return(index->n_uniq);
} }
@ -1152,7 +1125,6 @@ dict_index_get_n_unique_in_tree(
const dict_index_t* index) /*!< in: an internal representation const dict_index_t* index) /*!< in: an internal representation
of index (in the dictionary cache) */ of index (in the dictionary cache) */
{ {
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
ut_ad(index->cached); ut_ad(index->cached);
@ -1191,7 +1163,6 @@ dict_index_get_nth_field(
const dict_index_t* index, /*!< in: index */ const dict_index_t* index, /*!< in: index */
ulint pos) /*!< in: position of field */ ulint pos) /*!< in: position of field */
{ {
ut_ad(index);
ut_ad(pos < index->n_def); ut_ad(pos < index->n_def);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); 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 */ const dict_index_t* index, /*!< in: index */
ulint type) /*!< in: DATA_ROW_ID, ... */ ulint type) /*!< in: DATA_ROW_ID, ... */
{ {
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
ut_ad(!dict_index_is_univ(index)); ut_ad(!dict_index_is_univ(index));
@ -1234,8 +1204,6 @@ dict_field_get_col(
/*===============*/ /*===============*/
const dict_field_t* field) /*!< in: index field */ const dict_field_t* field) /*!< in: index field */
{ {
ut_ad(field);
return(field->col); return(field->col);
} }
@ -1341,7 +1309,6 @@ dict_index_get_page(
/*================*/ /*================*/
const dict_index_t* index) /*!< in: index */ const dict_index_t* index) /*!< in: index */
{ {
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(index->page); return(index->page);
@ -1356,7 +1323,6 @@ dict_index_get_lock(
/*================*/ /*================*/
dict_index_t* index) /*!< in: index */ dict_index_t* index) /*!< in: index */
{ {
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(&(index->lock)); return(&(index->lock));
@ -1533,9 +1499,7 @@ dict_table_is_corrupted(
/*====================*/ /*====================*/
const dict_table_t* table) /*!< in: table */ const dict_table_t* table) /*!< in: table */
{ {
ut_ad(table);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
return(table->corrupted); return(table->corrupted);
} }

View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. 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 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 the terms of the GNU General Public License as published by the Free Software
@ -373,15 +373,9 @@ rec_set_next_offs_old(
rec_t* rec, /*!< in: old-style physical record */ rec_t* rec, /*!< in: old-style physical record */
ulint next) /*!< in: offset of the next record */ ulint next) /*!< in: offset of the next record */
{ {
ut_ad(rec); ut_ad(srv_page_size > next);
ut_ad(UNIV_PAGE_SIZE > next); compile_time_assert(REC_NEXT_MASK == 0xFFFFUL);
#if REC_NEXT_MASK != 0xFFFFUL compile_time_assert(REC_NEXT_SHIFT == 0);
# error "REC_NEXT_MASK != 0xFFFFUL"
#endif
#if REC_NEXT_SHIFT
# error "REC_NEXT_SHIFT != 0"
#endif
mach_write_to_2(rec - REC_NEXT, next); mach_write_to_2(rec - REC_NEXT, next);
} }
@ -397,8 +391,7 @@ rec_set_next_offs_new(
{ {
ulint field_value; ulint field_value;
ut_ad(rec); ut_ad(srv_page_size > next);
ut_ad(UNIV_PAGE_SIZE > next);
if (!next) { if (!next) {
field_value = 0; field_value = 0;
@ -921,7 +914,6 @@ rec_offs_set_n_alloc(
must be allocated */ must be allocated */
ulint n_alloc) /*!< in: number of elements */ ulint n_alloc) /*!< in: number of elements */
{ {
ut_ad(offsets);
ut_ad(n_alloc > REC_OFFS_HEADER_SIZE); ut_ad(n_alloc > REC_OFFS_HEADER_SIZE);
UNIV_MEM_ALLOC(offsets, n_alloc * sizeof *offsets); UNIV_MEM_ALLOC(offsets, n_alloc * sizeof *offsets);
offsets[0] = n_alloc; offsets[0] = n_alloc;
@ -1039,7 +1031,6 @@ rec_get_nth_field_offs(
ulint offs; ulint offs;
ulint length; ulint length;
ut_ad(n < rec_offs_n_fields(offsets)); ut_ad(n < rec_offs_n_fields(offsets));
ut_ad(len);
if (n == 0) { if (n == 0) {
offs = 0; offs = 0;
@ -1387,7 +1378,6 @@ rec_set_nth_field(
byte* data2; byte* data2;
ulint len2; ulint len2;
ut_ad(rec);
ut_ad(rec_offs_validate(rec, NULL, offsets)); ut_ad(rec_offs_validate(rec, NULL, offsets));
if (len == UNIV_SQL_NULL) { if (len == UNIV_SQL_NULL) {
@ -1589,8 +1579,6 @@ rec_get_converted_size(
ulint data_size; ulint data_size;
ulint extra_size; ulint extra_size;
ut_ad(index);
ut_ad(dtuple);
ut_ad(dtuple_check_typed(dtuple)); ut_ad(dtuple_check_typed(dtuple));
ut_ad(dict_index_is_univ(index) ut_ad(dict_index_is_univ(index)

View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2018, MariaDB Corporation. Copyright (c) 2018, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -556,10 +556,6 @@ rec_get_offsets_func(
ulint n; ulint n;
ulint size; ulint size;
ut_ad(rec);
ut_ad(index);
ut_ad(heap);
if (dict_table_is_comp(index->table)) { if (dict_table_is_comp(index->table)) {
switch (UNIV_EXPECT(rec_get_status(rec), switch (UNIV_EXPECT(rec_get_status(rec),
REC_STATUS_ORDINARY)) { REC_STATUS_ORDINARY)) {
@ -637,9 +633,6 @@ rec_get_offsets_reverse(
ulint null_mask; ulint null_mask;
ulint n_node_ptr_field; ulint n_node_ptr_field;
ut_ad(extra);
ut_ad(index);
ut_ad(offsets);
ut_ad(dict_table_is_comp(index->table)); ut_ad(dict_table_is_comp(index->table));
if (UNIV_UNLIKELY(node_ptr)) { if (UNIV_UNLIKELY(node_ptr)) {
@ -748,8 +741,6 @@ rec_get_nth_field_offs_old(
ulint os; ulint os;
ulint next_os; ulint next_os;
ut_ad(len);
ut_a(rec);
ut_a(n < rec_get_n_fields_old(rec)); ut_a(n < rec_get_n_fields_old(rec));
if (rec_get_1byte_offs_flag(rec)) { if (rec_get_1byte_offs_flag(rec)) {
@ -1713,7 +1704,6 @@ rec_validate(
ulint sum = 0; ulint sum = 0;
ulint i; ulint i;
ut_a(rec);
n_fields = rec_offs_n_fields(offsets); n_fields = rec_offs_n_fields(offsets);
if ((n_fields == 0) || (n_fields > REC_MAX_N_FIELDS)) { if ((n_fields == 0) || (n_fields > REC_MAX_N_FIELDS)) {
@ -1777,8 +1767,6 @@ rec_print_old(
ulint n; ulint n;
ulint i; ulint i;
ut_ad(rec);
n = rec_get_n_fields_old(rec); n = rec_get_n_fields_old(rec);
fprintf(file, "PHYSICAL RECORD: n_fields %lu;" fprintf(file, "PHYSICAL RECORD: n_fields %lu;"
@ -1872,8 +1860,6 @@ rec_print_new(
const rec_t* rec, /*!< in: physical record */ const rec_t* rec, /*!< in: physical record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
{ {
ut_ad(rec);
ut_ad(offsets);
ut_ad(rec_offs_validate(rec, NULL, offsets)); ut_ad(rec_offs_validate(rec, NULL, offsets));
if (!rec_offs_comp(offsets)) { if (!rec_offs_comp(offsets)) {
@ -1900,8 +1886,6 @@ rec_print(
const rec_t* rec, /*!< in: physical record */ const rec_t* rec, /*!< in: physical record */
const dict_index_t* index) /*!< in: record descriptor */ const dict_index_t* index) /*!< in: record descriptor */
{ {
ut_ad(index);
if (!dict_table_is_comp(index->table)) { if (!dict_table_is_comp(index->table)) {
rec_print_old(file, rec); rec_print_old(file, rec);
return; return;

View File

@ -1415,9 +1415,6 @@ row_fts_merge_insert(
ulint count_diag = 0; ulint count_diag = 0;
ulint space; ulint space;
ut_ad(index);
ut_ad(table);
/* We use the insert query graph as the dummy graph /* We use the insert query graph as the dummy graph
needed in the row module call */ needed in the row module call */

View File

@ -489,8 +489,6 @@ row_ins_cascade_calc_update_vec(
ulint doc_id_pos = 0; ulint doc_id_pos = 0;
doc_id_t new_doc_id = FTS_NULL_DOC_ID; doc_id_t new_doc_id = FTS_NULL_DOC_ID;
ut_a(node);
ut_a(foreign);
ut_a(cascade); ut_a(cascade);
ut_a(table); ut_a(table);
ut_a(index); ut_a(index);
@ -985,11 +983,6 @@ row_ins_foreign_check_on_constraint(
doc_id_t doc_id = FTS_NULL_DOC_ID; doc_id_t doc_id = FTS_NULL_DOC_ID;
ibool fts_col_affacted = FALSE; ibool fts_col_affacted = FALSE;
ut_a(thr);
ut_a(foreign);
ut_a(pcur);
ut_a(mtr);
trx = thr_get_trx(thr); trx = thr_get_trx(thr);
/* Since we are going to delete or update a row, we have to invalidate /* Since we are going to delete or update a row, we have to invalidate

View File

@ -3468,7 +3468,6 @@ row_merge_rename_index_to_add(
"WHERE TABLE_ID = :tableid AND ID = :indexid;\n" "WHERE TABLE_ID = :tableid AND ID = :indexid;\n"
"END;\n"; "END;\n";
ut_ad(trx);
ut_a(trx->dict_operation_lock_mode == RW_X_LATCH); ut_a(trx->dict_operation_lock_mode == RW_X_LATCH);
ut_ad(trx_get_dict_operation(trx) == TRX_DICT_OP_INDEX); ut_ad(trx_get_dict_operation(trx) == TRX_DICT_OP_INDEX);
@ -3525,7 +3524,6 @@ row_merge_rename_index_to_drop(
"WHERE TABLE_ID = :tableid AND ID = :indexid;\n" "WHERE TABLE_ID = :tableid AND ID = :indexid;\n"
"END;\n"; "END;\n";
ut_ad(trx);
ut_a(trx->dict_operation_lock_mode == RW_X_LATCH); ut_a(trx->dict_operation_lock_mode == RW_X_LATCH);
ut_ad(trx_get_dict_operation(trx) == TRX_DICT_OP_INDEX); ut_ad(trx_get_dict_operation(trx) == TRX_DICT_OP_INDEX);

View File

@ -3235,7 +3235,6 @@ row_mysql_lock_table(
dberr_t err; dberr_t err;
sel_node_t* node; sel_node_t* node;
ut_ad(trx);
ut_ad(mode == LOCK_X || mode == LOCK_S); ut_ad(mode == LOCK_X || mode == LOCK_S);
heap = mem_heap_create(512); heap = mem_heap_create(512);

View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 2018, MariaDB Corporation. Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -968,8 +968,6 @@ row_purge_step(
{ {
purge_node_t* node; purge_node_t* node;
ut_ad(thr);
node = static_cast<purge_node_t*>(thr->run_node); node = static_cast<purge_node_t*>(thr->run_node);
node->table = NULL; node->table = NULL;

View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2018, MariaDB Corporation. Copyright (c) 2018, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -639,9 +639,6 @@ row_build_row_ref_in_tuple(
ulint offsets_[REC_OFFS_NORMAL_SIZE]; ulint offsets_[REC_OFFS_NORMAL_SIZE];
rec_offs_init(offsets_); rec_offs_init(offsets_);
ut_a(ref);
ut_a(index);
ut_a(rec);
ut_ad(!dict_index_is_clust(index)); ut_ad(!dict_index_is_clust(index));
if (UNIV_UNLIKELY(!index->table)) { if (UNIV_UNLIKELY(!index->table)) {

View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2018, MariaDB Corporation. Copyright (c) 2018, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -2202,7 +2202,6 @@ row_upd_clust_rec_by_insert(
rec_t* rec; rec_t* rec;
ulint* offsets = NULL; ulint* offsets = NULL;
ut_ad(node);
ut_ad(dict_index_is_clust(index)); ut_ad(dict_index_is_clust(index));
trx = thr_get_trx(thr); trx = thr_get_trx(thr);
@ -2348,7 +2347,6 @@ row_upd_clust_rec(
dberr_t err; dberr_t err;
const dtuple_t* rebuilt_old_pk = NULL; const dtuple_t* rebuilt_old_pk = NULL;
ut_ad(node);
ut_ad(dict_index_is_clust(index)); ut_ad(dict_index_is_clust(index));
pcur = node->pcur; pcur = node->pcur;
@ -2513,7 +2511,6 @@ row_upd_del_mark_clust_rec(
trx_t* trx = thr_get_trx(thr) ; trx_t* trx = thr_get_trx(thr) ;
#endif /* WITH_WSREP */ #endif /* WITH_WSREP */
ut_ad(node);
ut_ad(dict_index_is_clust(index)); ut_ad(dict_index_is_clust(index));
ut_ad(node->is_delete); ut_ad(node->is_delete);

View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 2018, MariaDB Corporation. Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -1087,10 +1087,7 @@ trx_undo_rec_get_partial_row(
const byte* end_ptr; const byte* end_ptr;
ulint row_len; ulint row_len;
ut_ad(index);
ut_ad(ptr); ut_ad(ptr);
ut_ad(row);
ut_ad(heap);
ut_ad(dict_index_is_clust(index)); ut_ad(dict_index_is_clust(index));
row_len = dict_table_get_n_cols(index->table); row_len = dict_table_get_n_cols(index->table);

View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 2006, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2006, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2018, MariaDB Corporation. Copyright (c) 2018, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software

View File

@ -1,6 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -106,8 +107,6 @@ dtuple_set_n_fields(
dtuple_t* tuple, /*!< in: tuple */ dtuple_t* tuple, /*!< in: tuple */
ulint n_fields) /*!< in: number of fields */ ulint n_fields) /*!< in: number of fields */
{ {
ut_ad(tuple);
tuple->n_fields = n_fields; tuple->n_fields = n_fields;
tuple->n_fields_cmp = n_fields; tuple->n_fields_cmp = n_fields;
} }

View File

@ -946,7 +946,6 @@ dict_index_get_nth_field_pos(
ulint n_fields; ulint n_fields;
ulint pos; ulint pos;
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
field2 = dict_index_get_nth_field(index2, n); field2 = dict_index_get_nth_field(index2, n);
@ -1044,8 +1043,6 @@ dict_table_col_in_clustered_key(
ulint pos; ulint pos;
ulint n_fields; ulint n_fields;
ut_ad(table);
col = dict_table_get_nth_col(table, n); col = dict_table_get_nth_col(table, n);
index = dict_table_get_first_index(table); index = dict_table_get_first_index(table);
@ -1220,7 +1217,6 @@ dict_table_add_system_columns(
dict_table_t* table, /*!< in/out: table */ dict_table_t* table, /*!< in/out: table */
mem_heap_t* heap) /*!< in: temporary heap */ mem_heap_t* heap) /*!< in: temporary heap */
{ {
ut_ad(table);
ut_ad(table->n_def == table->n_cols - DATA_N_SYS_COLS); ut_ad(table->n_def == table->n_cols - DATA_N_SYS_COLS);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
ut_ad(!table->cached); ut_ad(!table->cached);
@ -2030,8 +2026,7 @@ dict_table_change_id_in_cache(
dict_table_t* table, /*!< in/out: table object already in cache */ dict_table_t* table, /*!< in/out: table object already in cache */
table_id_t new_id) /*!< in: new id to set */ table_id_t new_id) /*!< in: new id to set */
{ {
ut_ad(table); ut_ad(mutex_own(&dict_sys->mutex));
ut_ad(mutex_own(&(dict_sys->mutex)));
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
/* Remove the table from the hash table of id's */ /* Remove the table from the hash table of id's */
@ -2057,7 +2052,6 @@ dict_table_remove_from_cache_low(
dict_foreign_t* foreign; dict_foreign_t* foreign;
dict_index_t* index; dict_index_t* index;
ut_ad(table);
ut_ad(dict_lru_validate()); ut_ad(dict_lru_validate());
ut_a(table->n_ref_count == 0); ut_a(table->n_ref_count == 0);
ut_a(table->n_rec_locks == 0); ut_a(table->n_rec_locks == 0);
@ -2506,8 +2500,7 @@ dict_index_add_to_cache(
ulint n_ord; ulint n_ord;
ulint i; ulint i;
ut_ad(index); ut_ad(mutex_own(&dict_sys->mutex));
ut_ad(mutex_own(&(dict_sys->mutex)));
ut_ad(index->n_def == index->n_fields); ut_ad(index->n_def == index->n_fields);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
ut_ad(!dict_index_is_online_ddl(index)); ut_ad(!dict_index_is_online_ddl(index));
@ -5290,7 +5283,6 @@ dict_foreign_parse_drop_constraints(
const char* id; const char* id;
struct charset_info_st* cs; struct charset_info_st* cs;
ut_a(trx);
ut_a(trx->mysql_thd); ut_a(trx->mysql_thd);
cs = innobase_get_charset(trx->mysql_thd); cs = innobase_get_charset(trx->mysql_thd);
@ -5463,9 +5455,8 @@ dict_index_check_search_tuple(
const dict_index_t* index, /*!< in: index tree */ const dict_index_t* index, /*!< in: index tree */
const dtuple_t* tuple) /*!< in: tuple used in a search */ const dtuple_t* tuple) /*!< in: tuple used in a search */
{ {
ut_a(index); ut_ad(dtuple_get_n_fields_cmp(tuple)
ut_a(dtuple_get_n_fields_cmp(tuple) <= dict_index_get_n_unique_in_tree(index));
<= dict_index_get_n_unique_in_tree(index));
return(TRUE); return(TRUE);
} }
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
@ -7122,8 +7113,6 @@ dict_index_zip_success(
/*===================*/ /*===================*/
dict_index_t* index) /*!< in/out: index to be updated. */ dict_index_t* index) /*!< in/out: index to be updated. */
{ {
ut_ad(index);
ulint zip_threshold = zip_failure_threshold_pct; ulint zip_threshold = zip_failure_threshold_pct;
if (!zip_threshold) { if (!zip_threshold) {
/* Disabled by user. */ /* Disabled by user. */
@ -7145,8 +7134,6 @@ dict_index_zip_failure(
/*===================*/ /*===================*/
dict_index_t* index) /*!< in/out: index to be updated. */ dict_index_t* index) /*!< in/out: index to be updated. */
{ {
ut_ad(index);
ulint zip_threshold = zip_failure_threshold_pct; ulint zip_threshold = zip_failure_threshold_pct;
if (!zip_threshold) { if (!zip_threshold) {
/* Disabled by user. */ /* Disabled by user. */
@ -7174,8 +7161,6 @@ dict_index_zip_pad_optimal_page_size(
ulint min_sz; ulint min_sz;
ulint sz; ulint sz;
ut_ad(index);
if (!zip_failure_threshold_pct) { if (!zip_failure_threshold_pct) {
/* Disabled by user. */ /* Disabled by user. */
return(UNIV_PAGE_SIZE); return(UNIV_PAGE_SIZE);

View File

@ -276,7 +276,6 @@ dict_mem_table_add_col(
dict_col_t* col; dict_col_t* col;
ulint i; ulint i;
ut_ad(table);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
ut_ad(!heap == !name); ut_ad(!heap == !name);

View File

@ -1516,8 +1516,8 @@ name_ok:
index index
@param[in] altered_table MySQL table that is being altered @param[in] altered_table MySQL table that is being altered
@param[in] key_part MySQL key definition @param[in] key_part MySQL key definition
@param[out] index_field index field defition for key_part */ @param[out] index_field index field definition for key_part */
static MY_ATTRIBUTE((nonnull(2,3))) static MY_ATTRIBUTE((nonnull))
void void
innobase_create_index_field_def( innobase_create_index_field_def(
bool new_clustered, bool new_clustered,
@ -1532,10 +1532,6 @@ innobase_create_index_field_def(
DBUG_ENTER("innobase_create_index_field_def"); DBUG_ENTER("innobase_create_index_field_def");
ut_ad(key_part);
ut_ad(index_field);
ut_ad(altered_table);
/* Virtual columns are not stored in InnoDB data dictionary, thus /* Virtual columns are not stored in InnoDB data dictionary, thus
if there is virtual columns we need to skip them to find the if there is virtual columns we need to skip them to find the
correct field. */ correct field. */
@ -1599,8 +1595,6 @@ innobase_create_index_def(
DBUG_ENTER("innobase_create_index_def"); DBUG_ENTER("innobase_create_index_def");
DBUG_ASSERT(!key_clustered || new_clustered); DBUG_ASSERT(!key_clustered || new_clustered);
ut_ad(altered_table);
index->fields = static_cast<index_field_t*>( index->fields = static_cast<index_field_t*>(
mem_heap_alloc(heap, n_fields * sizeof *index->fields)); mem_heap_alloc(heap, n_fields * sizeof *index->fields));
index->ind_type = 0; index->ind_type = 0;
@ -4845,7 +4839,6 @@ innobase_rename_columns_try(
ha_alter_info->alter_info->create_list); ha_alter_info->alter_info->create_list);
uint i = 0; uint i = 0;
DBUG_ASSERT(ctx);
DBUG_ASSERT(ha_alter_info->handler_flags DBUG_ASSERT(ha_alter_info->handler_flags
& Alter_inplace_info::ALTER_COLUMN_NAME); & Alter_inplace_info::ALTER_COLUMN_NAME);
@ -5029,7 +5022,6 @@ innobase_update_foreign_try(
ulint i; ulint i;
DBUG_ENTER("innobase_update_foreign_try"); DBUG_ENTER("innobase_update_foreign_try");
DBUG_ASSERT(ctx);
foreign_id = dict_table_get_highest_foreign_id(ctx->new_table); foreign_id = dict_table_get_highest_foreign_id(ctx->new_table);

View File

@ -1,6 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -41,8 +42,6 @@ dfield_get_type(
/*============*/ /*============*/
const dfield_t* field) /*!< in: SQL data field */ const dfield_t* field) /*!< in: SQL data field */
{ {
ut_ad(field);
return((dtype_t*) &(field->type)); return((dtype_t*) &(field->type));
} }
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
@ -72,7 +71,6 @@ dfield_get_data(
/*============*/ /*============*/
const dfield_t* field) /*!< in: field */ const dfield_t* field) /*!< in: field */
{ {
ut_ad(field);
ut_ad((field->len == UNIV_SQL_NULL) ut_ad((field->len == UNIV_SQL_NULL)
|| (field->data != &data_error)); || (field->data != &data_error));
@ -89,7 +87,6 @@ dfield_get_len(
/*===========*/ /*===========*/
const dfield_t* field) /*!< in: field */ const dfield_t* field) /*!< in: field */
{ {
ut_ad(field);
ut_ad((field->len == UNIV_SQL_NULL) ut_ad((field->len == UNIV_SQL_NULL)
|| (field->data != &data_error)); || (field->data != &data_error));
@ -105,7 +102,6 @@ dfield_set_len(
dfield_t* field, /*!< in: field */ dfield_t* field, /*!< in: field */
ulint len) /*!< in: length or UNIV_SQL_NULL */ ulint len) /*!< in: length or UNIV_SQL_NULL */
{ {
ut_ad(field);
#ifdef UNIV_VALGRIND_DEBUG #ifdef UNIV_VALGRIND_DEBUG
if (len != UNIV_SQL_NULL) UNIV_MEM_ASSERT_RW(field->data, len); if (len != UNIV_SQL_NULL) UNIV_MEM_ASSERT_RW(field->data, len);
#endif /* UNIV_VALGRIND_DEBUG */ #endif /* UNIV_VALGRIND_DEBUG */
@ -123,8 +119,6 @@ dfield_is_null(
/*===========*/ /*===========*/
const dfield_t* field) /*!< in: field */ const dfield_t* field) /*!< in: field */
{ {
ut_ad(field);
return(field->len == UNIV_SQL_NULL); return(field->len == UNIV_SQL_NULL);
} }
@ -137,8 +131,6 @@ dfield_is_ext(
/*==========*/ /*==========*/
const dfield_t* field) /*!< in: field */ const dfield_t* field) /*!< in: field */
{ {
ut_ad(field);
return(field->ext); return(field->ext);
} }
@ -150,8 +142,6 @@ dfield_set_ext(
/*===========*/ /*===========*/
dfield_t* field) /*!< in/out: field */ dfield_t* field) /*!< in/out: field */
{ {
ut_ad(field);
field->ext = 1; field->ext = 1;
} }
@ -165,8 +155,6 @@ dfield_set_data(
const void* data, /*!< in: data */ const void* data, /*!< in: data */
ulint len) /*!< in: length or UNIV_SQL_NULL */ ulint len) /*!< in: length or UNIV_SQL_NULL */
{ {
ut_ad(field);
#ifdef UNIV_VALGRIND_DEBUG #ifdef UNIV_VALGRIND_DEBUG
if (len != UNIV_SQL_NULL) UNIV_MEM_ASSERT_RW(data, len); if (len != UNIV_SQL_NULL) UNIV_MEM_ASSERT_RW(data, len);
#endif /* UNIV_VALGRIND_DEBUG */ #endif /* UNIV_VALGRIND_DEBUG */
@ -286,8 +274,6 @@ dtuple_get_info_bits(
/*=================*/ /*=================*/
const dtuple_t* tuple) /*!< in: tuple */ const dtuple_t* tuple) /*!< in: tuple */
{ {
ut_ad(tuple);
return(tuple->info_bits); return(tuple->info_bits);
} }
@ -300,8 +286,6 @@ dtuple_set_info_bits(
dtuple_t* tuple, /*!< in: tuple */ dtuple_t* tuple, /*!< in: tuple */
ulint info_bits) /*!< in: info bits */ ulint info_bits) /*!< in: info bits */
{ {
ut_ad(tuple);
tuple->info_bits = info_bits; tuple->info_bits = info_bits;
} }
@ -314,8 +298,6 @@ dtuple_get_n_fields_cmp(
/*====================*/ /*====================*/
const dtuple_t* tuple) /*!< in: tuple */ const dtuple_t* tuple) /*!< in: tuple */
{ {
ut_ad(tuple);
return(tuple->n_fields_cmp); return(tuple->n_fields_cmp);
} }
@ -329,9 +311,7 @@ dtuple_set_n_fields_cmp(
ulint n_fields_cmp) /*!< in: number of fields used in ulint n_fields_cmp) /*!< in: number of fields used in
comparisons in rem0cmp.* */ comparisons in rem0cmp.* */
{ {
ut_ad(tuple);
ut_ad(n_fields_cmp <= tuple->n_fields); ut_ad(n_fields_cmp <= tuple->n_fields);
tuple->n_fields_cmp = n_fields_cmp; tuple->n_fields_cmp = n_fields_cmp;
} }
@ -344,8 +324,6 @@ dtuple_get_n_fields(
/*================*/ /*================*/
const dtuple_t* tuple) /*!< in: tuple */ const dtuple_t* tuple) /*!< in: tuple */
{ {
ut_ad(tuple);
return(tuple->n_fields); return(tuple->n_fields);
} }
@ -483,7 +461,6 @@ dtuple_get_data_size(
ulint i; ulint i;
ulint sum = 0; ulint sum = 0;
ut_ad(tuple);
ut_ad(dtuple_check_typed(tuple)); ut_ad(dtuple_check_typed(tuple));
ut_ad(tuple->magic_n == DATA_TUPLE_MAGIC_N); ut_ad(tuple->magic_n == DATA_TUPLE_MAGIC_N);
@ -517,7 +494,6 @@ dtuple_get_n_ext(
ulint n_fields = tuple->n_fields; ulint n_fields = tuple->n_fields;
ulint i; ulint i;
ut_ad(tuple);
ut_ad(dtuple_check_typed(tuple)); ut_ad(dtuple_check_typed(tuple));
ut_ad(tuple->magic_n == DATA_TUPLE_MAGIC_N); ut_ad(tuple->magic_n == DATA_TUPLE_MAGIC_N);

View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved. 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 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 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 dict_col_t* col, /*!< in: column */
const dtype_t* type) /*!< in: data type */ const dtype_t* type) /*!< in: data type */
{ {
ut_ad(col);
ut_ad(type);
ut_ad(col->mtype == type->mtype); ut_ad(col->mtype == type->mtype);
ut_ad(col->prtype == type->prtype); ut_ad(col->prtype == type->prtype);
//ut_ad(col->len == type->len); //ut_ad(col->len == type->len);
@ -161,8 +158,6 @@ dict_col_get_no(
/*============*/ /*============*/
const dict_col_t* col) /*!< in: column */ const dict_col_t* col) /*!< in: column */
{ {
ut_ad(col);
return(col->ind); return(col->ind);
} }
@ -177,8 +172,6 @@ dict_col_get_clust_pos(
{ {
ulint i; ulint i;
ut_ad(col);
ut_ad(clust_index);
ut_ad(dict_index_is_clust(clust_index)); ut_ad(dict_index_is_clust(clust_index));
for (i = 0; i < clust_index->n_def; i++) { 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 */ const dict_table_t* table) /*!< in: table */
{ {
ut_ad(table);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
return(UT_LIST_GET_FIRST(((dict_table_t*) table)->indexes)); 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 */ const dict_table_t* table) /*!< in: table */
{ {
ut_ad(table);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
return(UT_LIST_GET_LAST((const_cast<dict_table_t*>(table)) return(UT_LIST_GET_LAST((const_cast<dict_table_t*>(table))
->indexes)); ->indexes));
} }
@ -234,9 +224,7 @@ dict_table_get_next_index(
/*======================*/ /*======================*/
const dict_index_t* index) /*!< in: index */ const dict_index_t* index) /*!< in: index */
{ {
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(UT_LIST_GET_NEXT(indexes, (dict_index_t*) index)); return(UT_LIST_GET_NEXT(indexes, (dict_index_t*) index));
} }
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
@ -252,7 +240,6 @@ dict_index_is_clust(
const dict_index_t* index) /*!< in: index */ const dict_index_t* index) /*!< in: index */
{ {
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(index->type & DICT_CLUSTERED); return(index->type & DICT_CLUSTERED);
} }
/********************************************************************//** /********************************************************************//**
@ -265,7 +252,6 @@ dict_index_is_unique(
const dict_index_t* index) /*!< in: index */ const dict_index_t* index) /*!< in: index */
{ {
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(index->type & DICT_UNIQUE); return(index->type & DICT_UNIQUE);
} }
@ -279,7 +265,6 @@ dict_index_is_ibuf(
const dict_index_t* index) /*!< in: index */ const dict_index_t* index) /*!< in: index */
{ {
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(index->type & DICT_IBUF); return(index->type & DICT_IBUF);
} }
@ -292,9 +277,7 @@ dict_index_is_univ(
/*===============*/ /*===============*/
const dict_index_t* index) /*!< in: index */ const dict_index_t* index) /*!< in: index */
{ {
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(index->type & DICT_UNIVERSAL); return(index->type & DICT_UNIVERSAL);
} }
@ -423,7 +406,6 @@ dict_table_get_nth_col(
const dict_table_t* table, /*!< in: table */ const dict_table_t* table, /*!< in: table */
ulint pos) /*!< in: position of column */ ulint pos) /*!< in: position of column */
{ {
ut_ad(table);
ut_ad(pos < table->n_def); ut_ad(pos < table->n_def);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); 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 */ const dict_table_t* table, /*!< in: table */
ulint sys) /*!< in: DATA_ROW_ID, ... */ ulint sys) /*!< in: DATA_ROW_ID, ... */
{ {
ut_ad(table);
ut_ad(sys < DATA_N_SYS_COLS); ut_ad(sys < DATA_N_SYS_COLS);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); 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 */ /* out: TRUE if table has an FTS index */
dict_table_t* table) /* in: table */ dict_table_t* table) /* in: table */
{ {
ut_ad(table);
return(DICT_TF2_FLAG_IS_SET(table, DICT_TF2_FTS)); return(DICT_TF2_FLAG_IS_SET(table, DICT_TF2_FTS));
} }
@ -1049,8 +1028,7 @@ dict_table_x_lock_indexes(
{ {
dict_index_t* index; 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 */ /* Loop through each index of the table and lock them */
for (index = dict_table_get_first_index(table); for (index = dict_table_get_first_index(table);
@ -1091,8 +1069,7 @@ dict_table_x_unlock_indexes(
{ {
dict_index_t* index; 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); for (index = dict_table_get_first_index(table);
index != NULL; index != NULL;
@ -1114,9 +1091,7 @@ dict_index_get_n_fields(
representation of index (in representation of index (in
the dictionary cache) */ the dictionary cache) */
{ {
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(index->n_fields); return(index->n_fields);
} }
@ -1133,10 +1108,8 @@ dict_index_get_n_unique(
const dict_index_t* index) /*!< in: an internal representation const dict_index_t* index) /*!< in: an internal representation
of index (in the dictionary cache) */ of index (in the dictionary cache) */
{ {
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
ut_ad(index->cached); ut_ad(index->cached);
return(index->n_uniq); return(index->n_uniq);
} }
@ -1152,7 +1125,6 @@ dict_index_get_n_unique_in_tree(
const dict_index_t* index) /*!< in: an internal representation const dict_index_t* index) /*!< in: an internal representation
of index (in the dictionary cache) */ of index (in the dictionary cache) */
{ {
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
ut_ad(index->cached); ut_ad(index->cached);
@ -1191,7 +1163,6 @@ dict_index_get_nth_field(
const dict_index_t* index, /*!< in: index */ const dict_index_t* index, /*!< in: index */
ulint pos) /*!< in: position of field */ ulint pos) /*!< in: position of field */
{ {
ut_ad(index);
ut_ad(pos < index->n_def); ut_ad(pos < index->n_def);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); 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 */ const dict_index_t* index, /*!< in: index */
ulint type) /*!< in: DATA_ROW_ID, ... */ ulint type) /*!< in: DATA_ROW_ID, ... */
{ {
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
ut_ad(!dict_index_is_univ(index)); ut_ad(!dict_index_is_univ(index));
@ -1234,8 +1204,6 @@ dict_field_get_col(
/*===============*/ /*===============*/
const dict_field_t* field) /*!< in: index field */ const dict_field_t* field) /*!< in: index field */
{ {
ut_ad(field);
return(field->col); return(field->col);
} }
@ -1341,7 +1309,6 @@ dict_index_get_page(
/*================*/ /*================*/
const dict_index_t* index) /*!< in: index */ const dict_index_t* index) /*!< in: index */
{ {
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(index->page); return(index->page);
@ -1356,7 +1323,6 @@ dict_index_get_lock(
/*================*/ /*================*/
dict_index_t* index) /*!< in: index */ dict_index_t* index) /*!< in: index */
{ {
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(&(index->lock)); return(&(index->lock));

View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. 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 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 the terms of the GNU General Public License as published by the Free Software
@ -373,15 +373,9 @@ rec_set_next_offs_old(
rec_t* rec, /*!< in: old-style physical record */ rec_t* rec, /*!< in: old-style physical record */
ulint next) /*!< in: offset of the next record */ ulint next) /*!< in: offset of the next record */
{ {
ut_ad(rec); ut_ad(srv_page_size > next);
ut_ad(UNIV_PAGE_SIZE > next); compile_time_assert(REC_NEXT_MASK == 0xFFFFUL);
#if REC_NEXT_MASK != 0xFFFFUL compile_time_assert(REC_NEXT_SHIFT == 0);
# error "REC_NEXT_MASK != 0xFFFFUL"
#endif
#if REC_NEXT_SHIFT
# error "REC_NEXT_SHIFT != 0"
#endif
mach_write_to_2(rec - REC_NEXT, next); mach_write_to_2(rec - REC_NEXT, next);
} }
@ -397,8 +391,7 @@ rec_set_next_offs_new(
{ {
ulint field_value; ulint field_value;
ut_ad(rec); ut_ad(srv_page_size > next);
ut_ad(UNIV_PAGE_SIZE > next);
if (!next) { if (!next) {
field_value = 0; field_value = 0;
@ -921,7 +914,6 @@ rec_offs_set_n_alloc(
must be allocated */ must be allocated */
ulint n_alloc) /*!< in: number of elements */ ulint n_alloc) /*!< in: number of elements */
{ {
ut_ad(offsets);
ut_ad(n_alloc > REC_OFFS_HEADER_SIZE); ut_ad(n_alloc > REC_OFFS_HEADER_SIZE);
UNIV_MEM_ALLOC(offsets, n_alloc * sizeof *offsets); UNIV_MEM_ALLOC(offsets, n_alloc * sizeof *offsets);
offsets[0] = n_alloc; offsets[0] = n_alloc;
@ -1039,7 +1031,6 @@ rec_get_nth_field_offs(
ulint offs; ulint offs;
ulint length; ulint length;
ut_ad(n < rec_offs_n_fields(offsets)); ut_ad(n < rec_offs_n_fields(offsets));
ut_ad(len);
if (n == 0) { if (n == 0) {
offs = 0; offs = 0;
@ -1387,7 +1378,6 @@ rec_set_nth_field(
byte* data2; byte* data2;
ulint len2; ulint len2;
ut_ad(rec);
ut_ad(rec_offs_validate(rec, NULL, offsets)); ut_ad(rec_offs_validate(rec, NULL, offsets));
if (len == UNIV_SQL_NULL) { if (len == UNIV_SQL_NULL) {
@ -1589,8 +1579,6 @@ rec_get_converted_size(
ulint data_size; ulint data_size;
ulint extra_size; ulint extra_size;
ut_ad(index);
ut_ad(dtuple);
ut_ad(dtuple_check_typed(dtuple)); ut_ad(dtuple_check_typed(dtuple));
ut_ad(dict_index_is_univ(index) ut_ad(dict_index_is_univ(index)

View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 2018, MariaDB Corporation. Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -556,10 +556,6 @@ rec_get_offsets_func(
ulint n; ulint n;
ulint size; ulint size;
ut_ad(rec);
ut_ad(index);
ut_ad(heap);
if (dict_table_is_comp(index->table)) { if (dict_table_is_comp(index->table)) {
switch (UNIV_EXPECT(rec_get_status(rec), switch (UNIV_EXPECT(rec_get_status(rec),
REC_STATUS_ORDINARY)) { REC_STATUS_ORDINARY)) {
@ -637,9 +633,6 @@ rec_get_offsets_reverse(
ulint null_mask; ulint null_mask;
ulint n_node_ptr_field; ulint n_node_ptr_field;
ut_ad(extra);
ut_ad(index);
ut_ad(offsets);
ut_ad(dict_table_is_comp(index->table)); ut_ad(dict_table_is_comp(index->table));
if (UNIV_UNLIKELY(node_ptr)) { if (UNIV_UNLIKELY(node_ptr)) {
@ -748,8 +741,6 @@ rec_get_nth_field_offs_old(
ulint os; ulint os;
ulint next_os; ulint next_os;
ut_ad(len);
ut_a(rec);
ut_a(n < rec_get_n_fields_old(rec)); ut_a(n < rec_get_n_fields_old(rec));
if (rec_get_1byte_offs_flag(rec)) { if (rec_get_1byte_offs_flag(rec)) {
@ -1717,7 +1708,6 @@ rec_validate(
ulint sum = 0; ulint sum = 0;
ulint i; ulint i;
ut_a(rec);
n_fields = rec_offs_n_fields(offsets); n_fields = rec_offs_n_fields(offsets);
if ((n_fields == 0) || (n_fields > REC_MAX_N_FIELDS)) { if ((n_fields == 0) || (n_fields > REC_MAX_N_FIELDS)) {
@ -1781,8 +1771,6 @@ rec_print_old(
ulint n; ulint n;
ulint i; ulint i;
ut_ad(rec);
n = rec_get_n_fields_old(rec); n = rec_get_n_fields_old(rec);
fprintf(file, "PHYSICAL RECORD: n_fields %lu;" fprintf(file, "PHYSICAL RECORD: n_fields %lu;"
@ -1876,8 +1864,6 @@ rec_print_new(
const rec_t* rec, /*!< in: physical record */ const rec_t* rec, /*!< in: physical record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
{ {
ut_ad(rec);
ut_ad(offsets);
ut_ad(rec_offs_validate(rec, NULL, offsets)); ut_ad(rec_offs_validate(rec, NULL, offsets));
if (!rec_offs_comp(offsets)) { if (!rec_offs_comp(offsets)) {
@ -1904,8 +1890,6 @@ rec_print(
const rec_t* rec, /*!< in: physical record */ const rec_t* rec, /*!< in: physical record */
const dict_index_t* index) /*!< in: record descriptor */ const dict_index_t* index) /*!< in: record descriptor */
{ {
ut_ad(index);
if (!dict_table_is_comp(index->table)) { if (!dict_table_is_comp(index->table)) {
rec_print_old(file, rec); rec_print_old(file, rec);
return; return;

View File

@ -1418,9 +1418,6 @@ row_fts_merge_insert(
ulint count_diag = 0; ulint count_diag = 0;
ulint space; ulint space;
ut_ad(index);
ut_ad(table);
/* We use the insert query graph as the dummy graph /* We use the insert query graph as the dummy graph
needed in the row module call */ needed in the row module call */

View File

@ -495,8 +495,6 @@ row_ins_cascade_calc_update_vec(
ulint doc_id_pos = 0; ulint doc_id_pos = 0;
doc_id_t new_doc_id = FTS_NULL_DOC_ID; doc_id_t new_doc_id = FTS_NULL_DOC_ID;
ut_a(node);
ut_a(foreign);
ut_a(cascade); ut_a(cascade);
ut_a(table); ut_a(table);
ut_a(index); ut_a(index);
@ -991,11 +989,6 @@ row_ins_foreign_check_on_constraint(
doc_id_t doc_id = FTS_NULL_DOC_ID; doc_id_t doc_id = FTS_NULL_DOC_ID;
ibool fts_col_affacted = FALSE; ibool fts_col_affacted = FALSE;
ut_a(thr);
ut_a(foreign);
ut_a(pcur);
ut_a(mtr);
trx = thr_get_trx(thr); trx = thr_get_trx(thr);
/* Since we are going to delete or update a row, we have to invalidate /* Since we are going to delete or update a row, we have to invalidate

View File

@ -3471,7 +3471,6 @@ row_merge_rename_index_to_add(
"WHERE TABLE_ID = :tableid AND ID = :indexid;\n" "WHERE TABLE_ID = :tableid AND ID = :indexid;\n"
"END;\n"; "END;\n";
ut_ad(trx);
ut_a(trx->dict_operation_lock_mode == RW_X_LATCH); ut_a(trx->dict_operation_lock_mode == RW_X_LATCH);
ut_ad(trx_get_dict_operation(trx) == TRX_DICT_OP_INDEX); ut_ad(trx_get_dict_operation(trx) == TRX_DICT_OP_INDEX);
@ -3528,7 +3527,6 @@ row_merge_rename_index_to_drop(
"WHERE TABLE_ID = :tableid AND ID = :indexid;\n" "WHERE TABLE_ID = :tableid AND ID = :indexid;\n"
"END;\n"; "END;\n";
ut_ad(trx);
ut_a(trx->dict_operation_lock_mode == RW_X_LATCH); ut_a(trx->dict_operation_lock_mode == RW_X_LATCH);
ut_ad(trx_get_dict_operation(trx) == TRX_DICT_OP_INDEX); ut_ad(trx_get_dict_operation(trx) == TRX_DICT_OP_INDEX);

View File

@ -3239,7 +3239,6 @@ row_mysql_lock_table(
dberr_t err; dberr_t err;
sel_node_t* node; sel_node_t* node;
ut_ad(trx);
ut_ad(mode == LOCK_X || mode == LOCK_S); ut_ad(mode == LOCK_X || mode == LOCK_S);
heap = mem_heap_create(512); heap = mem_heap_create(512);

View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 2018, MariaDB Corporation. Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -968,8 +968,6 @@ row_purge_step(
{ {
purge_node_t* node; purge_node_t* node;
ut_ad(thr);
node = static_cast<purge_node_t*>(thr->run_node); node = static_cast<purge_node_t*>(thr->run_node);
node->table = NULL; node->table = NULL;

View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2018, MariaDB Corporation. Copyright (c) 2018, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -639,9 +639,6 @@ row_build_row_ref_in_tuple(
ulint offsets_[REC_OFFS_NORMAL_SIZE]; ulint offsets_[REC_OFFS_NORMAL_SIZE];
rec_offs_init(offsets_); rec_offs_init(offsets_);
ut_a(ref);
ut_a(index);
ut_a(rec);
ut_ad(!dict_index_is_clust(index)); ut_ad(!dict_index_is_clust(index));
if (UNIV_UNLIKELY(!index->table)) { if (UNIV_UNLIKELY(!index->table)) {

View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2018, MariaDB Corporation. Copyright (c) 2018, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -2208,7 +2208,6 @@ row_upd_clust_rec_by_insert(
rec_t* rec; rec_t* rec;
ulint* offsets = NULL; ulint* offsets = NULL;
ut_ad(node);
ut_ad(dict_index_is_clust(index)); ut_ad(dict_index_is_clust(index));
trx = thr_get_trx(thr); trx = thr_get_trx(thr);
@ -2357,7 +2356,6 @@ row_upd_clust_rec(
dberr_t err; dberr_t err;
const dtuple_t* rebuilt_old_pk = NULL; const dtuple_t* rebuilt_old_pk = NULL;
ut_ad(node);
ut_ad(dict_index_is_clust(index)); ut_ad(dict_index_is_clust(index));
pcur = node->pcur; pcur = node->pcur;
@ -2525,7 +2523,6 @@ row_upd_del_mark_clust_rec(
trx_t* trx = thr_get_trx(thr) ; trx_t* trx = thr_get_trx(thr) ;
#endif /* WITH_WSREP */ #endif /* WITH_WSREP */
ut_ad(node);
ut_ad(dict_index_is_clust(index)); ut_ad(dict_index_is_clust(index));
ut_ad(node->is_delete); ut_ad(node->is_delete);

View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 2018, MariaDB Corporation. Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -1087,10 +1087,7 @@ trx_undo_rec_get_partial_row(
const byte* end_ptr; const byte* end_ptr;
ulint row_len; ulint row_len;
ut_ad(index);
ut_ad(ptr); ut_ad(ptr);
ut_ad(row);
ut_ad(heap);
ut_ad(dict_index_is_clust(index)); ut_ad(dict_index_is_clust(index));
row_len = dict_table_get_n_cols(index->table); row_len = dict_table_get_n_cols(index->table);