Commit a8b6524b authored by marko's avatar marko

branches/zip: Use ut_dulint_zero and ut_dulint_is_zero whenever possible.

parent f88827d8
...@@ -238,7 +238,7 @@ dict_mem_index_create( ...@@ -238,7 +238,7 @@ dict_mem_index_create(
heap = mem_heap_create(DICT_HEAP_SIZE); heap = mem_heap_create(DICT_HEAP_SIZE);
index = mem_heap_alloc(heap, sizeof(dict_index_t)); index = mem_heap_alloc(heap, sizeof(dict_index_t));
index->id = ut_dulint_create(0, 0); index->id = ut_dulint_zero;
index->heap = heap; index->heap = heap;
index->type = type; index->type = type;
...@@ -257,7 +257,7 @@ dict_mem_index_create( ...@@ -257,7 +257,7 @@ dict_mem_index_create(
index->cached = FALSE; index->cached = FALSE;
index->to_be_dropped = FALSE; index->to_be_dropped = FALSE;
index->trx_id = ut_dulint_create(0, 0); index->trx_id = ut_dulint_zero;
memset(&index->lock, 0, sizeof index->lock); memset(&index->lock, 0, sizeof index->lock);
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
index->magic_n = DICT_INDEX_MAGIC_N; index->magic_n = DICT_INDEX_MAGIC_N;
......
...@@ -1789,8 +1789,7 @@ fsp_seg_inode_page_find_used( ...@@ -1789,8 +1789,7 @@ fsp_seg_inode_page_find_used(
inode = fsp_seg_inode_page_get_nth_inode( inode = fsp_seg_inode_page_get_nth_inode(
page, i, zip_size, mtr); page, i, zip_size, mtr);
if (ut_dulint_cmp(mach_read_from_8(inode + FSEG_ID), if (!ut_dulint_is_zero(mach_read_from_8(inode + FSEG_ID))) {
ut_dulint_zero) != 0) {
/* This is used */ /* This is used */
return(i); return(i);
...@@ -1820,8 +1819,7 @@ fsp_seg_inode_page_find_free( ...@@ -1820,8 +1819,7 @@ fsp_seg_inode_page_find_free(
inode = fsp_seg_inode_page_get_nth_inode( inode = fsp_seg_inode_page_get_nth_inode(
page, i, zip_size, mtr); page, i, zip_size, mtr);
if (ut_dulint_cmp(mach_read_from_8(inode + FSEG_ID), if (ut_dulint_is_zero(mach_read_from_8(inode + FSEG_ID))) {
ut_dulint_zero) == 0) {
/* This is unused */ /* This is unused */
return(i); return(i);
...@@ -2507,7 +2505,7 @@ fseg_alloc_free_page_low( ...@@ -2507,7 +2505,7 @@ fseg_alloc_free_page_low(
== FSEG_MAGIC_N_VALUE); == FSEG_MAGIC_N_VALUE);
seg_id = mtr_read_dulint(seg_inode + FSEG_ID, mtr); seg_id = mtr_read_dulint(seg_inode + FSEG_ID, mtr);
ut_ad(ut_dulint_cmp(seg_id, ut_dulint_zero) > 0); ut_ad(!ut_dulint_is_zero(seg_id));
reserved = fseg_n_reserved_pages_low(seg_inode, &used, mtr); reserved = fseg_n_reserved_pages_low(seg_inode, &used, mtr);
...@@ -3955,9 +3953,8 @@ fsp_validate( ...@@ -3955,9 +3953,8 @@ fsp_validate(
seg_inode = fsp_seg_inode_page_get_nth_inode( seg_inode = fsp_seg_inode_page_get_nth_inode(
seg_inode_page, n, zip_size, &mtr); seg_inode_page, n, zip_size, &mtr);
ut_a(ut_dulint_cmp( ut_a(!ut_dulint_is_zero(
mach_read_from_8(seg_inode + FSEG_ID), mach_read_from_8(seg_inode + FSEG_ID)));
ut_dulint_zero) != 0);
fseg_validate_low(seg_inode, &mtr); fseg_validate_low(seg_inode, &mtr);
descr_count += flst_get_len(seg_inode + FSEG_FREE, descr_count += flst_get_len(seg_inode + FSEG_FREE,
...@@ -4002,9 +3999,8 @@ fsp_validate( ...@@ -4002,9 +3999,8 @@ fsp_validate(
seg_inode = fsp_seg_inode_page_get_nth_inode( seg_inode = fsp_seg_inode_page_get_nth_inode(
seg_inode_page, n, zip_size, &mtr); seg_inode_page, n, zip_size, &mtr);
if (ut_dulint_cmp( if (!ut_dulint_is_zero(
mach_read_from_8(seg_inode + FSEG_ID), mach_read_from_8(seg_inode + FSEG_ID))) {
ut_dulint_zero) != 0) {
fseg_validate_low(seg_inode, &mtr); fseg_validate_low(seg_inode, &mtr);
descr_count += flst_get_len( descr_count += flst_get_len(
...@@ -4142,9 +4138,8 @@ fsp_print( ...@@ -4142,9 +4138,8 @@ fsp_print(
seg_inode = fsp_seg_inode_page_get_nth_inode( seg_inode = fsp_seg_inode_page_get_nth_inode(
seg_inode_page, n, zip_size, &mtr); seg_inode_page, n, zip_size, &mtr);
ut_a(ut_dulint_cmp( ut_a(!ut_dulint_is_zero(
mach_read_from_8(seg_inode + FSEG_ID), mach_read_from_8(seg_inode + FSEG_ID)));
ut_dulint_zero) != 0);
fseg_print_low(seg_inode, &mtr); fseg_print_low(seg_inode, &mtr);
n_segs++; n_segs++;
...@@ -4181,9 +4176,8 @@ fsp_print( ...@@ -4181,9 +4176,8 @@ fsp_print(
seg_inode = fsp_seg_inode_page_get_nth_inode( seg_inode = fsp_seg_inode_page_get_nth_inode(
seg_inode_page, n, zip_size, &mtr); seg_inode_page, n, zip_size, &mtr);
if (ut_dulint_cmp( if (!ut_dulint_is_zero(
mach_read_from_8(seg_inode + FSEG_ID), mach_read_from_8(seg_inode + FSEG_ID))) {
ut_dulint_zero) != 0) {
fseg_print_low(seg_inode, &mtr); fseg_print_low(seg_inode, &mtr);
n_segs++; n_segs++;
......
...@@ -4054,8 +4054,7 @@ lock_release_off_kernel( ...@@ -4054,8 +4054,7 @@ lock_release_off_kernel(
ut_ad(lock_get_type(lock) & LOCK_TABLE); ut_ad(lock_get_type(lock) & LOCK_TABLE);
if (lock_get_mode(lock) != LOCK_IS if (lock_get_mode(lock) != LOCK_IS
&& 0 != ut_dulint_cmp(trx->undo_no, && !ut_dulint_is_zero(trx->undo_no)) {
ut_dulint_zero)) {
/* The trx may have modified the table. We /* The trx may have modified the table. We
block the use of the MySQL query cache for block the use of the MySQL query cache for
......
...@@ -173,8 +173,7 @@ read_view_oldest_copy_or_open_new( ...@@ -173,8 +173,7 @@ read_view_oldest_copy_or_open_new(
n = old_view->n_trx_ids; n = old_view->n_trx_ids;
if (ut_dulint_cmp(old_view->creator_trx_id, if (!ut_dulint_is_zero(old_view->creator_trx_id)) {
ut_dulint_create(0,0)) != 0) {
n++; n++;
} else { } else {
needs_insert = FALSE; needs_insert = FALSE;
...@@ -251,7 +250,7 @@ read_view_open_now( ...@@ -251,7 +250,7 @@ read_view_open_now(
view->creator_trx_id = cr_trx_id; view->creator_trx_id = cr_trx_id;
view->type = VIEW_NORMAL; view->type = VIEW_NORMAL;
view->undo_no = ut_dulint_create(0, 0); view->undo_no = ut_dulint_zero;
/* No future transactions should be visible in the view */ /* No future transactions should be visible in the view */
......
...@@ -526,7 +526,7 @@ row_undo_build_dict_undo_list( ...@@ -526,7 +526,7 @@ row_undo_build_dict_undo_list(
} }
/* We will do our own deletes */ /* We will do our own deletes */
trx->table_id = ut_dulint_create(0, 0); trx->table_id = ut_dulint_zero;
if (trx->dict_undo_list == NULL) { if (trx->dict_undo_list == NULL) {
dict_undo_create_list(trx); dict_undo_create_list(trx);
......
...@@ -561,7 +561,7 @@ row_vers_build_for_semi_consistent_read( ...@@ -561,7 +561,7 @@ row_vers_build_for_semi_consistent_read(
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
byte* buf; byte* buf;
ulint err; ulint err;
dulint rec_trx_id = ut_dulint_create(0, 0); dulint rec_trx_id = ut_dulint_zero;
ut_ad(dict_index_is_clust(index)); ut_ad(dict_index_is_clust(index));
ut_ad(mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_X_FIX) ut_ad(mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_X_FIX)
......
...@@ -541,7 +541,7 @@ trx_purge_truncate_history(void) ...@@ -541,7 +541,7 @@ trx_purge_truncate_history(void)
trx_purge_arr_get_biggest(purge_sys->arr, &limit_trx_no, trx_purge_arr_get_biggest(purge_sys->arr, &limit_trx_no,
&limit_undo_no); &limit_undo_no);
if (ut_dulint_cmp(limit_trx_no, ut_dulint_zero) == 0) { if (ut_dulint_is_zero(limit_trx_no)) {
limit_trx_no = purge_sys->purge_trx_no; limit_trx_no = purge_sys->purge_trx_no;
limit_undo_no = purge_sys->purge_undo_no; limit_undo_no = purge_sys->purge_undo_no;
......
...@@ -127,7 +127,7 @@ trx_create( ...@@ -127,7 +127,7 @@ trx_create(
trx->must_flush_log_later = FALSE; trx->must_flush_log_later = FALSE;
trx->dict_operation = FALSE; trx->dict_operation = FALSE;
trx->table_id = ut_dulint_create(0, 0); trx->table_id = ut_dulint_zero;
trx->dict_undo_list = NULL; trx->dict_undo_list = NULL;
trx->dict_redo_list = NULL; trx->dict_redo_list = NULL;
trx->sync_cb = NULL; trx->sync_cb = NULL;
...@@ -1774,7 +1774,7 @@ trx_print( ...@@ -1774,7 +1774,7 @@ trx_print(
fputs(", holds adaptive hash latch", f); fputs(", holds adaptive hash latch", f);
} }
if (ut_dulint_cmp(trx->undo_no, ut_dulint_zero) != 0) { if (!ut_dulint_is_zero(trx->undo_no)) {
newline = TRUE; newline = TRUE;
fprintf(f, ", undo log entries %lu", fprintf(f, ", undo log entries %lu",
(ulong) ut_dulint_get_low(trx->undo_no)); (ulong) ut_dulint_get_low(trx->undo_no));
......
...@@ -1120,7 +1120,7 @@ trx_undo_truncate_start( ...@@ -1120,7 +1120,7 @@ trx_undo_truncate_start(
ut_ad(mutex_own(&(rseg->mutex))); ut_ad(mutex_own(&(rseg->mutex)));
if (0 == ut_dulint_cmp(limit, ut_dulint_zero)) { if (ut_dulint_is_zero(limit)) {
return; return;
} }
......
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