summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-04-03 09:46:49 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-04-03 09:46:49 +0300
commitc0fca2863bcbd7cd231f1aa747b4f8d999e3a00e (patch)
tree81bffdb7541b3957dde9d7b689baa7b43375ce67
parent65d758aa891bdafca6c881d3e7075979de3395e9 (diff)
downloadmariadb-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.
-rw-r--r--storage/innobase/buf/buf0buddy.cc3
-rw-r--r--storage/innobase/data/data0data.cc3
-rw-r--r--storage/innobase/dict/dict0dict.cc23
-rw-r--r--storage/innobase/dict/dict0mem.cc1
-rw-r--r--storage/innobase/handler/handler0alter.cc12
-rw-r--r--storage/innobase/include/data0data.ic28
-rw-r--r--storage/innobase/include/dict0dict.ic42
-rw-r--r--storage/innobase/include/rem0rec.ic24
-rw-r--r--storage/innobase/rem/rem0rec.cc18
-rw-r--r--storage/innobase/row/row0ftsort.cc3
-rw-r--r--storage/innobase/row/row0ins.cc7
-rw-r--r--storage/innobase/row/row0merge.cc2
-rw-r--r--storage/innobase/row/row0mysql.cc1
-rw-r--r--storage/innobase/row/row0purge.cc4
-rw-r--r--storage/innobase/row/row0row.cc5
-rw-r--r--storage/innobase/row/row0upd.cc5
-rw-r--r--storage/innobase/trx/trx0rec.cc5
-rw-r--r--storage/xtradb/buf/buf0buddy.cc2
-rw-r--r--storage/xtradb/data/data0data.cc3
-rw-r--r--storage/xtradb/dict/dict0dict.cc23
-rw-r--r--storage/xtradb/dict/dict0mem.cc1
-rw-r--r--storage/xtradb/handler/handler0alter.cc12
-rw-r--r--storage/xtradb/include/data0data.ic28
-rw-r--r--storage/xtradb/include/dict0dict.ic40
-rw-r--r--storage/xtradb/include/rem0rec.ic24
-rw-r--r--storage/xtradb/rem/rem0rec.cc18
-rw-r--r--storage/xtradb/row/row0ftsort.cc3
-rw-r--r--storage/xtradb/row/row0ins.cc7
-rw-r--r--storage/xtradb/row/row0merge.cc2
-rw-r--r--storage/xtradb/row/row0mysql.cc1
-rw-r--r--storage/xtradb/row/row0purge.cc4
-rw-r--r--storage/xtradb/row/row0row.cc5
-rw-r--r--storage/xtradb/row/row0upd.cc5
-rw-r--r--storage/xtradb/trx/trx0rec.cc5
34 files changed, 48 insertions, 321 deletions
diff --git a/storage/innobase/buf/buf0buddy.cc b/storage/innobase/buf/buf0buddy.cc
index c8c39e0caaf..d11a5cf9873 100644
--- a/storage/innobase/buf/buf0buddy.cc
+++ b/storage/innobase/buf/buf0buddy.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
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
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;
- ut_ad(lru);
ut_ad(buf_pool_mutex_own(buf_pool));
ut_ad(!mutex_own(&buf_pool->zip_mutex));
ut_ad(i >= buf_buddy_get_slot(UNIV_ZIP_SIZE_MIN));
diff --git a/storage/innobase/data/data0data.cc b/storage/innobase/data/data0data.cc
index 593af089b00..cda27de1736 100644
--- a/storage/innobase/data/data0data.cc
+++ b/storage/innobase/data/data0data.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
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
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 */
ulint n_fields) /*!< in: number of fields */
{
- ut_ad(tuple);
-
tuple->n_fields = n_fields;
tuple->n_fields_cmp = n_fields;
}
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc
index 69762bd02ff..06c63fd7121 100644
--- a/storage/innobase/dict/dict0dict.cc
+++ b/storage/innobase/dict/dict0dict.cc
@@ -940,7 +940,6 @@ dict_index_get_nth_field_pos(
ulint n_fields;
ulint pos;
- ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
field2 = dict_index_get_nth_field(index2, n);
@@ -1038,8 +1037,6 @@ dict_table_col_in_clustered_key(
ulint pos;
ulint n_fields;
- ut_ad(table);
-
col = dict_table_get_nth_col(table, n);
index = dict_table_get_first_index(table);
@@ -1214,7 +1211,6 @@ dict_table_add_system_columns(
dict_table_t* table, /*!< in/out: table */
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->magic_n == DICT_TABLE_MAGIC_N);
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 */
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);
/* 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_index_t* index;
- ut_ad(table);
ut_ad(dict_lru_validate());
ut_a(table->n_ref_count == 0);
ut_a(table->n_rec_locks == 0);
@@ -2496,8 +2490,7 @@ dict_index_add_to_cache(
ulint n_ord;
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->magic_n == DICT_INDEX_MAGIC_N);
ut_ad(!dict_index_is_online_ddl(index));
@@ -5281,7 +5274,6 @@ dict_foreign_parse_drop_constraints(
const char* id;
struct charset_info_st* cs;
- ut_a(trx);
ut_a(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 dtuple_t* tuple) /*!< in: tuple used in a search */
{
- ut_a(index);
- ut_a(dtuple_get_n_fields_cmp(tuple)
- <= dict_index_get_n_unique_in_tree(index));
+ ut_ad(dtuple_get_n_fields_cmp(tuple)
+ <= dict_index_get_n_unique_in_tree(index));
return(TRUE);
}
#endif /* UNIV_DEBUG */
@@ -7120,8 +7111,6 @@ dict_index_zip_success(
/*===================*/
dict_index_t* index) /*!< in/out: index to be updated. */
{
- ut_ad(index);
-
ulint zip_threshold = zip_failure_threshold_pct;
if (!zip_threshold) {
/* Disabled by user. */
@@ -7143,8 +7132,6 @@ dict_index_zip_failure(
/*===================*/
dict_index_t* index) /*!< in/out: index to be updated. */
{
- ut_ad(index);
-
ulint zip_threshold = zip_failure_threshold_pct;
if (!zip_threshold) {
/* Disabled by user. */
@@ -7172,8 +7159,6 @@ dict_index_zip_pad_optimal_page_size(
ulint min_sz;
ulint sz;
- ut_ad(index);
-
if (!zip_failure_threshold_pct) {
/* Disabled by user. */
return(UNIV_PAGE_SIZE);
diff --git a/storage/innobase/dict/dict0mem.cc b/storage/innobase/dict/dict0mem.cc
index e1714c78036..015518858bc 100644
--- a/storage/innobase/dict/dict0mem.cc
+++ b/storage/innobase/dict/dict0mem.cc
@@ -275,7 +275,6 @@ dict_mem_table_add_col(
dict_col_t* col;
ulint i;
- ut_ad(table);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
ut_ad(!heap == !name);
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index b03b70e488e..91992058889 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -1513,8 +1513,8 @@ name_ok:
index
@param[in] altered_table MySQL table that is being altered
@param[in] key_part MySQL key definition
-@param[out] index_field index field defition for key_part */
-static MY_ATTRIBUTE((nonnull(2,3)))
+@param[out] index_field index field definition for key_part */
+static MY_ATTRIBUTE((nonnull))
void
innobase_create_index_field_def(
bool new_clustered,
@@ -1529,10 +1529,6 @@ 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
if there is virtual columns we need to skip them to find the
correct field. */
@@ -1596,8 +1592,6 @@ innobase_create_index_def(
DBUG_ENTER("innobase_create_index_def");
DBUG_ASSERT(!key_clustered || new_clustered);
- ut_ad(altered_table);
-
index->fields = static_cast<index_field_t*>(
mem_heap_alloc(heap, n_fields * sizeof *index->fields));
index->ind_type = 0;
@@ -4829,7 +4823,6 @@ innobase_rename_columns_try(
ha_alter_info->alter_info->create_list);
uint i = 0;
- DBUG_ASSERT(ctx);
DBUG_ASSERT(ha_alter_info->handler_flags
& Alter_inplace_info::ALTER_COLUMN_NAME);
@@ -5013,7 +5006,6 @@ innobase_update_foreign_try(
ulint i;
DBUG_ENTER("innobase_update_foreign_try");
- DBUG_ASSERT(ctx);
foreign_id = dict_table_get_highest_foreign_id(ctx->new_table);
diff --git a/storage/innobase/include/data0data.ic b/storage/innobase/include/data0data.ic
index 11499ab928c..deac969a03d 100644
--- a/storage/innobase/include/data0data.ic
+++ b/storage/innobase/include/data0data.ic
@@ -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
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 */
{
- ut_ad(field);
-
return((dtype_t*) &(field->type));
}
#endif /* UNIV_DEBUG */
@@ -72,7 +71,6 @@ dfield_get_data(
/*============*/
const dfield_t* field) /*!< in: field */
{
- ut_ad(field);
ut_ad((field->len == UNIV_SQL_NULL)
|| (field->data != &data_error));
@@ -89,7 +87,6 @@ dfield_get_len(
/*===========*/
const dfield_t* field) /*!< in: field */
{
- ut_ad(field);
ut_ad((field->len == UNIV_SQL_NULL)
|| (field->data != &data_error));
@@ -105,7 +102,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 */
@@ -123,8 +119,6 @@ dfield_is_null(
/*===========*/
const dfield_t* field) /*!< in: field */
{
- ut_ad(field);
-
return(field->len == UNIV_SQL_NULL);
}
@@ -137,8 +131,6 @@ dfield_is_ext(
/*==========*/
const dfield_t* field) /*!< in: field */
{
- ut_ad(field);
-
return(field->ext);
}
@@ -150,8 +142,6 @@ dfield_set_ext(
/*===========*/
dfield_t* field) /*!< in/out: field */
{
- ut_ad(field);
-
field->ext = 1;
}
@@ -165,8 +155,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 */
@@ -286,8 +274,6 @@ dtuple_get_info_bits(
/*=================*/
const dtuple_t* tuple) /*!< in: tuple */
{
- ut_ad(tuple);
-
return(tuple->info_bits);
}
@@ -300,8 +286,6 @@ dtuple_set_info_bits(
dtuple_t* tuple, /*!< in: tuple */
ulint info_bits) /*!< in: info bits */
{
- ut_ad(tuple);
-
tuple->info_bits = info_bits;
}
@@ -314,8 +298,6 @@ dtuple_get_n_fields_cmp(
/*====================*/
const dtuple_t* tuple) /*!< in: tuple */
{
- ut_ad(tuple);
-
return(tuple->n_fields_cmp);
}
@@ -329,9 +311,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;
}
@@ -344,8 +324,6 @@ dtuple_get_n_fields(
/*================*/
const dtuple_t* tuple) /*!< in: tuple */
{
- ut_ad(tuple);
-
return(tuple->n_fields);
}
@@ -483,7 +461,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);
@@ -517,7 +494,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 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);
}
diff --git a/storage/innobase/include/rem0rec.ic b/storage/innobase/include/rem0rec.ic
index 89f6902059d..122ea733065 100644
--- a/storage/innobase/include/rem0rec.ic
+++ b/storage/innobase/include/rem0rec.ic
@@ -1,7 +1,7 @@
/*****************************************************************************
-Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2018, MariaDB Corporation.
+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
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 */
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);
}
@@ -397,8 +391,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;
@@ -921,7 +914,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;
@@ -1039,7 +1031,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;
@@ -1387,7 +1378,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) {
@@ -1589,8 +1579,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_univ(index)
diff --git a/storage/innobase/rem/rem0rec.cc b/storage/innobase/rem/rem0rec.cc
index af32d0519e2..0b01bddb5d7 100644
--- a/storage/innobase/rem/rem0rec.cc
+++ b/storage/innobase/rem/rem0rec.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
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
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 size;
- ut_ad(rec);
- ut_ad(index);
- ut_ad(heap);
-
if (dict_table_is_comp(index->table)) {
switch (UNIV_EXPECT(rec_get_status(rec),
REC_STATUS_ORDINARY)) {
@@ -637,9 +633,6 @@ rec_get_offsets_reverse(
ulint null_mask;
ulint n_node_ptr_field;
- ut_ad(extra);
- ut_ad(index);
- ut_ad(offsets);
ut_ad(dict_table_is_comp(index->table));
if (UNIV_UNLIKELY(node_ptr)) {
@@ -748,8 +741,6 @@ rec_get_nth_field_offs_old(
ulint os;
ulint next_os;
- ut_ad(len);
- ut_a(rec);
ut_a(n < rec_get_n_fields_old(rec));
if (rec_get_1byte_offs_flag(rec)) {
@@ -1713,7 +1704,6 @@ rec_validate(
ulint sum = 0;
ulint i;
- ut_a(rec);
n_fields = rec_offs_n_fields(offsets);
if ((n_fields == 0) || (n_fields > REC_MAX_N_FIELDS)) {
@@ -1777,8 +1767,6 @@ rec_print_old(
ulint n;
ulint i;
- ut_ad(rec);
-
n = rec_get_n_fields_old(rec);
fprintf(file, "PHYSICAL RECORD: n_fields %lu;"
@@ -1872,8 +1860,6 @@ rec_print_new(
const rec_t* rec, /*!< in: physical record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
{
- ut_ad(rec);
- ut_ad(offsets);
ut_ad(rec_offs_validate(rec, NULL, offsets));
if (!rec_offs_comp(offsets)) {
@@ -1900,8 +1886,6 @@ rec_print(
const rec_t* rec, /*!< in: physical record */
const dict_index_t* index) /*!< in: record descriptor */
{
- ut_ad(index);
-
if (!dict_table_is_comp(index->table)) {
rec_print_old(file, rec);
return;
diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc
index e3ac4e77f0f..6af93fb83fb 100644
--- a/storage/innobase/row/row0ftsort.cc
+++ b/storage/innobase/row/row0ftsort.cc
@@ -1415,9 +1415,6 @@ row_fts_merge_insert(
ulint count_diag = 0;
ulint space;
- ut_ad(index);
- ut_ad(table);
-
/* We use the insert query graph as the dummy graph
needed in the row module call */
diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc
index 65a27ebeb37..14b52f21e68 100644
--- a/storage/innobase/row/row0ins.cc
+++ b/storage/innobase/row/row0ins.cc
@@ -489,8 +489,6 @@ row_ins_cascade_calc_update_vec(
ulint doc_id_pos = 0;
doc_id_t new_doc_id = FTS_NULL_DOC_ID;
- ut_a(node);
- ut_a(foreign);
ut_a(cascade);
ut_a(table);
ut_a(index);
@@ -985,11 +983,6 @@ row_ins_foreign_check_on_constraint(
doc_id_t doc_id = FTS_NULL_DOC_ID;
ibool fts_col_affacted = FALSE;
- ut_a(thr);
- ut_a(foreign);
- ut_a(pcur);
- ut_a(mtr);
-
trx = thr_get_trx(thr);
/* Since we are going to delete or update a row, we have to invalidate
diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc
index 9fa2eaccfa8..4d836cebd6a 100644
--- a/storage/innobase/row/row0merge.cc
+++ b/storage/innobase/row/row0merge.cc
@@ -3468,7 +3468,6 @@ row_merge_rename_index_to_add(
"WHERE TABLE_ID = :tableid AND ID = :indexid;\n"
"END;\n";
- ut_ad(trx);
ut_a(trx->dict_operation_lock_mode == RW_X_LATCH);
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"
"END;\n";
- ut_ad(trx);
ut_a(trx->dict_operation_lock_mode == RW_X_LATCH);
ut_ad(trx_get_dict_operation(trx) == TRX_DICT_OP_INDEX);
diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc
index 542e2570cb1..47e0368e787 100644
--- a/storage/innobase/row/row0mysql.cc
+++ b/storage/innobase/row/row0mysql.cc
@@ -3235,7 +3235,6 @@ row_mysql_lock_table(
dberr_t err;
sel_node_t* node;
- ut_ad(trx);
ut_ad(mode == LOCK_X || mode == LOCK_S);
heap = mem_heap_create(512);
diff --git a/storage/innobase/row/row0purge.cc b/storage/innobase/row/row0purge.cc
index 98504b1e973..4cc3a71a5fa 100644
--- a/storage/innobase/row/row0purge.cc
+++ b/storage/innobase/row/row0purge.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
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
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;
- ut_ad(thr);
-
node = static_cast<purge_node_t*>(thr->run_node);
node->table = NULL;
diff --git a/storage/innobase/row/row0row.cc b/storage/innobase/row/row0row.cc
index 9bf9e7182ca..884bf52af34 100644
--- a/storage/innobase/row/row0row.cc
+++ b/storage/innobase/row/row0row.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
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
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];
rec_offs_init(offsets_);
- ut_a(ref);
- ut_a(index);
- ut_a(rec);
ut_ad(!dict_index_is_clust(index));
if (UNIV_UNLIKELY(!index->table)) {
diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc
index 33f46882651..5f304b12e70 100644
--- a/storage/innobase/row/row0upd.cc
+++ b/storage/innobase/row/row0upd.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
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
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;
ulint* offsets = NULL;
- ut_ad(node);
ut_ad(dict_index_is_clust(index));
trx = thr_get_trx(thr);
@@ -2348,7 +2347,6 @@ row_upd_clust_rec(
dberr_t err;
const dtuple_t* rebuilt_old_pk = NULL;
- ut_ad(node);
ut_ad(dict_index_is_clust(index));
pcur = node->pcur;
@@ -2513,7 +2511,6 @@ row_upd_del_mark_clust_rec(
trx_t* trx = thr_get_trx(thr) ;
#endif /* WITH_WSREP */
- ut_ad(node);
ut_ad(dict_index_is_clust(index));
ut_ad(node->is_delete);
diff --git a/storage/innobase/trx/trx0rec.cc b/storage/innobase/trx/trx0rec.cc
index cd5e51d4973..c21b5d6772c 100644
--- a/storage/innobase/trx/trx0rec.cc
+++ b/storage/innobase/trx/trx0rec.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
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
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;
ulint row_len;
- ut_ad(index);
ut_ad(ptr);
- ut_ad(row);
- ut_ad(heap);
ut_ad(dict_index_is_clust(index));
row_len = dict_table_get_n_cols(index->table);
diff --git a/storage/xtradb/buf/buf0buddy.cc b/storage/xtradb/buf/buf0buddy.cc
index ee687efc9ec..e058c69d4b3 100644
--- a/storage/xtradb/buf/buf0buddy.cc
+++ b/storage/xtradb/buf/buf0buddy.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
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
the terms of the GNU General Public License as published by the Free Software
diff --git a/storage/xtradb/data/data0data.cc b/storage/xtradb/data/data0data.cc
index 593af089b00..cda27de1736 100644
--- a/storage/xtradb/data/data0data.cc
+++ b/storage/xtradb/data/data0data.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
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
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 */
ulint n_fields) /*!< in: number of fields */
{
- ut_ad(tuple);
-
tuple->n_fields = n_fields;
tuple->n_fields_cmp = n_fields;
}
diff --git a/storage/xtradb/dict/dict0dict.cc b/storage/xtradb/dict/dict0dict.cc
index 4c5117f987e..b587aec5370 100644
--- a/storage/xtradb/dict/dict0dict.cc
+++ b/storage/xtradb/dict/dict0dict.cc
@@ -946,7 +946,6 @@ dict_index_get_nth_field_pos(
ulint n_fields;
ulint pos;
- ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
field2 = dict_index_get_nth_field(index2, n);
@@ -1044,8 +1043,6 @@ dict_table_col_in_clustered_key(
ulint pos;
ulint n_fields;
- ut_ad(table);
-
col = dict_table_get_nth_col(table, n);
index = dict_table_get_first_index(table);
@@ -1220,7 +1217,6 @@ dict_table_add_system_columns(
dict_table_t* table, /*!< in/out: table */
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->magic_n == DICT_TABLE_MAGIC_N);
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 */
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);
/* 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_index_t* index;
- ut_ad(table);
ut_ad(dict_lru_validate());
ut_a(table->n_ref_count == 0);
ut_a(table->n_rec_locks == 0);
@@ -2506,8 +2500,7 @@ dict_index_add_to_cache(
ulint n_ord;
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->magic_n == DICT_INDEX_MAGIC_N);
ut_ad(!dict_index_is_online_ddl(index));
@@ -5290,7 +5283,6 @@ dict_foreign_parse_drop_constraints(
const char* id;
struct charset_info_st* cs;
- ut_a(trx);
ut_a(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 dtuple_t* tuple) /*!< in: tuple used in a search */
{
- ut_a(index);
- ut_a(dtuple_get_n_fields_cmp(tuple)
- <= dict_index_get_n_unique_in_tree(index));
+ ut_ad(dtuple_get_n_fields_cmp(tuple)
+ <= dict_index_get_n_unique_in_tree(index));
return(TRUE);
}
#endif /* UNIV_DEBUG */
@@ -7122,8 +7113,6 @@ dict_index_zip_success(
/*===================*/
dict_index_t* index) /*!< in/out: index to be updated. */
{
- ut_ad(index);
-
ulint zip_threshold = zip_failure_threshold_pct;
if (!zip_threshold) {
/* Disabled by user. */
@@ -7145,8 +7134,6 @@ dict_index_zip_failure(
/*===================*/
dict_index_t* index) /*!< in/out: index to be updated. */
{
- ut_ad(index);
-
ulint zip_threshold = zip_failure_threshold_pct;
if (!zip_threshold) {
/* Disabled by user. */
@@ -7174,8 +7161,6 @@ dict_index_zip_pad_optimal_page_size(
ulint min_sz;
ulint sz;
- ut_ad(index);
-
if (!zip_failure_threshold_pct) {
/* Disabled by user. */
return(UNIV_PAGE_SIZE);
diff --git a/storage/xtradb/dict/dict0mem.cc b/storage/xtradb/dict/dict0mem.cc
index 4ce0981d972..7c8a09bd00a 100644
--- a/storage/xtradb/dict/dict0mem.cc
+++ b/storage/xtradb/dict/dict0mem.cc
@@ -276,7 +276,6 @@ dict_mem_table_add_col(
dict_col_t* col;
ulint i;
- ut_ad(table);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
ut_ad(!heap == !name);
diff --git a/storage/xtradb/handler/handler0alter.cc b/storage/xtradb/handler/handler0alter.cc
index b0cfb17fe28..afe1bdac2e4 100644
--- a/storage/xtradb/handler/handler0alter.cc
+++ b/storage/xtradb/handler/handler0alter.cc
@@ -1516,8 +1516,8 @@ name_ok:
index
@param[in] altered_table MySQL table that is being altered
@param[in] key_part MySQL key definition
-@param[out] index_field index field defition for key_part */
-static MY_ATTRIBUTE((nonnull(2,3)))
+@param[out] index_field index field definition for key_part */
+static MY_ATTRIBUTE((nonnull))
void
innobase_create_index_field_def(
bool new_clustered,
@@ -1532,10 +1532,6 @@ 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
if there is virtual columns we need to skip them to find the
correct field. */
@@ -1599,8 +1595,6 @@ innobase_create_index_def(
DBUG_ENTER("innobase_create_index_def");
DBUG_ASSERT(!key_clustered || new_clustered);
- ut_ad(altered_table);
-
index->fields = static_cast<index_field_t*>(
mem_heap_alloc(heap, n_fields * sizeof *index->fields));
index->ind_type = 0;
@@ -4845,7 +4839,6 @@ innobase_rename_columns_try(
ha_alter_info->alter_info->create_list);
uint i = 0;
- DBUG_ASSERT(ctx);
DBUG_ASSERT(ha_alter_info->handler_flags
& Alter_inplace_info::ALTER_COLUMN_NAME);
@@ -5029,7 +5022,6 @@ innobase_update_foreign_try(
ulint i;
DBUG_ENTER("innobase_update_foreign_try");
- DBUG_ASSERT(ctx);
foreign_id = dict_table_get_highest_foreign_id(ctx->new_table);
diff --git a/storage/xtradb/include/data0data.ic b/storage/xtradb/include/data0data.ic
index 11499ab928c..deac969a03d 100644
--- a/storage/xtradb/include/data0data.ic
+++ b/storage/xtradb/include/data0data.ic
@@ -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
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 */
{
- ut_ad(field);
-
return((dtype_t*) &(field->type));
}
#endif /* UNIV_DEBUG */
@@ -72,7 +71,6 @@ dfield_get_data(
/*============*/
const dfield_t* field) /*!< in: field */
{
- ut_ad(field);
ut_ad((field->len == UNIV_SQL_NULL)
|| (field->data != &data_error));
@@ -89,7 +87,6 @@ dfield_get_len(
/*===========*/
const dfield_t* field) /*!< in: field */
{
- ut_ad(field);
ut_ad((field->len == UNIV_SQL_NULL)
|| (field->data != &data_error));
@@ -105,7 +102,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 */
@@ -123,8 +119,6 @@ dfield_is_null(
/*===========*/
const dfield_t* field) /*!< in: field */
{
- ut_ad(field);
-
return(field->len == UNIV_SQL_NULL);
}
@@ -137,8 +131,6 @@ dfield_is_ext(
/*==========*/
const dfield_t* field) /*!< in: field */
{
- ut_ad(field);
-
return(field->ext);
}
@@ -150,8 +142,6 @@ dfield_set_ext(
/*===========*/
dfield_t* field) /*!< in/out: field */
{
- ut_ad(field);
-
field->ext = 1;
}
@@ -165,8 +155,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 */
@@ -286,8 +274,6 @@ dtuple_get_info_bits(
/*=================*/
const dtuple_t* tuple) /*!< in: tuple */
{
- ut_ad(tuple);
-
return(tuple->info_bits);
}
@@ -300,8 +286,6 @@ dtuple_set_info_bits(
dtuple_t* tuple, /*!< in: tuple */
ulint info_bits) /*!< in: info bits */
{
- ut_ad(tuple);
-
tuple->info_bits = info_bits;
}
@@ -314,8 +298,6 @@ dtuple_get_n_fields_cmp(
/*====================*/
const dtuple_t* tuple) /*!< in: tuple */
{
- ut_ad(tuple);
-
return(tuple->n_fields_cmp);
}
@@ -329,9 +311,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;
}
@@ -344,8 +324,6 @@ dtuple_get_n_fields(
/*================*/
const dtuple_t* tuple) /*!< in: tuple */
{
- ut_ad(tuple);
-
return(tuple->n_fields);
}
@@ -483,7 +461,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);
@@ -517,7 +494,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/xtradb/include/dict0dict.ic b/storage/xtradb/include/dict0dict.ic
index 17b4adc10e2..5c0cdbd7227 100644
--- a/storage/xtradb/include/dict0dict.ic
+++ b/storage/xtradb/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));
diff --git a/storage/xtradb/include/rem0rec.ic b/storage/xtradb/include/rem0rec.ic
index 89f6902059d..122ea733065 100644
--- a/storage/xtradb/include/rem0rec.ic
+++ b/storage/xtradb/include/rem0rec.ic
@@ -1,7 +1,7 @@
/*****************************************************************************
-Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2018, MariaDB Corporation.
+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
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 */
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);
}
@@ -397,8 +391,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;
@@ -921,7 +914,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;
@@ -1039,7 +1031,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;
@@ -1387,7 +1378,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) {
@@ -1589,8 +1579,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_univ(index)
diff --git a/storage/xtradb/rem/rem0rec.cc b/storage/xtradb/rem/rem0rec.cc
index 2314f110312..ff680b3cfb6 100644
--- a/storage/xtradb/rem/rem0rec.cc
+++ b/storage/xtradb/rem/rem0rec.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
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
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 size;
- ut_ad(rec);
- ut_ad(index);
- ut_ad(heap);
-
if (dict_table_is_comp(index->table)) {
switch (UNIV_EXPECT(rec_get_status(rec),
REC_STATUS_ORDINARY)) {
@@ -637,9 +633,6 @@ rec_get_offsets_reverse(
ulint null_mask;
ulint n_node_ptr_field;
- ut_ad(extra);
- ut_ad(index);
- ut_ad(offsets);
ut_ad(dict_table_is_comp(index->table));
if (UNIV_UNLIKELY(node_ptr)) {
@@ -748,8 +741,6 @@ rec_get_nth_field_offs_old(
ulint os;
ulint next_os;
- ut_ad(len);
- ut_a(rec);
ut_a(n < rec_get_n_fields_old(rec));
if (rec_get_1byte_offs_flag(rec)) {
@@ -1717,7 +1708,6 @@ rec_validate(
ulint sum = 0;
ulint i;
- ut_a(rec);
n_fields = rec_offs_n_fields(offsets);
if ((n_fields == 0) || (n_fields > REC_MAX_N_FIELDS)) {
@@ -1781,8 +1771,6 @@ rec_print_old(
ulint n;
ulint i;
- ut_ad(rec);
-
n = rec_get_n_fields_old(rec);
fprintf(file, "PHYSICAL RECORD: n_fields %lu;"
@@ -1876,8 +1864,6 @@ rec_print_new(
const rec_t* rec, /*!< in: physical record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
{
- ut_ad(rec);
- ut_ad(offsets);
ut_ad(rec_offs_validate(rec, NULL, offsets));
if (!rec_offs_comp(offsets)) {
@@ -1904,8 +1890,6 @@ rec_print(
const rec_t* rec, /*!< in: physical record */
const dict_index_t* index) /*!< in: record descriptor */
{
- ut_ad(index);
-
if (!dict_table_is_comp(index->table)) {
rec_print_old(file, rec);
return;
diff --git a/storage/xtradb/row/row0ftsort.cc b/storage/xtradb/row/row0ftsort.cc
index fb30f867f87..d3c8b9a80bd 100644
--- a/storage/xtradb/row/row0ftsort.cc
+++ b/storage/xtradb/row/row0ftsort.cc
@@ -1418,9 +1418,6 @@ row_fts_merge_insert(
ulint count_diag = 0;
ulint space;
- ut_ad(index);
- ut_ad(table);
-
/* We use the insert query graph as the dummy graph
needed in the row module call */
diff --git a/storage/xtradb/row/row0ins.cc b/storage/xtradb/row/row0ins.cc
index 476c18680f3..cb22f5030d5 100644
--- a/storage/xtradb/row/row0ins.cc
+++ b/storage/xtradb/row/row0ins.cc
@@ -495,8 +495,6 @@ row_ins_cascade_calc_update_vec(
ulint doc_id_pos = 0;
doc_id_t new_doc_id = FTS_NULL_DOC_ID;
- ut_a(node);
- ut_a(foreign);
ut_a(cascade);
ut_a(table);
ut_a(index);
@@ -991,11 +989,6 @@ row_ins_foreign_check_on_constraint(
doc_id_t doc_id = FTS_NULL_DOC_ID;
ibool fts_col_affacted = FALSE;
- ut_a(thr);
- ut_a(foreign);
- ut_a(pcur);
- ut_a(mtr);
-
trx = thr_get_trx(thr);
/* Since we are going to delete or update a row, we have to invalidate
diff --git a/storage/xtradb/row/row0merge.cc b/storage/xtradb/row/row0merge.cc
index 02d272f095a..75d7397e7ee 100644
--- a/storage/xtradb/row/row0merge.cc
+++ b/storage/xtradb/row/row0merge.cc
@@ -3471,7 +3471,6 @@ row_merge_rename_index_to_add(
"WHERE TABLE_ID = :tableid AND ID = :indexid;\n"
"END;\n";
- ut_ad(trx);
ut_a(trx->dict_operation_lock_mode == RW_X_LATCH);
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"
"END;\n";
- ut_ad(trx);
ut_a(trx->dict_operation_lock_mode == RW_X_LATCH);
ut_ad(trx_get_dict_operation(trx) == TRX_DICT_OP_INDEX);
diff --git a/storage/xtradb/row/row0mysql.cc b/storage/xtradb/row/row0mysql.cc
index 5e7ff6e910b..a21e32cb91e 100644
--- a/storage/xtradb/row/row0mysql.cc
+++ b/storage/xtradb/row/row0mysql.cc
@@ -3239,7 +3239,6 @@ row_mysql_lock_table(
dberr_t err;
sel_node_t* node;
- ut_ad(trx);
ut_ad(mode == LOCK_X || mode == LOCK_S);
heap = mem_heap_create(512);
diff --git a/storage/xtradb/row/row0purge.cc b/storage/xtradb/row/row0purge.cc
index 0cd0941987d..414eeb9db3a 100644
--- a/storage/xtradb/row/row0purge.cc
+++ b/storage/xtradb/row/row0purge.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
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
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;
- ut_ad(thr);
-
node = static_cast<purge_node_t*>(thr->run_node);
node->table = NULL;
diff --git a/storage/xtradb/row/row0row.cc b/storage/xtradb/row/row0row.cc
index 9bf9e7182ca..884bf52af34 100644
--- a/storage/xtradb/row/row0row.cc
+++ b/storage/xtradb/row/row0row.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
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
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];
rec_offs_init(offsets_);
- ut_a(ref);
- ut_a(index);
- ut_a(rec);
ut_ad(!dict_index_is_clust(index));
if (UNIV_UNLIKELY(!index->table)) {
diff --git a/storage/xtradb/row/row0upd.cc b/storage/xtradb/row/row0upd.cc
index 93ccc07c9af..3df207716c3 100644
--- a/storage/xtradb/row/row0upd.cc
+++ b/storage/xtradb/row/row0upd.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
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
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;
ulint* offsets = NULL;
- ut_ad(node);
ut_ad(dict_index_is_clust(index));
trx = thr_get_trx(thr);
@@ -2357,7 +2356,6 @@ row_upd_clust_rec(
dberr_t err;
const dtuple_t* rebuilt_old_pk = NULL;
- ut_ad(node);
ut_ad(dict_index_is_clust(index));
pcur = node->pcur;
@@ -2525,7 +2523,6 @@ row_upd_del_mark_clust_rec(
trx_t* trx = thr_get_trx(thr) ;
#endif /* WITH_WSREP */
- ut_ad(node);
ut_ad(dict_index_is_clust(index));
ut_ad(node->is_delete);
diff --git a/storage/xtradb/trx/trx0rec.cc b/storage/xtradb/trx/trx0rec.cc
index dc9b0829925..e4a8d1b2d82 100644
--- a/storage/xtradb/trx/trx0rec.cc
+++ b/storage/xtradb/trx/trx0rec.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
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
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;
ulint row_len;
- ut_ad(index);
ut_ad(ptr);
- ut_ad(row);
- ut_ad(heap);
ut_ad(dict_index_is_clust(index));
row_len = dict_table_get_n_cols(index->table);