From 1924594b80b227489495378182b60a6bde53fdc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 27 Mar 2018 22:57:04 +0300 Subject: [PATCH] Minor (mainly non-functional) cleanup --- storage/innobase/handler/ha_innodb.cc | 17 ++++------------- storage/innobase/lock/lock0lock.cc | 23 ++++++++--------------- storage/innobase/trx/trx0rseg.cc | 2 +- 3 files changed, 13 insertions(+), 29 deletions(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index b8f626e32ce..7c13227170d 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -8033,29 +8033,20 @@ ha_innobase::write_row( DBUG_ENTER("ha_innobase::write_row"); trx_t* trx = thd_to_trx(m_user_thd); - ins_mode_t vers_set_fields; /* Validation checks before we commence write_row operation. */ if (high_level_read_only) { ib_senderrf(ha_thd(), IB_LOG_LEVEL_WARN, ER_READ_ONLY_MODE); DBUG_RETURN(HA_ERR_TABLE_READONLY); - } else if (m_prebuilt->trx != trx) { + } - ib::error() << "The transaction object for the table handle is" - " at " << static_cast(m_prebuilt->trx) - << ", but for the current thread it is at " - << static_cast(trx); + ut_a(m_prebuilt->trx == trx); - fputs("InnoDB: Dump of 200 bytes around m_prebuilt: ", stderr); - ut_print_buf(stderr, ((const byte*) m_prebuilt) - 100, 200); - fputs("\nInnoDB: Dump of 200 bytes around ha_data: ", stderr); - ut_print_buf(stderr, ((const byte*) trx) - 100, 200); - putc('\n', stderr); - ut_error; - } else if (!trx_is_started(trx)) { + if (!trx_is_started(trx)) { ++trx->will_lock; } + ins_mode_t vers_set_fields; /* Handling of Auto-Increment Columns. */ if (table->next_number_field && record == table->record[0]) { diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index 25755354385..3633bc0b336 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -1720,7 +1720,7 @@ lock_rec_enqueue_waiting( trx_t* trx = thr_get_trx(thr); if (trx->mysql_thd && thd_lock_wait_timeout(trx->mysql_thd) == 0) { - //trx->error_state = DB_LOCK_WAIT_TIMEOUT; + trx->error_state = DB_LOCK_WAIT_TIMEOUT; return DB_LOCK_WAIT_TIMEOUT; } @@ -3119,19 +3119,15 @@ lock_update_merge_right( lock_rec_reset_and_release_wait_low( lock_sys.rec_hash, left_block, PAGE_HEAP_NO_SUPREMUM); -#ifdef UNIV_DEBUG /* there should exist no page lock on the left page, otherwise, it will be blocked from merge */ - ulint space = left_block->page.id.space(); - ulint page_no = left_block->page.id.page_no(); - ut_ad(lock_rec_get_first_on_page_addr( - lock_sys.prdt_page_hash, space, page_no) == NULL); -#endif /* UNIV_DEBUG */ + ut_ad(!lock_rec_get_first_on_page_addr(lock_sys.prdt_page_hash, + left_block->page.id.space(), + left_block->page.id.page_no())); lock_rec_free_all_from_discard_page(left_block); lock_mutex_exit(); - } /*************************************************************//** @@ -3244,15 +3240,12 @@ lock_update_merge_left( lock_rec_move(left_block, right_block, PAGE_HEAP_NO_SUPREMUM, PAGE_HEAP_NO_SUPREMUM); -#ifdef UNIV_DEBUG /* there should exist no page lock on the right page, otherwise, it will be blocked from merge */ - ulint space = right_block->page.id.space(); - ulint page_no = right_block->page.id.page_no(); - lock_t* lock_test = lock_rec_get_first_on_page_addr( - lock_sys.prdt_page_hash, space, page_no); - ut_ad(!lock_test); -#endif /* UNIV_DEBUG */ + ut_ad(!lock_rec_get_first_on_page_addr( + lock_sys.prdt_page_hash, + right_block->page.id.space(), + right_block->page.id.page_no())); lock_rec_free_all_from_discard_page(right_block); diff --git a/storage/innobase/trx/trx0rseg.cc b/storage/innobase/trx/trx0rseg.cc index a1f2c2aec6e..9a2d1d97875 100644 --- a/storage/innobase/trx/trx0rseg.cc +++ b/storage/innobase/trx/trx0rseg.cc @@ -205,7 +205,7 @@ bool trx_rseg_read_wsrep_checkpoint(XID& xid) if (rseg_id == 0) { found = trx_rseg_init_wsrep_xid(sys->frame, xid); ut_ad(!found || xid.formatID == 1); - if (found) { + if (found) { max_xid_seqno = wsrep_xid_seqno(&xid); memcpy(wsrep_uuid, wsrep_xid_uuid(&xid), sizeof wsrep_uuid);