summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--storage/innobase/row/row0sel.cc16
-rw-r--r--storage/innobase/row/row0upd.cc11
2 files changed, 16 insertions, 11 deletions
diff --git a/storage/innobase/row/row0sel.cc b/storage/innobase/row/row0sel.cc
index 18ae2a8a4e8..4884fe99fef 100644
--- a/storage/innobase/row/row0sel.cc
+++ b/storage/innobase/row/row0sel.cc
@@ -4472,13 +4472,17 @@ row_search_mvcc(
thread that is currently serving the transaction. Because we
are that thread, we can read trx->state without holding any
mutex. */
- ut_ad(prebuilt->sql_stat_start || trx->state == TRX_STATE_ACTIVE);
+ ut_ad(prebuilt->sql_stat_start
+ || trx->state == TRX_STATE_ACTIVE
+ || (prebuilt->table->no_rollback()
+ && trx->state == TRX_STATE_NOT_STARTED));
ut_ad(!trx_is_started(trx) || trx->state == TRX_STATE_ACTIVE);
ut_ad(prebuilt->sql_stat_start
|| prebuilt->select_lock_type != LOCK_NONE
|| MVCC::is_view_active(trx->read_view)
+ || prebuilt->table->no_rollback()
|| srv_read_only_mode);
if (trx->isolation_level <= TRX_ISO_READ_COMMITTED
@@ -4517,7 +4521,11 @@ row_search_mvcc(
/* Do some start-of-statement preparations */
- if (!prebuilt->sql_stat_start) {
+ if (prebuilt->table->no_rollback()) {
+ /* NO_ROLLBACK tables do not support MVCC or locking. */
+ prebuilt->select_lock_type = LOCK_NONE;
+ prebuilt->sql_stat_start = FALSE;
+ } else if (!prebuilt->sql_stat_start) {
/* No need to set an intention lock or assign a read view */
if (!MVCC::is_view_active(trx->read_view)
@@ -4531,10 +4539,6 @@ row_search_mvcc(
fputc('\n', stderr);
ut_error;
}
- } else if (prebuilt->table->no_rollback()) {
- /* NO_ROLLBACK tables do not support MVCC or locking. */
- prebuilt->select_lock_type = LOCK_NONE;
- prebuilt->sql_stat_start = FALSE;
} else if (prebuilt->select_lock_type == LOCK_NONE) {
/* This is a consistent read */
/* Assign a read view for the query */
diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc
index 2bb866e7f87..6ddc2c11cc9 100644
--- a/storage/innobase/row/row0upd.cc
+++ b/storage/innobase/row/row0upd.cc
@@ -3042,12 +3042,13 @@ row_upd_clust_step(
mtr_start_trx(&mtr, thr_get_trx(thr));
mtr.set_named_space(index->space);
- /* Disable REDO logging as lifetime of temp-tables is limited to
- server or connection lifetime and so REDO information is not needed
- on restart for recovery.
- Disable locking as temp-tables are not shared across connection. */
if (dict_table_is_temporary(node->table)) {
- flags = BTR_NO_LOCKING_FLAG;
+ /* Disable locking, because temporary tables are
+ private to the connection (no concurrent access). */
+ flags = node->table->no_rollback()
+ ? BTR_NO_ROLLBACK
+ : BTR_NO_LOCKING_FLAG;
+ /* Redo logging only matters for persistent tables. */
mtr.set_log_mode(MTR_LOG_NO_REDO);
} else {
flags = node->table->no_rollback() ? BTR_NO_ROLLBACK : 0;