Commit 583ef1e0 authored by unknown's avatar unknown

row0sel.c:

  Optimize speed: no need to keep track of set new rec locks in a consistent read


innobase/row/row0sel.c:
  Optimize speed: no need to keep track of set new rec locks in a consistent read
parent 72b7a834
...@@ -3150,7 +3150,9 @@ row_search_for_mysql( ...@@ -3150,7 +3150,9 @@ row_search_for_mysql(
is set. Then we are able to remove the record locks set here on an is set. Then we are able to remove the record locks set here on an
individual row. */ individual row. */
if (srv_locks_unsafe_for_binlog) { if (srv_locks_unsafe_for_binlog
&& prebuilt->select_lock_type != LOCK_NONE) {
trx_reset_new_rec_lock_info(trx); trx_reset_new_rec_lock_info(trx);
} }
...@@ -3793,7 +3795,9 @@ row_search_for_mysql( ...@@ -3793,7 +3795,9 @@ row_search_for_mysql(
not a consistent read which might see an earlier version not a consistent read which might see an earlier version
of a non-clustered index record */ of a non-clustered index record */
if (srv_locks_unsafe_for_binlog) { if (srv_locks_unsafe_for_binlog
&& prebuilt->select_lock_type != LOCK_NONE) {
/* No need to keep a lock on a delete-marked record /* No need to keep a lock on a delete-marked record
if we do not want to use next-key locking. */ if we do not want to use next-key locking. */
...@@ -3845,7 +3849,9 @@ row_search_for_mysql( ...@@ -3845,7 +3849,9 @@ row_search_for_mysql(
/* The record is delete marked: we can skip it */ /* The record is delete marked: we can skip it */
if (srv_locks_unsafe_for_binlog) { if (srv_locks_unsafe_for_binlog
&& prebuilt->select_lock_type != LOCK_NONE) {
/* No need to keep a lock on a delete-marked /* No need to keep a lock on a delete-marked
record if we do not want to use next-key record if we do not want to use next-key
locking. */ locking. */
...@@ -4013,6 +4019,8 @@ row_search_for_mysql( ...@@ -4013,6 +4019,8 @@ row_search_for_mysql(
thr->lock_state = QUE_THR_LOCK_ROW; thr->lock_state = QUE_THR_LOCK_ROW;
if (row_mysql_handle_errors(&err, trx, thr, NULL)) { if (row_mysql_handle_errors(&err, trx, thr, NULL)) {
/* It was a lock wait, and it ended */
thr->lock_state = QUE_THR_LOCK_NOLOCK; thr->lock_state = QUE_THR_LOCK_NOLOCK;
mtr_start(&mtr); mtr_start(&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