Commit 9ed26f72 authored by marko@hundin.mysql.fi's avatar marko@hundin.mysql.fi

InnoDB: Replace ut_a(0) with ut_error

parent 9eede1c6
......@@ -402,7 +402,7 @@ btr_get_size(
n += fseg_n_reserved_pages(seg_header, &dummy, &mtr);
} else {
ut_a(0);
ut_error;
}
mtr_commit(&mtr);
......
......@@ -253,7 +253,7 @@ buf_flush_buffered_writes(void)
"InnoDB: files.\n",
block->offset, block->space);
ut_a(0);
ut_error;
}
}
......
......@@ -235,7 +235,7 @@ buf_LRU_get_free_block(void)
"InnoDB: on Linux!\n",
(ulong)(buf_pool->curr_size / (1024 * 1024 / UNIV_PAGE_SIZE)));
ut_a(0);
ut_error;
} else if (!recv_recovery_on && UT_LIST_GET_LEN(buf_pool->free)
+ UT_LIST_GET_LEN(buf_pool->LRU) < buf_pool->max_size / 5) {
......
......@@ -261,7 +261,7 @@ dfield_check_typed(
"InnoDB: Error: data field type %lu, len %lu\n",
dfield_get_type(field)->mtype, dfield_get_len(field));
ut_a(0);
ut_error;
}
return(TRUE);
......
......@@ -158,7 +158,7 @@ dict_create_sys_tables_tuple(
if (table->type == DICT_TABLE_CLUSTER_MEMBER) {
dfield_set_data(dfield, table->cluster_name,
ut_strlen(table->cluster_name));
ut_a(0); /* Oracle-style clusters are not supported yet */
ut_error; /* Oracle-style clusters are not supported yet */
} else {
dfield_set_data(dfield, NULL, UNIV_SQL_NULL);
}
......
......@@ -208,7 +208,7 @@ dict_tables_have_same_db(
}
}
ut_a(0);
ut_error;
return(FALSE);
}
......@@ -231,7 +231,7 @@ dict_remove_db_name(
}
}
ut_a(0);
ut_error;
return(NULL);
}
......@@ -254,7 +254,7 @@ dict_get_db_name_len(
}
}
ut_a(0);
ut_error;
return(0);
}
......@@ -1172,7 +1172,7 @@ dict_table_LRU_trim(void)
dict_table_t* table;
dict_table_t* prev_table;
ut_a(0);
ut_error;
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
......
......@@ -673,7 +673,7 @@ dict_load_table(
table->type = mach_read_from_4(field);
if (table->type == DICT_TABLE_CLUSTER_MEMBER) {
ut_a(0);
ut_error;
field = rec_get_nth_field(rec, 6, &len);
table->mix_id = mach_read_from_8(field);
......
......@@ -902,7 +902,7 @@ fil_node_prepare_for_io(
"InnoDB: Pending i/o's on %lu files exist\n",
system->n_open_pending);
ut_a(0);
ut_error;
}
fil_node_close(last_node, system);
......@@ -1209,7 +1209,7 @@ fil_io(
"InnoDB: Byte offset %lu, len %lu, i/o type %lu\n",
block_offset, space_id, byte_offset, len, type);
ut_a(0);
ut_error;
}
if (node->size > block_offset) {
......@@ -1339,7 +1339,7 @@ fil_aio_wait(
ret = os_aio_posix_handle(segment, &fil_node, &message);
#else
ret = 0; /* Eliminate compiler warning */
ut_a(0);
ut_error;
#endif
} else {
srv_io_thread_op_info[segment] =(char *)"simulated aio handle";
......
......@@ -1275,7 +1275,7 @@ fsp_alloc_free_page(
ut_print_buf(((byte*)descr) - 500, 1000);
ut_a(0);
ut_error;
}
xdes_set_bit(descr, XDES_FREE_BIT, free, FALSE, mtr);
......@@ -1359,7 +1359,7 @@ fsp_free_page(
return;
}
ut_a(0);
ut_error;
}
if (xdes_get_bit(descr, XDES_FREE_BIT, page % FSP_EXTENT_SIZE, mtr)
......@@ -1429,7 +1429,7 @@ fsp_free_extent(
ut_print_buf(((byte*)descr) - 500, 1000);
ut_a(0);
ut_error;
}
xdes_init(descr, mtr);
......@@ -2708,7 +2708,7 @@ fseg_free_page_low(
fprintf(stderr,
"InnoDB: If the InnoDB recovery crashes here, see section 6.1\n"
"InnoDB: of http://www.innodb.com/ibman.html about forcing recovery.\n");
ut_a(0);
ut_error;
}
state = xdes_get_state(descr, mtr);
......@@ -2798,7 +2798,7 @@ fseg_free_page_low(
fprintf(stderr,
"InnoDB: If the InnoDB recovery crashes here, see section 6.1\n"
"InnoDB: of http://www.innodb.com/ibman.html about forcing recovery.\n");
ut_a(0);
ut_error;
}
not_full_n_used = mtr_read_ulint(seg_inode + FSEG_NOT_FULL_N_USED,
......
......@@ -2651,7 +2651,7 @@ ibuf_merge_or_delete_for_page(
fprintf(stderr,
"InnoDB: Fatal error: you are downgrading from >= 4.1.1 to 4.0, but\n"
"InnoDB: the insert buffer was not empty.\n");
ut_a(0);
ut_error;
}
if (corruption_noticed) {
......
......@@ -220,7 +220,7 @@ buf_block_align(
"InnoDB: Error: trying to access a stray pointer %lx\n"
"InnoDB: buf pool start is at %lx, number of pages %lu\n", (ulint)ptr,
(ulint)frame_zero, buf_pool->max_size);
ut_a(0);
ut_error;
}
return(block);
......@@ -254,7 +254,7 @@ buf_block_align_low(
"InnoDB: Error: trying to access a stray pointer %lx\n"
"InnoDB: buf pool start is at %lx, number of pages %lu\n", (ulint)ptr,
(ulint)frame_zero, buf_pool->max_size);
ut_a(0);
ut_error;
}
return(block);
......@@ -283,7 +283,7 @@ buf_frame_align(
"InnoDB: Error: trying to access a stray pointer %lx\n"
"InnoDB: buf pool start is at %lx, number of pages %lu\n", (ulint)ptr,
(ulint)(buf_pool->frame_zero), buf_pool->max_size);
ut_a(0);
ut_error;
}
return(frame);
......
......@@ -216,7 +216,7 @@ dtype_get_fixed_size(
case DATA_VARMYSQL:
case DATA_BLOB:
return(0);
default: ut_a(0);
default: ut_error;
}
return(0);
......
......@@ -167,7 +167,7 @@ mlog_write_initial_log_record_fast(
fprintf(stderr,
"InnoDB: error: buffer page pointer %lx has nonsensical space id %lu\n"
"InnoDB: or page no %lu\n", (ulint)ptr, space, offset);
ut_a(0);
ut_error;
}
mach_write_to_1(log_ptr, type);
......
......@@ -68,7 +68,7 @@ trx_rsegf_get_nth_undo(
if (n >= TRX_RSEG_N_SLOTS) {
fprintf(stderr,
"InnoDB: Error: trying to get slot %lu of rseg\n", n);
ut_a(0);
ut_error;
}
return(mtr_read_ulint(rsegf + TRX_RSEG_UNDO_SLOTS +
......@@ -89,7 +89,7 @@ trx_rsegf_set_nth_undo(
if (n >= TRX_RSEG_N_SLOTS) {
fprintf(stderr,
"InnoDB: Error: trying to set slot %lu of rseg\n", n);
ut_a(0);
ut_error;
}
mlog_write_ulint(rsegf + TRX_RSEG_UNDO_SLOTS + n * TRX_RSEG_SLOT_SIZE,
......
......@@ -1611,7 +1611,7 @@ lock_rec_enqueue_waiting(
if (que_thr_stop(thr)) {
ut_a(0);
ut_error;
return(DB_QUE_THR_SUSPENDED);
}
......@@ -3272,7 +3272,7 @@ lock_table_enqueue_waiting(
stopped anyway */
if (que_thr_stop(thr)) {
ut_a(0);
ut_error;
return(DB_QUE_THR_SUSPENDED);
}
......
......@@ -1026,7 +1026,7 @@ log_io_complete(
return;
}
ut_a(0); /* We currently use synchronous writing of the
ut_error; /* We currently use synchronous writing of the
logs and cannot end up here! */
if (srv_unix_file_flush_method != SRV_UNIX_O_DSYNC
......
......@@ -160,7 +160,7 @@ recv_sys_empty_hash(void)
"InnoDB: Error: %lu pages with log records were left unprocessed!\n"
"InnoDB: Maximum page number with log records on it %lu\n",
recv_sys->n_addrs, recv_max_parsed_page_no);
ut_a(0);
ut_error;
}
hash_table_free(recv_sys->addr_hash);
......
......@@ -297,7 +297,7 @@ mem_pool_fill_free_list(
if (UT_LIST_GET_LEN(pool->free_list[i + 1]) == 0) {
mem_analyze_corruption((byte*)area);
ut_a(0);
ut_error;
}
UT_LIST_REMOVE(free_list, pool->free_list[i + 1], area);
......@@ -375,7 +375,7 @@ mem_area_alloc(
"InnoDB: Probably a race condition because now the area is marked free!\n");
}
ut_a(0);
ut_error;
}
if (UT_LIST_GET_LEN(pool->free_list[n]) == 0) {
......@@ -385,7 +385,7 @@ mem_area_alloc(
n);
mem_analyze_corruption((byte*)area);
ut_a(0);
ut_error;
}
ut_ad(mem_area_get_size(area) == ut_2_exp(n));
......@@ -481,7 +481,7 @@ mem_area_free(
"InnoDB: element is marked free!\n");
mem_analyze_corruption((byte*)area);
ut_a(0);
ut_error;
}
size = mem_area_get_size(area);
......@@ -492,7 +492,7 @@ mem_area_free(
"InnoDB: previous allocated area!\n");
mem_analyze_corruption((byte*)area);
ut_a(0);
ut_error;
}
#ifdef UNIV_LIGHT_MEM_DEBUG
......@@ -509,7 +509,7 @@ mem_area_free(
size, next_size);
mem_analyze_corruption((byte*)area);
ut_a(0);
ut_error;
}
}
#endif
......
......@@ -59,7 +59,7 @@ mlog_write_initial_log_record(
fprintf(stderr,
"InnoDB: Error: trying to write to a stray memory location %lx\n",
(ulint)ptr);
ut_a(0);
ut_error;
}
log_ptr = mlog_open(mtr, 20);
......@@ -222,7 +222,7 @@ mlog_write_ulint(
fprintf(stderr,
"InnoDB: Error: trying to write to a stray memory location %lx\n",
(ulint)ptr);
ut_a(0);
ut_error;
}
if (type == MLOG_1BYTE) {
......@@ -269,7 +269,7 @@ mlog_write_dulint(
fprintf(stderr,
"InnoDB: Error: trying to write to a stray memory location %lx\n",
(ulint)ptr);
ut_a(0);
ut_error;
}
ut_ad(ptr && mtr);
......@@ -313,7 +313,7 @@ mlog_write_string(
fprintf(stderr,
"InnoDB: Error: trying to write to a stray memory location %lx\n",
(ulint)ptr);
ut_a(0);
ut_error;
}
ut_ad(ptr && mtr);
ut_a(len < UNIV_PAGE_SIZE);
......
......@@ -722,7 +722,7 @@ os_file_create(
} else if (type == OS_DATA_FILE) {
type_str = "DATA";
} else {
ut_a(0);
ut_error;
}
if (purpose == OS_FILE_AIO) {
......@@ -730,7 +730,7 @@ os_file_create(
} else if (purpose == OS_FILE_NORMAL) {
purpose_str = "NORMAL";
} else {
ut_a(0);
ut_error;
}
/* printf("Opening file %s, mode %s, type %s, purpose %s\n",
......@@ -1016,7 +1016,7 @@ os_file_flush(
/* It is a fatal error if a file flush does not succeed, because then
the database can get corrupt on disk */
ut_a(0);
ut_error;
return(FALSE);
#else
......@@ -1050,7 +1050,7 @@ os_file_flush(
/* It is a fatal error if a file flush does not succeed, because then
the database can get corrupt on disk */
ut_a(0);
ut_error;
return(FALSE);
#endif
......@@ -1801,7 +1801,7 @@ os_aio_get_array_no(
return(3);
} else {
ut_a(0);
ut_error;
return(0);
}
......@@ -1828,7 +1828,7 @@ os_aio_get_array_from_no(
return(os_aio_write_array);
} else {
ut_a(0);
ut_error;
return(NULL);
}
......@@ -2418,7 +2418,7 @@ os_aio_posix_handle(
if (sig != SIGRTMIN + 1 + array_no) {
ut_a(0);
ut_error;
return(FALSE);
}
......@@ -2682,7 +2682,7 @@ os_aio_simulated_handle(
"InnoDB: Error: trying a displaced write to %s %lu %lu, len %lu\n",
slot->name, slot->offset_high,
slot->offset, total_len);
ut_a(0);
ut_error;
}
/* Do a 'last millisecond' check that the page end
......
......@@ -713,7 +713,7 @@ page_cur_parse_insert_rec(
buf_page_print(page);
ut_a(0);
ut_error;
}
ut_memcpy(buf, rec_get_start(cursor_rec), mismatch_index);
......
......@@ -110,7 +110,7 @@ page_dir_find_owner_slot(
buf_page_print(page);
ut_a(0);
ut_error;
}
i--;
......@@ -441,7 +441,7 @@ page_copy_rec_list_end_no_locks(
(ulint)(rec - page),
(ulint)(page_cur_get_rec(&cur1) - page),
(ulint)(page_cur_get_rec(&cur2) - new_page));
ut_a(0);
ut_error;
}
page_cur_move_to_next(&cur1);
......
......@@ -627,7 +627,7 @@ Linux.
#define malloc(A) mem_alloc(A)
#define free(A) mem_free(A)
#define realloc(P, A) mem_realloc(P, A, __FILE__, __LINE__)
#define exit(A) ut_a(0)
#define exit(A) ut_error
#define YY_INPUT(buf, result, max_size) pars_get_lex_chars(buf, &result, max_size)
#define comment 1
......
......@@ -485,7 +485,7 @@ que_graph_free_recursive(
"que_thr struct appears corrupt; magic n %lu\n",
thr->magic_n);
mem_analyze_corruption((byte*)thr);
ut_a(0);
ut_error;
}
thr->magic_n = QUE_THR_MAGIC_FREED;
......@@ -597,7 +597,7 @@ que_graph_free_recursive(
"que_node struct appears corrupt; type %lu\n",
que_node_get_type(node));
mem_analyze_corruption((byte*)node);
ut_a(0);
ut_error;
}
}
......@@ -987,7 +987,7 @@ que_thr_move_to_run_state_for_mysql(
mem_analyze_corruption((byte*)thr);
ut_a(0);
ut_error;
}
if (!thr->is_active) {
......@@ -1023,7 +1023,7 @@ que_thr_stop_for_mysql_no_error(
mem_analyze_corruption((byte*)thr);
ut_a(0);
ut_error;
}
thr->state = QUE_THR_COMPLETED;
......
......@@ -273,7 +273,7 @@ cmp_whole_field(
default:
fprintf(stderr,
"InnoDB: unknown type number %lu\n", data_type);
ut_a(0);
ut_error;
}
return(0);
......
......@@ -108,12 +108,12 @@ rec_get_nth_field(
if (n > 1024) {
fprintf(stderr, "Error: trying to access field %lu in rec\n",
n);
ut_a(0);
ut_error;
}
if (rec == NULL) {
fprintf(stderr, "Error: rec is NULL pointer\n");
ut_a(0);
ut_error;
}
if (rec_get_1byte_offs_flag(rec)) {
......
......@@ -856,7 +856,7 @@ row_ins_foreign_check_on_constraint(
"InnoDB: Make a detailed bug report and send it\n");
fprintf(stderr, "InnoDB: to mysql@lists.mysql.com\n");
ut_a(0);
ut_error;
*/
err = DB_SUCCESS;
......
......@@ -270,7 +270,7 @@ row_mysql_handle_errors(
} else {
fprintf(stderr, "InnoDB: unknown error code %lu\n", err);
ut_a(0);
ut_error;
}
if (trx->error_state != DB_SUCCESS) {
......@@ -383,7 +383,7 @@ row_prebuilt_free(
mem_analyze_corruption((byte*)prebuilt);
ut_a(0);
ut_error;
}
prebuilt->magic_n = ROW_PREBUILT_FREED;
......@@ -431,7 +431,7 @@ row_prebuilt_free(
mem_analyze_corruption(
prebuilt->fetch_cache[i]);
ut_a(0);
ut_error;
}
mem_free((prebuilt->fetch_cache[i]) - 4);
......@@ -463,7 +463,7 @@ row_update_prebuilt_trx(
mem_analyze_corruption((byte*)trx);
ut_a(0);
ut_error;
}
if (prebuilt->magic_n != ROW_PREBUILT_ALLOCATED) {
......@@ -474,7 +474,7 @@ row_update_prebuilt_trx(
mem_analyze_corruption((byte*)prebuilt);
ut_a(0);
ut_error;
}
prebuilt->trx = trx;
......@@ -701,7 +701,7 @@ row_insert_for_mysql(
mem_analyze_corruption((byte*)prebuilt);
ut_a(0);
ut_error;
}
if (srv_created_new_raw || srv_force_recovery) {
......@@ -917,7 +917,7 @@ row_update_for_mysql(
mem_analyze_corruption((byte*)prebuilt);
ut_a(0);
ut_error;
}
if (srv_created_new_raw || srv_force_recovery) {
......@@ -2091,7 +2091,7 @@ row_drop_table_for_mysql(
row_mysql_handle_errors(&err, trx, thr, NULL);
ut_a(0);
ut_error;
} else {
dict_table_remove_from_cache(table);
......
......@@ -140,7 +140,7 @@ row_purge_remove_clust_if_poss_low(
} else if (err == DB_OUT_OF_FILE_SPACE) {
success = FALSE;
} else {
ut_a(0);
ut_error;
}
}
......@@ -266,7 +266,7 @@ row_purge_remove_sec_if_poss_low(
} else if (err == DB_OUT_OF_FILE_SPACE) {
success = FALSE;
} else {
ut_a(0);
ut_error;
}
}
}
......
......@@ -406,7 +406,7 @@ row_build_row_ref_in_tuple(
if (!table) {
fprintf(stderr, "InnoDB: table %s for index %s not found\n",
index->table_name, index->name);
ut_a(0);
ut_error;
}
clust_index = dict_table_get_first_index(table);
......@@ -415,7 +415,7 @@ row_build_row_ref_in_tuple(
fprintf(stderr,
"InnoDB: clust index for table %s for index %s not found\n",
index->table_name, index->name);
ut_a(0);
ut_error;
}
ref_len = dict_index_get_n_unique(clust_index);
......
......@@ -2072,7 +2072,7 @@ row_sel_store_row_id_to_prebuilt(
len, index->table_name, index->name,
dict_index_get_sys_col_pos(index, DATA_ROW_ID),
err_buf);
ut_a(0);
ut_error;
}
ut_memcpy(prebuilt->row_id, data, len);
......@@ -2716,7 +2716,7 @@ row_search_for_mysql(
mem_analyze_corruption((byte*)prebuilt);
ut_a(0);
ut_error;
}
/* printf("Match mode %lu\n search tuple ", match_mode);
......@@ -2765,7 +2765,7 @@ row_search_for_mysql(
if (direction != prebuilt->fetch_direction) {
if (prebuilt->n_fetch_cached > 0) {
ut_a(0);
ut_error;
/* TODO: scrollable cursor: restore cursor to
the place of the latest returned row,
or better: prevent caching for a scroll
......
......@@ -333,7 +333,7 @@ row_undo_step(
exit(1);
}
ut_a(0);
ut_error;
return(NULL);
}
......
......@@ -1184,7 +1184,7 @@ srv_table_reserve_slot_for_mysql(void)
(ulint)difftime(ut_time(), slot->suspend_time));
}
ut_a(0);
ut_error;
}
slot = srv_mysql_table + i;
......
......@@ -940,7 +940,7 @@ sync_array_print_long_waits(void)
"InnoDB: We intentionally crash the server, because it appears to be hung.\n"
);
ut_a(0);
ut_error;
}
}
......
......@@ -278,7 +278,7 @@ trx_purge_add_update_undo_to_history(
if (undo->id >= TRX_RSEG_N_SLOTS) {
fprintf(stderr,
"InnoDB: Error: undo->id is %lu\n", undo->id);
ut_a(0);
ut_error;
}
trx_rsegf_set_nth_undo(rseg_header, undo->id, FIL_NULL, mtr);
......@@ -1016,7 +1016,7 @@ trx_purge(void)
/* Should not happen */
ut_a(0);
ut_error;
return(0);
}
......
......@@ -816,7 +816,7 @@ trx_commit_off_kernel(
log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, FALSE);
} else {
ut_a(0);
ut_error;
}
trx->commit_lsn = lsn;
......@@ -1141,7 +1141,7 @@ trx_sig_send(
/* The signal is not compatible with the other signals in
the queue: do nothing */
ut_a(0);
ut_error;
return(FALSE);
}
......@@ -1189,7 +1189,7 @@ trx_sig_send(
signal to the end of the queue, if the session is not yet
in the error state: */
ut_a(0);
ut_error;
}
/* If there were no other signals ahead in the queue, try to start
......@@ -1534,7 +1534,7 @@ trx_commit_complete_for_mysql(
log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, FALSE);
} else {
ut_a(0);
ut_error;
}
trx->op_info = (char*)"";
......
......@@ -1128,7 +1128,7 @@ trx_undo_mem_create_at_db_start(
if (id >= TRX_RSEG_N_SLOTS) {
fprintf(stderr,
"InnoDB: Error: undo->id is %lu\n", id);
ut_a(0);
ut_error;
}
undo_page = trx_undo_page_get(rseg->space, page_no, mtr);
......@@ -1286,7 +1286,7 @@ trx_undo_mem_create(
if (id >= TRX_RSEG_N_SLOTS) {
fprintf(stderr,
"InnoDB: Error: undo->id is %lu\n", id);
ut_a(0);
ut_error;
}
undo = mem_alloc(sizeof(trx_undo_t));
......@@ -1333,7 +1333,7 @@ trx_undo_mem_init_for_reuse(
fprintf(stderr, "InnoDB: Error: undo->id is %lu\n", undo->id);
mem_analyze_corruption((byte*)undo);
ut_a(0);
ut_error;
}
undo->state = TRX_UNDO_ACTIVE;
......@@ -1357,7 +1357,7 @@ trx_undo_mem_free(
if (undo->id >= TRX_RSEG_N_SLOTS) {
fprintf(stderr,
"InnoDB: Error: undo->id is %lu\n", undo->id);
ut_a(0);
ut_error;
}
mem_free(undo);
......@@ -1468,7 +1468,7 @@ trx_undo_reuse_cached(
if (undo->id >= TRX_RSEG_N_SLOTS) {
fprintf(stderr, "InnoDB: Error: undo->id is %lu\n", undo->id);
mem_analyze_corruption((byte*)undo);
ut_a(0);
ut_error;
}
undo_page = trx_undo_page_get(undo->space, undo->hdr_page_no, mtr);
......@@ -1604,7 +1604,7 @@ trx_undo_set_state_at_finish(
if (undo->id >= TRX_RSEG_N_SLOTS) {
fprintf(stderr, "InnoDB: Error: undo->id is %lu\n", undo->id);
mem_analyze_corruption((byte*)undo);
ut_a(0);
ut_error;
}
undo_page = trx_undo_page_get(undo->space, undo->hdr_page_no, mtr);
......
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