Commit c10dd844 authored by vasil's avatar vasil

Split ut_a(a && b [&& c...]); into separate ut_a(a); ut_a(b); [ut_a(c); ...].

This makes it possible to see which expression was false by looking at the
error message.

Approved by:	Marko
parent 6f3ea31c
......@@ -190,7 +190,8 @@ dtype_validate(
dtype_t* type) /* in: type struct to validate */
{
ut_a(type);
ut_a((type->mtype >= DATA_VARCHAR) && (type->mtype <= DATA_MYSQL));
ut_a(type->mtype >= DATA_VARCHAR);
ut_a(type->mtype <= DATA_MYSQL);
if (type->mtype == DATA_SYS) {
ut_a((type->prtype & DATA_MYSQL_TYPE_MASK) < DATA_N_SYS_COLS);
......
......@@ -3363,7 +3363,8 @@ dict_create_foreign_constraints(
ulint err;
mem_heap_t* heap;
ut_a(trx && trx->mysql_thd);
ut_a(trx);
ut_a(trx->mysql_thd);
str = dict_strip_comments(sql_string);
heap = mem_heap_create(10000);
......@@ -3405,7 +3406,8 @@ dict_foreign_parse_drop_constraints(
FILE* ef = dict_foreign_err_file;
struct charset_info_st* cs;
ut_a(trx && trx->mysql_thd);
ut_a(trx);
ut_a(trx->mysql_thd);
cs = innobase_get_charset(trx->mysql_thd);
......
......@@ -3649,7 +3649,11 @@ fsp_validate(
n_full_frag_pages = FSP_EXTENT_SIZE
* flst_get_len(header + FSP_FULL_FRAG, &mtr);
ut_a(free_limit <= size || (space != 0 && size < FSP_EXTENT_SIZE));
if (UNIV_UNLIKELY(free_limit > size)) {
ut_a(space != 0);
ut_a(size < FSP_EXTENT_SIZE);
}
flst_validate(header + FSP_FREE, &mtr);
flst_validate(header + FSP_FREE_FRAG, &mtr);
......
......@@ -5702,7 +5702,8 @@ ha_innobase::info(
}
if (flag & HA_STATUS_ERRKEY) {
ut_a(prebuilt->trx && prebuilt->trx->magic_n == TRX_MAGIC_N);
ut_a(prebuilt->trx);
ut_a(prebuilt->trx->magic_n == TRX_MAGIC_N);
errkey = (unsigned int) row_get_mysql_key_number_for_index(
(dict_index_t*) trx_get_error_info(prebuilt->trx));
......@@ -5787,7 +5788,8 @@ ha_innobase::check(
ulint ret;
DBUG_ASSERT(thd == ha_thd());
ut_a(prebuilt->trx && prebuilt->trx->magic_n == TRX_MAGIC_N);
ut_a(prebuilt->trx);
ut_a(prebuilt->trx->magic_n == TRX_MAGIC_N);
ut_a(prebuilt->trx == thd_to_trx(thd));
if (prebuilt->mysql_template == NULL) {
......
......@@ -3174,7 +3174,8 @@ lock_deadlock_occurs(
ulint ret;
ulint cost = 0;
ut_ad(trx && lock);
ut_ad(trx);
ut_ad(lock);
ut_ad(mutex_own(&kernel_mutex));
retry:
/* We check that adding this trx to the waits-for graph
......@@ -3246,7 +3247,9 @@ lock_deadlock_recursive(
trx_t* lock_trx;
ulint ret;
ut_a(trx && start && wait_lock);
ut_a(trx);
ut_a(start);
ut_a(wait_lock);
ut_ad(mutex_own(&kernel_mutex));
if (trx->deadlock_mark == 1) {
......
......@@ -433,7 +433,11 @@ row_ins_cascade_calc_update_vec(
ulint i;
ulint j;
ut_a(node && foreign && cascade && table && index);
ut_a(node);
ut_a(foreign);
ut_a(cascade);
ut_a(table);
ut_a(index);
/* Calculate the appropriate update vector which will set the fields
in the child index record to the same value (possibly padded with
......@@ -776,7 +780,10 @@ row_ins_foreign_check_on_constraint(
trx_t* trx;
mem_heap_t* tmp_heap = NULL;
ut_a(thr && foreign && pcur && mtr);
ut_a(thr);
ut_a(foreign);
ut_a(pcur);
ut_a(mtr);
trx = thr_get_trx(thr);
......@@ -1293,7 +1300,8 @@ run_again:
goto exit_func;
}
ut_a(check_table && check_index);
ut_a(check_table);
ut_a(check_index);
if (check_table != table) {
/* We already have a LOCK_IX on table, but not necessarily
......
......@@ -478,7 +478,9 @@ row_build_row_ref_in_tuple(
ulint* offsets = offsets_;
*offsets_ = (sizeof offsets_) / sizeof *offsets_;
ut_a(ref && index && rec);
ut_a(ref);
ut_a(index);
ut_a(rec);
if (UNIV_UNLIKELY(!index->table)) {
fputs("InnoDB: table ", stderr);
......
......@@ -670,7 +670,9 @@ sync_array_detect_deadlock(
ibool ret;
rw_lock_debug_t*debug;
ut_a(arr && start && cell);
ut_a(arr);
ut_a(start);
ut_a(cell);
ut_ad(cell->wait_object);
ut_ad(os_thread_get_curr_id() == start->thread);
ut_ad(depth < 100);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment