Merge 10.1 into 10.2

This commit is contained in:
Marko Mäkelä 2019-04-03 10:29:15 +03:00
commit dbc716675b
40 changed files with 102 additions and 334 deletions

View File

@ -85,6 +85,8 @@ SET(CPACK_RPM_SPEC_MORE_DEFINE "
%define restart_flag %{restart_flag_dir}/need-restart
%{?filter_setup:
%filter_provides_in \\\\.\\\\(test\\\\|result\\\\|h\\\\|cc\\\\|c\\\\|inc\\\\|opt\\\\|ic\\\\|cnf\\\\|rdiff\\\\|cpp\\\\)$
%filter_requires_in \\\\.\\\\(test\\\\|result\\\\|h\\\\|cc\\\\|c\\\\|inc\\\\|opt\\\\|ic\\\\|cnf\\\\|rdiff\\\\|cpp\\\\)$
%filter_from_provides /perl(\\\\(mtr\\\\|My::\\\\)/d
%filter_from_requires /\\\\(lib\\\\(ft\\\\|lzma\\\\|tokuportability\\\\)\\\\)\\\\|\\\\(perl(\\\\(.*mtr\\\\|My::\\\\|.*HandlerSocket\\\\|Mysql\\\\)\\\\)/d
%filter_setup

View File

@ -11,3 +11,30 @@ flush privileges;
drop role dwr_foo;
drop role dwr_bar;
drop role dwr_qux_dev;
use test;
create table db_copy as select * from mysql.db;
delete from mysql.db;
flush privileges;
create user u1@localhost;
create role r1;
create role r2;
grant r1 to u1@localhost;
grant select on test.* to r2;
grant select on m_.* to r2;
grant r2 to r1;
show grants for u1@localhost;
Grants for u1@localhost
GRANT r1 TO 'u1'@'localhost'
GRANT USAGE ON *.* TO 'u1'@'localhost'
show grants for r1;
Grants for r1
GRANT r2 TO 'r1'
GRANT USAGE ON *.* TO 'r1'
GRANT USAGE ON *.* TO 'r2'
GRANT SELECT ON `test`.* TO 'r2'
GRANT SELECT ON `m_`.* TO 'r2'
drop user u1@localhost;
drop role r1, r2;
insert mysql.db select * from db_copy;
flush privileges;
drop table db_copy;

View File

@ -1,3 +1,4 @@
source include/not_embedded.inc;
#
# MDEV-17898 FLUSH PRIVILEGES crashes server with segfault
#
@ -9,3 +10,27 @@ flush privileges;
drop role dwr_foo;
drop role dwr_bar;
drop role dwr_qux_dev;
use test;
#
# MDEV-18298 Crashes server with segfault during role grants
#
create table db_copy as select * from mysql.db;
delete from mysql.db;
flush privileges;
create user u1@localhost;
create role r1;
create role r2;
grant r1 to u1@localhost;
grant select on test.* to r2;
grant select on m_.* to r2;
grant r2 to r1;
show grants for u1@localhost;
show grants for r1;
drop user u1@localhost;
drop role r1, r2;
insert mysql.db select * from db_copy;
flush privileges;
drop table db_copy;

View File

@ -40,7 +40,7 @@ if(GSSAPI_LIBS AND GSSAPI_FLAVOR)
else(GSSAPI_LIBS AND GSSAPI_FLAVOR)
find_program(KRB5_CONFIG NAMES krb5-config heimdal-krb5-config PATHS
/opt/local/bin
/opt/local/bin /usr/lib/mit/bin
ONLY_CMAKE_FIND_ROOT_PATH # this is required when cross compiling with cmake 2.6 and ignored with cmake 2.4, Alex
)
mark_as_advanced(KRB5_CONFIG)

View File

@ -5947,7 +5947,7 @@ static bool merge_role_db_privileges(ACL_ROLE *grantee, const char *dbname,
ulong access= 0, update_flags= 0;
for (int *p= dbs.front(); p <= dbs.back(); p++)
{
if (first<0 || (!dbname && strcmp(acl_dbs.at(*p).db, acl_dbs.at(*p-1).db)))
if (first<0 || (!dbname && strcmp(acl_dbs.at(p[0]).db, acl_dbs.at(p[-1]).db)))
{ // new db name series
update_flags|= update_role_db(merged, first, access, grantee->user.str);
merged= -1;

View File

@ -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
@ -497,7 +497,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));

View File

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

View File

@ -949,7 +949,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);
@ -1058,8 +1057,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);
@ -1229,9 +1226,7 @@ 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 - dict_table_get_n_sys_cols(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);
@ -1999,7 +1994,6 @@ 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(table->magic_n == DICT_TABLE_MAGIC_N);
@ -2026,7 +2020,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->get_ref_count() == 0);
ut_a(table->n_rec_locks == 0);
@ -2405,7 +2398,6 @@ dict_index_add_to_cache_w_vcol(
ulint n_ord;
ulint i;
ut_ad(index);
ut_ad(mutex_own(&dict_sys->mutex));
ut_ad(index->n_def == index->n_fields);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
@ -5290,7 +5282,6 @@ dict_foreign_parse_drop_constraints(
const char* id;
CHARSET_INFO* cs;
ut_a(trx);
ut_a(trx->mysql_thd);
cs = innobase_get_charset(trx->mysql_thd);
@ -5456,9 +5447,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 */
@ -7011,8 +7001,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. */
@ -7033,8 +7021,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. */
@ -7060,8 +7046,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);

View File

@ -283,7 +283,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);

View File

@ -2097,8 +2097,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,
@ -2113,10 +2113,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);
field = new_clustered
? altered_table->field[key_part->fieldnr]
: key_part->field;
@ -2178,8 +2174,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));
@ -6905,7 +6899,6 @@ innobase_rename_columns_try(
uint i = 0;
ulint num_v = 0;
DBUG_ASSERT(ctx);
DBUG_ASSERT(ha_alter_info->handler_flags
& Alter_inplace_info::ALTER_COLUMN_NAME);
@ -7301,7 +7294,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);

