Commit 85cd21bf authored by osku's avatar osku

Don't take unnecessary locks on supremum records when the

srv_locks_unsafe_for_binlog option is enabled. Fixes an assertion failure in
the innodb_unsafe_binlog testcase when compiled with UNIV_DEBUG.
parent 870edae7
...@@ -1359,6 +1359,12 @@ rec_loop: ...@@ -1359,6 +1359,12 @@ rec_loop:
if (srv_locks_unsafe_for_binlog if (srv_locks_unsafe_for_binlog
|| trx->isolation_level == TRX_ISO_READ_COMMITTED) { || trx->isolation_level == TRX_ISO_READ_COMMITTED) {
if (page_rec_is_supremum(next_rec)) {
goto skip_lock;
}
lock_type = LOCK_REC_NOT_GAP; lock_type = LOCK_REC_NOT_GAP;
} else { } else {
lock_type = LOCK_ORDINARY; lock_type = LOCK_ORDINARY;
...@@ -1377,6 +1383,7 @@ rec_loop: ...@@ -1377,6 +1383,7 @@ rec_loop:
} }
} }
skip_lock:
if (page_rec_is_infimum(rec)) { if (page_rec_is_infimum(rec)) {
/* The infimum record on a page cannot be in the result set, /* The infimum record on a page cannot be in the result set,
...@@ -1407,6 +1414,12 @@ rec_loop: ...@@ -1407,6 +1414,12 @@ rec_loop:
if (srv_locks_unsafe_for_binlog if (srv_locks_unsafe_for_binlog
|| trx->isolation_level == TRX_ISO_READ_COMMITTED) { || trx->isolation_level == TRX_ISO_READ_COMMITTED) {
if (page_rec_is_supremum(rec)) {
goto next_rec;
}
lock_type = LOCK_REC_NOT_GAP; lock_type = LOCK_REC_NOT_GAP;
} else { } else {
lock_type = LOCK_ORDINARY; lock_type = LOCK_ORDINARY;
......
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