diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-05-08 09:52:54 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-05-08 09:52:54 +0200 |
commit | bcfa90b471b4a04ba9eb9dccd88a41c8f72cd38a (patch) | |
tree | 936f2f6cb3a07a867bd8e7f51fdc4609abff1f82 /include | |
parent | 086b54c281eaf5470b0424d926492d7ee25e4916 (diff) | |
download | mariadb-git-bcfa90b471b4a04ba9eb9dccd88a41c8f72cd38a.tar.gz |
Percona-Server-5.5.30-rel30.2.tar.gz
Diffstat (limited to 'include')
-rw-r--r-- | include/btr0btr.ic | 2 | ||||
-rw-r--r-- | include/buf0buf.h | 1 | ||||
-rw-r--r-- | include/buf0buf.ic | 9 | ||||
-rw-r--r-- | include/buf0flu.ic | 2 | ||||
-rw-r--r-- | include/buf0lru.h | 7 | ||||
-rw-r--r-- | include/fut0fut.ic | 5 | ||||
-rw-r--r-- | include/log0log.h | 16 | ||||
-rw-r--r-- | include/log0log.ic | 23 | ||||
-rw-r--r-- | include/mtr0mtr.h | 2 | ||||
-rw-r--r-- | include/mtr0mtr.ic | 21 | ||||
-rw-r--r-- | include/read0read.h | 33 | ||||
-rw-r--r-- | include/read0read.ic | 41 | ||||
-rw-r--r-- | include/srv0srv.h | 17 | ||||
-rw-r--r-- | include/trx0purge.h | 1 | ||||
-rw-r--r-- | include/trx0sys.h | 38 | ||||
-rw-r--r-- | include/trx0sys.ic | 46 | ||||
-rw-r--r-- | include/trx0trx.h | 43 | ||||
-rw-r--r-- | include/trx0trx.ic | 8 |
18 files changed, 219 insertions, 96 deletions
diff --git a/include/btr0btr.ic b/include/btr0btr.ic index 53c8159c448..798107628d7 100644 --- a/include/btr0btr.ic +++ b/include/btr0btr.ic @@ -59,7 +59,7 @@ btr_block_get_func( block = buf_page_get_gen(space, zip_size, page_no, mode, NULL, BUF_GET, file, line, mtr); - ut_a(srv_pass_corrupt_table || block); + SRV_CORRUPT_TABLE_CHECK(block, ; /* do nothing */); if (block && mode != RW_NO_LATCH) { diff --git a/include/buf0buf.h b/include/buf0buf.h index f4f9cc47ff4..991fdb7ca88 100644 --- a/include/buf0buf.h +++ b/include/buf0buf.h @@ -1587,7 +1587,6 @@ struct buf_page_struct{ 0 if the block was never accessed in the buffer pool. Protected by block mutex */ - ibool space_was_being_deleted; ibool is_corrupt; # if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG ibool file_page_was_freed; diff --git a/include/buf0buf.ic b/include/buf0buf.ic index 8d5c3edeef8..18c46b6412e 100644 --- a/include/buf0buf.ic +++ b/include/buf0buf.ic @@ -430,7 +430,6 @@ buf_block_set_file_page( buf_block_set_state(block, BUF_BLOCK_FILE_PAGE); block->page.space = space; block->page.offset = page_no; - block->page.space_was_being_deleted = FALSE; } /*********************************************************************//** @@ -712,13 +711,7 @@ buf_block_get_frame( /*================*/ const buf_block_t* block) /*!< in: pointer to the control block */ { - ut_a(srv_pass_corrupt_table || block); - - if (srv_pass_corrupt_table && !block) { - return(0); - } - - ut_ad(block); + SRV_CORRUPT_TABLE_CHECK(block, return(0);); switch (buf_block_get_state(block)) { case BUF_BLOCK_ZIP_FREE: diff --git a/include/buf0flu.ic b/include/buf0flu.ic index 30e2cc8efe8..8228c025d23 100644 --- a/include/buf0flu.ic +++ b/include/buf0flu.ic @@ -70,7 +70,7 @@ buf_flush_note_modification( ut_ad(!buf_pool_mutex_own(buf_pool)); ut_ad(!buf_flush_list_mutex_own(buf_pool)); - ut_ad(log_flush_order_mutex_own()); + ut_ad(!mtr->made_dirty || log_flush_order_mutex_own()); ut_ad(mtr->start_lsn != 0); ut_ad(mtr->modifications); diff --git a/include/buf0lru.h b/include/buf0lru.h index 2ea4f9b1ecf..8bb3aed4059 100644 --- a/include/buf0lru.h +++ b/include/buf0lru.h @@ -73,13 +73,6 @@ buf_LRU_flush_or_remove_pages( enum buf_remove_t buf_remove);/*!< in: remove or flush strategy */ -/******************************************************************//** -*/ -UNIV_INTERN -void -buf_LRU_mark_space_was_deleted( -/*===========================*/ - ulint id); /*!< in: space id */ #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG /********************************************************************//** Insert a compressed block into buf_pool->zip_clean in the LRU order. */ diff --git a/include/fut0fut.ic b/include/fut0fut.ic index 529f2a516d3..63e5736d99e 100644 --- a/include/fut0fut.ic +++ b/include/fut0fut.ic @@ -50,10 +50,7 @@ fut_get_ptr( block = buf_page_get(space, zip_size, addr.page, rw_latch, mtr); - if (srv_pass_corrupt_table && !block) { - return(0); - } - ut_a(block); + SRV_CORRUPT_TABLE_CHECK(block, return(0);); ptr = buf_block_get_frame(block) + addr.boffset; diff --git a/include/log0log.h b/include/log0log.h index ee20f429a2b..e4c19c41137 100644 --- a/include/log0log.h +++ b/include/log0log.h @@ -122,14 +122,22 @@ UNIV_INLINE void log_free_check(void); /*================*/ +/**************************************************************************//** +Locks the log mutex and opens the log for log_write_low. The log must be closed +with log_close and released with log_release. +@return start lsn of the log record */ +UNIV_INLINE +ib_uint64_t +log_reserve_and_open( +/*=================*/ + ulint len); /*!< in: length of data to be catenated */ /************************************************************//** -Opens the log for log_write_low. The log must be closed with log_close and -released with log_release. +Opens the log for log_write_low. The log must be closed with log_close. @return start lsn of the log record */ UNIV_INTERN ib_uint64_t -log_reserve_and_open( -/*=================*/ +log_open( +/*=====*/ ulint len); /*!< in: length of data to be catenated */ /************************************************************//** Writes to the log the string given. It is assumed that the caller holds the diff --git a/include/log0log.ic b/include/log0log.ic index 67db6695cab..c39586dbcf9 100644 --- a/include/log0log.ic +++ b/include/log0log.ic @@ -332,10 +332,10 @@ log_reserve_and_write_fast( if (data_len >= OS_FILE_LOG_BLOCK_SIZE - LOG_BLOCK_TRL_SIZE) { - /* The string does not fit within the current log block - or the log block would become full */ - - mutex_exit(&log_sys->mutex); + /* The string does not fit within the current log block or the + log block would become full. Do not release the log mutex, + because it has to be reacquired immediately for the "slow" write + procedure via log_write_low(). */ return(0); } @@ -382,6 +382,21 @@ log_reserve_and_write_fast( return(log_sys->lsn); } +/**************************************************************************//** +Locks the log mutex and opens the log for log_write_low. The log must be closed +with log_close and released with log_release. +@return start lsn of the log record */ +UNIV_INLINE +ib_uint64_t +log_reserve_and_open( +/*=================*/ + ulint len) /*!< in: length of data to be catenated */ +{ + mutex_enter(&(log_sys->mutex)); + + return log_open(len); +} + /***********************************************************************//** Releases the log mutex. */ UNIV_INLINE diff --git a/include/mtr0mtr.h b/include/mtr0mtr.h index 46f1ff9310c..c51632e0ed5 100644 --- a/include/mtr0mtr.h +++ b/include/mtr0mtr.h @@ -375,6 +375,8 @@ struct mtr_struct{ ibool modifications; /* TRUE if the mtr made modifications to buffer pool pages */ + ibool made_dirty;/*!< TRUE if mtr has made at least + one buffer pool page dirty */ ulint n_log_recs; /* count of how many page initial log records have been written to the mtr log */ diff --git a/include/mtr0mtr.ic b/include/mtr0mtr.ic index a03a0271535..7b5d268b70f 100644 --- a/include/mtr0mtr.ic +++ b/include/mtr0mtr.ic @@ -29,6 +29,17 @@ Created 11/26/1995 Heikki Tuuri #endif /* !UNIV_HOTBACKUP */ #include "mach0data.h" +/***************************************************//** +Checks if a mini-transaction is dirtying a clean page. +@return TRUE if the mtr is dirtying a clean page. */ +UNIV_INTERN +ibool +mtr_block_dirtied( +/*==============*/ + const buf_block_t* block) /*!< in: block being x-fixed */ + __attribute__((nonnull,warn_unused_result)); + + /***************************************************************//** Starts a mini-transaction. */ UNIV_INLINE @@ -47,6 +58,7 @@ mtr_start( mtr->inside_ibuf = FALSE; mtr->n_log_recs = 0; mtr->n_freed_pages = 0; + mtr->made_dirty = FALSE; ut_d(mtr->state = MTR_ACTIVE); ut_d(mtr->magic_n = MTR_MAGIC_N); @@ -65,6 +77,15 @@ mtr_memo_push( dyn_array_t* memo; mtr_memo_slot_t* slot; + /* If this mtr has x-fixed a clean page then we set + the made_dirty flag. This tells us if we need to + grab log_flush_order_mutex at mtr_commit so that we + can insert the dirtied page to the flush list. */ + if (type == MTR_MEMO_PAGE_X_FIX && !mtr->made_dirty) { + mtr->made_dirty = + mtr_block_dirtied((const buf_block_t *)object); + } + ut_ad(object); ut_ad(type >= MTR_MEMO_PAGE_S_FIX); ut_ad(type <= MTR_MEMO_X_LOCK); diff --git a/include/read0read.h b/include/read0read.h index 0c9468d985e..dd378ecc997 100644 --- a/include/read0read.h +++ b/include/read0read.h @@ -32,6 +32,7 @@ Created 2/16/1997 Heikki Tuuri #include "ut0byte.h" #include "ut0lst.h" #include "trx0trx.h" +#include "trx0sys.h" #include "read0types.h" /*********************************************************************//** @@ -44,8 +45,11 @@ read_view_open_now( /*===============*/ trx_id_t cr_trx_id, /*!< in: trx_id of creating transaction, or 0 used in purge */ - mem_heap_t* heap); /*!< in: memory heap from which - allocated */ + read_view_t* view, /*!< in: current read view or NULL if it + doesn't exist yet */ + ibool exclude_self); /*!< in: TRUE, if cr_trx_id should be + excluded from the resulting view */ + /*********************************************************************//** Makes a copy of the oldest existing read view, or opens a new. The view must be closed with ..._close. @@ -56,8 +60,8 @@ read_view_oldest_copy_or_open_new( /*==============================*/ trx_id_t cr_trx_id, /*!< in: trx_id of creating transaction, or 0 used in purge */ - mem_heap_t* heap); /*!< in: memory heap from which - allocated */ + read_view_t* view); /*!< in: pre-allocated view array or + NULL if a new one needs to be created */ /*********************************************************************//** Closes a read view. */ UNIV_INTERN @@ -66,6 +70,13 @@ read_view_close( /*============*/ read_view_t* view); /*!< in: read view */ /*********************************************************************//** +Frees memory allocated by a read view. */ +UNIV_INTERN +void +read_view_free( +/*===========*/ + read_view_t* view); /*< in: read view */ +/*********************************************************************//** Closes a consistent read view for MySQL. This function is called at an SQL statement end if the trx isolation level is <= TRX_ISO_READ_COMMITTED. */ UNIV_INTERN @@ -143,16 +154,20 @@ struct read_view_struct{ are strictly smaller (<) than this value. In other words, this is the "low water mark". */ - ulint n_trx_ids; + ulint n_descr; /*!< Number of cells in the trx_ids array */ - trx_id_t* trx_ids;/*!< Additional trx ids which the read should - not see: typically, these are the active + ulint max_descr; + /*!< Maximum number of cells in the trx_ids + array */ + trx_id_t* descriptors; + /*!< Array of trx descriptors which the read + should not see: typically, these are the active transactions at the time when the read is serialized, except the reading transaction itself; the trx ids in this array are in a descending order. These trx_ids should be - between the "low" and "high" water marks, - that is, up_limit_id and low_limit_id. */ + between the "low" and "high" water marks, that + is, up_limit_id and low_limit_id. */ trx_id_t creator_trx_id; /*!< trx id of creating transaction, or 0 used in purge */ diff --git a/include/read0read.ic b/include/read0read.ic index 5bb5249b591..ebcdb767406 100644 --- a/include/read0read.ic +++ b/include/read0read.ic @@ -25,6 +25,11 @@ Created 2/16/1997 Heikki Tuuri /*********************************************************************//** Gets the nth trx id in a read view. + +Upstream code stores array of trx_ids in the descending order. Percona Server +keeps it in the ascending order for performance reasons. Let us keep the +semantics. + @return trx id */ UNIV_INLINE trx_id_t @@ -33,13 +38,17 @@ read_view_get_nth_trx_id( const read_view_t* view, /*!< in: read view */ ulint n) /*!< in: position */ { - ut_ad(n < view->n_trx_ids); + ut_ad(n < view->n_descr); - return(*(view->trx_ids + n)); + return(view->descriptors[view->n_descr - 1 - n]); } /*********************************************************************//** -Sets the nth trx id in a read view. */ +Sets the nth trx id in a read view. + +Upstream code stores array of trx_ids in the descending order. Percona Server +keeps it in the ascending order for performance reasons. Let us keep the +semantics. */ UNIV_INLINE void read_view_set_nth_trx_id( @@ -48,9 +57,9 @@ read_view_set_nth_trx_id( ulint n, /*!< in: position */ trx_id_t trx_id) /*!< in: trx id to set */ { - ut_ad(n < view->n_trx_ids); + ut_ad(n < view->n_descr); - *(view->trx_ids + n) = trx_id; + view->descriptors[view->n_descr - 1 - n] = trx_id; } /*********************************************************************//** @@ -63,9 +72,6 @@ read_view_sees_trx_id( const read_view_t* view, /*!< in: read view */ trx_id_t trx_id) /*!< in: trx id */ { - ulint n_ids; - ulint i; - if (trx_id < view->up_limit_id) { return(TRUE); @@ -76,21 +82,8 @@ read_view_sees_trx_id( return(FALSE); } - /* We go through the trx ids in the array smallest first: this order - may save CPU time, because if there was a very long running - transaction in the trx id array, its trx id is looked at first, and - the first two comparisons may well decide the visibility of trx_id. */ - - n_ids = view->n_trx_ids; - - for (i = 0; i < n_ids; i++) { - trx_id_t view_trx_id - = read_view_get_nth_trx_id(view, n_ids - i - 1); - - if (trx_id <= view_trx_id) { - return(trx_id != view_trx_id); - } - } + /* Do a binary search over this view's descriptors array */ - return(TRUE); + return(trx_find_descriptor(view->descriptors, view->n_descr, + trx_id) == NULL); } diff --git a/include/srv0srv.h b/include/srv0srv.h index 53dbdf8bd8f..c4fb9712b51 100644 --- a/include/srv0srv.h +++ b/include/srv0srv.h @@ -266,9 +266,22 @@ extern ulint srv_adaptive_flushing_method; extern ulint srv_expand_import; extern ulint srv_pass_corrupt_table; -extern ulint srv_dict_size_limit; +/* Helper macro to support srv_pass_corrupt_table checks. If 'cond' is FALSE, +execute 'code' if srv_pass_corrupt_table is non-zero, or trigger a fatal error +otherwise. The break statement in 'code' will obviously not work as expected. */ + +#define SRV_CORRUPT_TABLE_CHECK(cond,code) \ + do { \ + if (UNIV_UNLIKELY(!(cond))) { \ + if (srv_pass_corrupt_table) { \ + code \ + } else { \ + ut_error; \ + } \ + } \ + } while(0) -extern ulint srv_lazy_drop_table; +extern ulint srv_dict_size_limit; /*-------------------------------------------*/ extern ulint srv_n_rows_inserted; diff --git a/include/trx0purge.h b/include/trx0purge.h index 1e8acd65e01..1ddc9068b8e 100644 --- a/include/trx0purge.h +++ b/include/trx0purge.h @@ -143,6 +143,7 @@ struct trx_purge_struct{ obtaining an s-latch here. */ read_view_t* view; /*!< The purge will not remove undo logs which are >= this view (purge view) */ + read_view_t* prebuilt_view; /*!< Pre-built view array */ ulonglong n_pages_handled;/*!< Approximate number of undo log pages processed in purge */ ulonglong handle_limit; /*!< Target of how many pages to get diff --git a/include/trx0sys.h b/include/trx0sys.h index cba21ae97a9..75a3b0fb4fd 100644 --- a/include/trx0sys.h +++ b/include/trx0sys.h @@ -249,6 +249,17 @@ trx_id_t trx_sys_get_new_trx_id(void); /*========================*/ +/*************************************************************//** +Find a slot for a given trx ID in a descriptors array. +@return: slot pointer */ +UNIV_INLINE +trx_id_t* +trx_find_descriptor( +/*================*/ + const trx_id_t* descriptors, /*!< in: descriptors array */ + ulint n_descr, /*!< in: array size */ + trx_id_t trx_id); /*!< in: trx pointer */ + #ifdef UNIV_DEBUG /* Flag to control TRX_RSEG_N_SLOTS behavior debugging. */ extern uint trx_rseg_n_slots_debug; @@ -633,6 +644,8 @@ identifier is added to this 64-bit constant. */ | TRX_SYS_FILE_FORMAT_TAG_MAGIC_N_LOW) /* @} */ +#define TRX_DESCR_ARRAY_INITIAL_SIZE 1000 + #ifndef UNIV_HOTBACKUP /** Doublewrite control struct */ struct trx_doublewrite_struct{ @@ -660,16 +673,41 @@ struct trx_sys_struct{ trx_id_t max_trx_id; /*!< The smallest number not yet assigned as a transaction id or transaction number */ + char pad1[64]; /*!< Ensure max_trx_id does not share + cache line with other fields. */ + trx_id_t* descriptors; /*!< Array of trx descriptors */ + ulint descr_n_max; /*!< The current size of the descriptors + array. */ + char pad2[64]; /*!< Ensure static descriptor fields + do not share cache lines with + descr_n_used */ + ulint descr_n_used; /*!< Number of used elements in the + descriptors array. */ + char pad3[64]; /*!< Ensure descriptors do not share + cache line with other fields */ UT_LIST_BASE_NODE_T(trx_t) trx_list; /*!< List of active and committed in memory transactions, sorted on trx id, biggest first */ + char pad4[64]; /*!< Ensure list base nodes do not + share cache line with other fields */ UT_LIST_BASE_NODE_T(trx_t) mysql_trx_list; /*!< List of transactions created for MySQL */ + char pad5[64]; /*!< Ensure list base nodes do not + share cache line with other fields */ + UT_LIST_BASE_NODE_T(trx_t) trx_serial_list; + /*!< trx->no ordered List of + transactions in either TRX_PREPARED or + TRX_ACTIVE which have already been + assigned a serialization number */ + char pad6[64]; /*!< Ensure trx_serial_list does not + share cache line with other fields */ UT_LIST_BASE_NODE_T(trx_rseg_t) rseg_list; /*!< List of rollback segment objects */ + char pad7[64]; /*!< Ensure list base nodes do not + share cache line with other fields */ trx_rseg_t* latest_rseg; /*!< Latest rollback segment in the round-robin assignment of rollback segments to transactions */ diff --git a/include/trx0sys.ic b/include/trx0sys.ic index af05ab2f5ed..3af98cdf98b 100644 --- a/include/trx0sys.ic +++ b/include/trx0sys.ic @@ -367,28 +367,11 @@ trx_is_active( /*==========*/ trx_id_t trx_id) /*!< in: trx id of the transaction */ { - trx_t* trx; - ut_ad(mutex_own(&(kernel_mutex))); - if (trx_id < trx_list_get_min_trx_id()) { - - return(FALSE); - } - - if (UNIV_UNLIKELY(trx_id >= trx_sys->max_trx_id)) { - - /* There must be corruption: we return TRUE because this - function is only called by lock_clust_rec_some_has_impl() - and row_vers_impl_x_locked_off_kernel() and they have - diagnostic prints in this case */ - - return(TRUE); - } - - trx = trx_get_on_id(trx_id); - if (trx && (trx->conc_state == TRX_ACTIVE - || trx->conc_state == TRX_PREPARED)) { + if (trx_find_descriptor(trx_sys->descriptors, + trx_sys->descr_n_used, + trx_id)) { return(TRUE); } @@ -425,4 +408,27 @@ trx_sys_get_new_trx_id(void) return(id); } + +/*************************************************************//** +Find a slot for a given trx ID in a descriptors array. +@return: slot pointer */ +UNIV_INLINE +trx_id_t* +trx_find_descriptor( +/*================*/ + const trx_id_t* descriptors, /*!< in: descriptors array */ + ulint n_descr, /*!< in: array size */ + trx_id_t trx_id) /*!< in: trx pointer */ +{ + ut_ad(descriptors != trx_sys->descriptors || + mutex_own(&kernel_mutex)); + + if (UNIV_UNLIKELY(n_descr == 0)) { + + return(NULL); + } + + return((trx_id_t *) bsearch(&trx_id, descriptors, n_descr, + sizeof(trx_id_t), trx_descr_cmp)); +} #endif /* !UNIV_HOTBACKUP */ diff --git a/include/trx0trx.h b/include/trx0trx.h index 39b8ccf26ec..fec1d746297 100644 --- a/include/trx0trx.h +++ b/include/trx0trx.h @@ -447,6 +447,23 @@ trx_get_que_state_str( /*==================*/ const trx_t* trx); /*!< in: transaction */ +/*************************************************************//** +Callback function for trx_find_descriptor() to compare trx IDs. */ +UNIV_INTERN +int +trx_descr_cmp( +/*==========*/ + const void *a, /*!< in: pointer to first comparison argument */ + const void *b); /*!< in: pointer to second comparison argument */ + +/*************************************************************//** +Release a slot for a given trx in the global descriptors array. */ +UNIV_INTERN +void +trx_release_descriptor( +/*===================*/ + trx_t* trx); /*!< in: trx pointer */ + /* Signal to a transaction */ struct trx_sig_struct{ unsigned type:3; /*!< signal type */ @@ -477,10 +494,18 @@ struct trx_struct{ const char* op_info; /*!< English text describing the current operation, or an empty string */ - ulint conc_state; /*!< state of the trx from the point - of view of concurrency control: - TRX_ACTIVE, TRX_COMMITTED_IN_MEMORY, - ... */ + ulint state; /*!< state of the trx from the point of + view of concurrency control: TRX_ACTIVE, + TRX_COMMITTED_IN_MEMORY, ... This was + called 'conc_state' in the upstream and + has been renamed in Percona Server, + because changing it's value to/from + either TRX_ACTIVE or TRX_PREPARED + requires calling + trx_reserve_descriptor() / + trx_release_descriptor(). Different name + ensures we notice any new code changing + the state. */ /*------------------------------*/ /* MySQL has a transaction coordinator to coordinate two phase commit between multiple storage engines and the binary log. When @@ -495,6 +520,9 @@ struct trx_struct{ also be set to 1. This is used in the XA code */ unsigned called_commit_ordered:1;/* 1 if innobase_commit_ordered has run. */ + unsigned is_in_trx_serial_list:1; + /* Set when transaction is in the + trx_serial_list */ /*------------------------------*/ ulint isolation_level;/* TRX_ISO_REPEATABLE_READ, ... */ ulint check_foreigns; /* normally TRUE, but if the user @@ -628,6 +656,9 @@ struct trx_struct{ UT_LIST_NODE_T(trx_t) mysql_trx_list; /*!< list of transactions created for MySQL */ + UT_LIST_NODE_T(trx_t) + trx_serial_list;/*!< list node for + trx_sys->trx_serial_list */ /*------------------------------*/ ulint error_state; /*!< 0 if no error, otherwise error number; NOTE That ONLY the thread @@ -686,9 +717,6 @@ struct trx_struct{ UT_LIST_BASE_NODE_T(lock_t) trx_locks; /*!< locks reserved by the transaction */ /*------------------------------*/ - mem_heap_t* global_read_view_heap; - /* memory heap for the global read - view */ read_view_t* global_read_view; /* consistent read view associated to a transaction or NULL */ @@ -698,6 +726,7 @@ struct trx_struct{ associated to a transaction (i.e. same as global_read_view) or read view associated to a cursor */ + read_view_t* prebuilt_view; /* pre-built view array */ /*------------------------------*/ UT_LIST_BASE_NODE_T(trx_named_savept_t) trx_savepoints; /*!< savepoints set with SAVEPOINT ..., diff --git a/include/trx0trx.ic b/include/trx0trx.ic index 4a1d3bcde0b..1a1fc91eac5 100644 --- a/include/trx0trx.ic +++ b/include/trx0trx.ic @@ -31,9 +31,9 @@ trx_start_if_not_started( /*=====================*/ trx_t* trx) /*!< in: transaction */ { - ut_ad(trx->conc_state != TRX_COMMITTED_IN_MEMORY); + ut_ad(trx->state != TRX_COMMITTED_IN_MEMORY); - if (trx->conc_state == TRX_NOT_STARTED) { + if (trx->state == TRX_NOT_STARTED) { trx_start(trx, ULINT_UNDEFINED); } @@ -48,9 +48,9 @@ trx_start_if_not_started_low( /*=========================*/ trx_t* trx) /*!< in: transaction */ { - ut_ad(trx->conc_state != TRX_COMMITTED_IN_MEMORY); + ut_ad(trx->state != TRX_COMMITTED_IN_MEMORY); - if (trx->conc_state == TRX_NOT_STARTED) { + if (trx->state == TRX_NOT_STARTED) { trx_start_low(trx, ULINT_UNDEFINED); } |