View File

@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation.
Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -43,8 +43,6 @@ dfield_get_type(
/*============*/
const dfield_t* field) /*!< in: SQL data field */
{
ut_ad(field);
return((dtype_t*) &(field->type));
}
#endif /* UNIV_DEBUG */
@ -74,7 +72,6 @@ dfield_get_data(
/*============*/
const dfield_t* field) /*!< in: field */
{
ut_ad(field);
ut_ad((field->len == UNIV_SQL_NULL)
|| (field->data != &data_error));
@ -91,7 +88,6 @@ dfield_get_len(
/*===========*/
const dfield_t* field) /*!< in: field */
{
ut_ad(field);
ut_ad((field->len == UNIV_SQL_NULL)
|| (field->data != &data_error));
@ -107,7 +103,6 @@ dfield_set_len(
dfield_t* field, /*!< in: field */
ulint len) /*!< in: length or UNIV_SQL_NULL */
{
ut_ad(field);
#ifdef UNIV_VALGRIND_DEBUG
if (len != UNIV_SQL_NULL) UNIV_MEM_ASSERT_RW(field->data, len);
#endif /* UNIV_VALGRIND_DEBUG */
@ -125,8 +120,6 @@ dfield_is_null(
/*===========*/
const dfield_t* field) /*!< in: field */
{
ut_ad(field);
return(field->len == UNIV_SQL_NULL);
}
@ -139,9 +132,7 @@ dfield_is_ext(
/*==========*/
const dfield_t* field) /*!< in: field */
{
ut_ad(field);
ut_ad(!field->ext || field->len >= BTR_EXTERN_FIELD_REF_SIZE);
return(field->ext);
}
@ -153,8 +144,6 @@ dfield_set_ext(
/*===========*/
dfield_t* field) /*!< in/out: field */
{
ut_ad(field);
field->ext = 1;
}
@ -196,8 +185,6 @@ dfield_set_data(
const void* data, /*!< in: data */
ulint len) /*!< in: length or UNIV_SQL_NULL */
{
ut_ad(field);
#ifdef UNIV_VALGRIND_DEBUG
if (len != UNIV_SQL_NULL) UNIV_MEM_ASSERT_RW(data, len);
#endif /* UNIV_VALGRIND_DEBUG */
@ -215,8 +202,6 @@ dfield_write_mbr(
dfield_t* field, /*!< in: field */
const double* mbr) /*!< in: data */
{
ut_ad(field);
#ifdef UNIV_VALGRIND_DEBUG
if (len != UNIV_SQL_NULL) UNIV_MEM_ASSERT_RW(data, len);
#endif /* UNIV_VALGRIND_DEBUG */
@ -340,8 +325,6 @@ dtuple_get_info_bits(
/*=================*/
const dtuple_t* tuple) /*!< in: tuple */
{
ut_ad(tuple);
return(tuple->info_bits);
}
@ -354,8 +337,6 @@ dtuple_set_info_bits(
dtuple_t* tuple, /*!< in: tuple */
ulint info_bits) /*!< in: info bits */
{
ut_ad(tuple);
tuple->info_bits = info_bits;
}
@ -368,8 +349,6 @@ dtuple_get_n_fields_cmp(
/*====================*/
const dtuple_t* tuple) /*!< in: tuple */
{
ut_ad(tuple);
return(tuple->n_fields_cmp);
}
@ -383,9 +362,7 @@ dtuple_set_n_fields_cmp(
ulint n_fields_cmp) /*!< in: number of fields used in
comparisons in rem0cmp.* */
{
ut_ad(tuple);
ut_ad(n_fields_cmp <= tuple->n_fields);
tuple->n_fields_cmp = n_fields_cmp;
}
@ -398,8 +375,6 @@ dtuple_get_n_fields(
/*================*/
const dtuple_t* tuple) /*!< in: tuple */
{
ut_ad(tuple);
return(tuple->n_fields);
}
@ -649,7 +624,6 @@ dtuple_get_data_size(
ulint i;
ulint sum = 0;
ut_ad(tuple);
ut_ad(dtuple_check_typed(tuple));
ut_ad(tuple->magic_n == DATA_TUPLE_MAGIC_N);
@ -683,7 +657,6 @@ dtuple_get_n_ext(
ulint n_fields = tuple->n_fields;
ulint i;
ut_ad(tuple);
ut_ad(dtuple_check_typed(tuple));
ut_ad(tuple->magic_n == DATA_TUPLE_MAGIC_N);

View File

@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2013, 2018, MariaDB Corporation.
Copyright (c) 2013, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -78,9 +78,6 @@ dict_col_type_assert_equal(
const dict_col_t* col, /*!< in: column */
const dtype_t* type) /*!< in: data type */
{
ut_ad(col);
ut_ad(type);
ut_ad(col->mtype == type->mtype);
ut_ad(col->prtype == type->prtype);
//ut_ad(col->len == type->len);
@ -150,8 +147,6 @@ dict_col_get_no(
/*============*/
const dict_col_t* col) /*!< in: column */
{
ut_ad(col);
return(col->ind);
}
@ -166,8 +161,6 @@ dict_col_get_clust_pos(
{
ulint i;
ut_ad(col);
ut_ad(clust_index);
ut_ad(dict_index_is_clust(clust_index));
for (i = 0; i < clust_index->n_def; i++) {
@ -193,8 +186,6 @@ dict_col_get_index_pos(
{
ulint i;
ut_ad(col);
for (i = 0; i < index->n_def; i++) {
const dict_field_t* field = &index->fields[i];
@ -216,7 +207,6 @@ dict_table_get_first_index(
/*=======================*/
const dict_table_t* table) /*!< in: table */
{
ut_ad(table);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
return(UT_LIST_GET_FIRST(((dict_table_t*) table)->indexes));
@ -231,9 +221,7 @@ dict_table_get_last_index(
/*=======================*/
const dict_table_t* table) /*!< in: table */
{
ut_ad(table);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
return(UT_LIST_GET_LAST((const_cast<dict_table_t*>(table))
->indexes));
}
@ -247,9 +235,7 @@ dict_table_get_next_index(
/*======================*/
const dict_index_t* index) /*!< in: index */
{
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(UT_LIST_GET_NEXT(indexes, (dict_index_t*) index));
}
#endif /* UNIV_DEBUG */
@ -264,7 +250,6 @@ dict_index_is_clust(
const dict_index_t* index) /*!< in: index */
{
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(index->type & DICT_CLUSTERED);
}
@ -290,7 +275,6 @@ dict_index_is_unique(
const dict_index_t* index) /*!< in: index */
{
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(index->type & DICT_UNIQUE);
}
@ -303,9 +287,7 @@ dict_index_is_spatial(
/*==================*/
const dict_index_t* index) /*!< in: index */
{
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(index->type & DICT_SPATIAL);
}
@ -318,9 +300,7 @@ dict_index_is_ibuf(
/*===============*/
const dict_index_t* index) /*!< in: index */
{
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(index->type & DICT_IBUF);
}
@ -334,7 +314,6 @@ dict_index_is_sec_or_ibuf(
const dict_index_t* index) /*!< in: index */
{
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return((index->type & (DICT_CLUSTERED | DICT_IBUF)) != DICT_CLUSTERED);
}
@ -350,8 +329,7 @@ dict_table_get_n_user_cols(
const dict_table_t* table) /*!< in: table */
{
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
return(table->n_cols - dict_table_get_n_sys_cols(table));
return(table->n_cols - DATA_N_SYS_COLS);
}
/********************************************************************//**
@ -365,7 +343,6 @@ dict_table_get_n_cols(
const dict_table_t* table) /*!< in: table */
{
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
return(table->n_cols);
}
@ -463,7 +440,6 @@ dict_table_get_nth_col(
const dict_table_t* table, /*!< in: table */
ulint pos) /*!< in: position of column */
{
ut_ad(table);
ut_ad(pos < table->n_def);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
@ -523,10 +499,8 @@ dict_table_get_sys_col_no(
const dict_table_t* table, /*!< in: table */
ulint sys) /*!< in: DATA_ROW_ID, ... */
{
ut_ad(table);
ut_ad(sys < dict_table_get_n_sys_cols(table));
ut_ad(sys < DATA_N_SYS_COLS);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
return(table->n_cols - dict_table_get_n_sys_cols(table) + sys);
}
@ -557,8 +531,6 @@ dict_table_has_fts_index(
/* out: TRUE if table has an FTS index */
dict_table_t* table) /* in: table */
{
ut_ad(table);
return(DICT_TF2_FLAG_IS_SET(table, DICT_TF2_FTS));
}
@ -894,7 +866,6 @@ dict_table_x_lock_indexes(
{
dict_index_t* index;
ut_a(table);
ut_ad(mutex_own(&dict_sys->mutex));
/* Loop through each index of the table and lock them */
@ -936,7 +907,6 @@ dict_table_x_unlock_indexes(
{
dict_index_t* index;
ut_a(table);
ut_ad(mutex_own(&dict_sys->mutex));
for (index = dict_table_get_first_index(table);
@ -958,9 +928,7 @@ dict_index_get_n_fields(
representation of index (in
the dictionary cache) */
{
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(index->n_fields);
}
@ -977,10 +945,8 @@ dict_index_get_n_unique(
const dict_index_t* index) /*!< in: an internal representation
of index (in the dictionary cache) */
{
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
ut_ad(index->cached);
return(index->n_uniq);
}
@ -996,7 +962,6 @@ dict_index_get_n_unique_in_tree(
const dict_index_t* index) /*!< in: an internal representation
of index (in the dictionary cache) */
{
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
ut_ad(index->cached);
@ -1060,7 +1025,6 @@ dict_index_get_nth_field(
const dict_index_t* index, /*!< in: index */
ulint pos) /*!< in: position of field */
{
ut_ad(index);
ut_ad(pos < index->n_def);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
@ -1078,7 +1042,6 @@ dict_index_get_sys_col_pos(
const dict_index_t* index, /*!< in: index */
ulint type) /*!< in: DATA_ROW_ID, ... */
{
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
ut_ad(!dict_index_is_ibuf(index));
@ -1102,8 +1065,6 @@ dict_field_get_col(
/*===============*/
const dict_field_t* field) /*!< in: index field */
{
ut_ad(field);
return(field->col);
}
@ -1208,7 +1169,6 @@ dict_index_get_page(
/*================*/
const dict_index_t* index) /*!< in: index */
{
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(index->page);
@ -1223,7 +1183,6 @@ dict_index_get_lock(
/*================*/
dict_index_t* index) /*!< in: index */
{
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(&(index->lock));
@ -1449,9 +1408,7 @@ dict_table_is_corrupted(
/*====================*/
const dict_table_t* table) /*!< in: table */
{
ut_ad(table);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
return(table->corrupted);
}

View File

@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2018, MariaDB Corporation.
Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -372,15 +372,9 @@ rec_set_next_offs_old(
rec_t* rec, /*!< in: old-style physical record */
ulint next) /*!< in: offset of the next record */
{
ut_ad(rec);
ut_ad(UNIV_PAGE_SIZE > next);
#if REC_NEXT_MASK != 0xFFFFUL
# error "REC_NEXT_MASK != 0xFFFFUL"
#endif
#if REC_NEXT_SHIFT
# error "REC_NEXT_SHIFT != 0"
#endif
ut_ad(srv_page_size > next);
compile_time_assert(REC_NEXT_MASK == 0xFFFFUL);
compile_time_assert(REC_NEXT_SHIFT == 0);
mach_write_to_2(rec - REC_NEXT, next);
}
@ -396,8 +390,7 @@ rec_set_next_offs_new(
{
ulint field_value;
ut_ad(rec);
ut_ad(UNIV_PAGE_SIZE > next);
ut_ad(srv_page_size > next);
if (!next) {
field_value = 0;
@ -959,7 +952,6 @@ rec_offs_set_n_alloc(
must be allocated */
ulint n_alloc) /*!< in: number of elements */
{
ut_ad(offsets);
ut_ad(n_alloc > REC_OFFS_HEADER_SIZE);
UNIV_MEM_ALLOC(offsets, n_alloc * sizeof *offsets);
offsets[0] = n_alloc;
@ -1077,7 +1069,6 @@ rec_get_nth_field_offs(
ulint offs;
ulint length;
ut_ad(n < rec_offs_n_fields(offsets));
ut_ad(len);
if (n == 0) {
offs = 0;
@ -1425,7 +1416,6 @@ rec_set_nth_field(
byte* data2;
ulint len2;
ut_ad(rec);
ut_ad(rec_offs_validate(rec, NULL, offsets));
if (len == UNIV_SQL_NULL) {
@ -1628,8 +1618,6 @@ rec_get_converted_size(
ulint data_size;
ulint extra_size;
ut_ad(index);
ut_ad(dtuple);
ut_ad(dtuple_check_typed(dtuple));
ut_ad(dict_index_is_ibuf(index)

View File

@ -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
@ -542,10 +542,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)) {
@ -650,9 +646,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)) {
@ -760,8 +753,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)) {
@ -1715,7 +1706,6 @@ rec_validate(
ulint len_sum = 0;
ulint i;
ut_a(rec);
n_fields = rec_offs_n_fields(offsets);
if ((n_fields == 0) || (n_fields > REC_MAX_N_FIELDS)) {
@ -1766,8 +1756,6 @@ rec_print_old(
ulint n;
ulint i;
ut_ad(rec);
n = rec_get_n_fields_old(rec);
fprintf(file, "PHYSICAL RECORD: n_fields " ULINTPF ";"
@ -1935,8 +1923,6 @@ rec_print_mbr_rec(
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)) {
@ -2004,8 +1990,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));
#ifdef UNIV_DEBUG
@ -2039,8 +2023,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;

View File

@ -1577,9 +1577,6 @@ row_fts_merge_insert(
trx_t* trx;
byte sys_buf[DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN];
ut_ad(index);
ut_ad(table);
/* We use the insert query graph as the dummy graph
needed in the row module call */

View File

@ -491,8 +491,6 @@ row_ins_cascade_calc_update_vec(
doc_id_t new_doc_id = FTS_NULL_DOC_ID;
ulint prefix_col;
ut_a(node);
ut_a(foreign);
ut_a(cascade);
ut_a(table);
ut_a(index);
@ -1092,10 +1090,6 @@ row_ins_foreign_check_on_constraint(
doc_id_t doc_id = FTS_NULL_DOC_ID;
DBUG_ENTER("row_ins_foreign_check_on_constraint");
ut_a(thr);
ut_a(foreign);
ut_a(pcur);
ut_a(mtr);
trx = thr_get_trx(thr);

View File

@ -4086,7 +4086,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);
@ -4140,7 +4139,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);

View File

@ -3094,7 +3094,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);

View File

@ -1197,8 +1197,6 @@ row_purge_step(
{
purge_node_t* node;
ut_ad(thr);
node = static_cast<purge_node_t*>(thr->run_node);
node->start();

View File

@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2018, 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
@ -894,9 +894,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));
ut_a(index->table);

View File

@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2015, 2018, MariaDB Corporation.
Copyright (c) 2015, 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
@ -2681,7 +2681,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);
@ -2831,7 +2830,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));
ut_ad(!thr_get_trx(thr)->in_rollback);
ut_ad(!node->table->skip_alter_undo);
@ -2967,7 +2965,6 @@ row_upd_del_mark_clust_rec(
rec_t* rec;
trx_t* trx = thr_get_trx(thr);
ut_ad(node);
ut_ad(dict_index_is_clust(index));
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) 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
@ -1681,10 +1681,7 @@ trx_undo_rec_get_partial_row(
bool first_v_col = true;
bool is_undo_log = true;
ut_ad(index);
ut_ad(ptr);
ut_ad(row);
ut_ad(heap);
ut_ad(dict_index_is_clust(index));
*row = dtuple_create_with_vcol(

View File

@ -2,9 +2,9 @@ include_directories(..)
include_directories(../../src)
include_directories(../../src/tests)
find_library(JEMALLOC_STATIC_LIBRARY libjemalloc.a)
if (BUILD_TESTING)
find_library(JEMALLOC_STATIC_LIBRARY libjemalloc.a)
## reference implementation with simple size-doubling buffer without
## jemalloc size tricks
add_library(doubling_buffer_ftcxx STATIC

View File

@ -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

View File

@ -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;
}

View File

@ -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);

View File

@ -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);

View File

@ -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);

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
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);

View File

@ -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));

View File

@ -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)

View File

@ -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;

View File

@ -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 */

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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)) {

View File

@ -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);

View File

@ -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);