Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
c9220483
Commit
c9220483
authored
Jul 04, 2014
by
Jan Lindström
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-6191: row_search_for_mysql comment and code consistency about isolation level
and gap locks
parent
838977e5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
40 deletions
+30
-40
storage/innobase/row/row0sel.c
storage/innobase/row/row0sel.c
+15
-20
storage/xtradb/row/row0sel.c
storage/xtradb/row/row0sel.c
+15
-20
No files found.
storage/innobase/row/row0sel.c
View file @
c9220483
...
...
@@ -877,16 +877,15 @@ row_sel_get_clust_rec(
if
(
!
node
->
read_view
)
{
/* Try to place a lock on the index record */
/* If innodb_locks_unsafe_for_binlog option is used
or this session is using READ COMMITTED isolation level
we lock only the record, i.e., next-key locking is
not used. */
ulint
lock_type
;
trx_t
*
trx
;
trx
=
thr_get_trx
(
thr
);
/* If innodb_locks_unsafe_for_binlog option is used
or this session is using READ COMMITTED or lower isolation level
we lock only the record, i.e., next-key locking is
not used. */
if
(
srv_locks_unsafe_for_binlog
||
trx
->
isolation_level
<=
TRX_ISO_READ_COMMITTED
)
{
lock_type
=
LOCK_REC_NOT_GAP
;
...
...
@@ -1491,12 +1490,6 @@ rec_loop:
search result set, resulting in the phantom problem. */
if
(
!
consistent_read
)
{
/* If innodb_locks_unsafe_for_binlog option is used
or this session is using READ COMMITTED isolation
level, we lock only the record, i.e., next-key
locking is not used. */
rec_t
*
next_rec
=
page_rec_get_next
(
rec
);
ulint
lock_type
;
trx_t
*
trx
;
...
...
@@ -1506,6 +1499,10 @@ rec_loop:
offsets
=
rec_get_offsets
(
next_rec
,
index
,
offsets
,
ULINT_UNDEFINED
,
&
heap
);
/* If innodb_locks_unsafe_for_binlog option is used
or this session is using READ COMMITTED or lower isolation
level, we lock only the record, i.e., next-key
locking is not used. */
if
(
srv_locks_unsafe_for_binlog
||
trx
->
isolation_level
<=
TRX_ISO_READ_COMMITTED
)
{
...
...
@@ -1554,12 +1551,6 @@ skip_lock:
if
(
!
consistent_read
)
{
/* Try to place a lock on the index record */
/* If innodb_locks_unsafe_for_binlog option is used
or this session is using READ COMMITTED isolation level,
we lock only the record, i.e., next-key locking is
not used. */
ulint
lock_type
;
trx_t
*
trx
;
...
...
@@ -1568,6 +1559,10 @@ skip_lock:
trx
=
thr_get_trx
(
thr
);
/* If innodb_locks_unsafe_for_binlog option is used
or this session is using READ COMMITTED or lower isolation level,
we lock only the record, i.e., next-key locking is
not used. */
if
(
srv_locks_unsafe_for_binlog
||
trx
->
isolation_level
<=
TRX_ISO_READ_COMMITTED
)
{
...
...
@@ -3992,7 +3987,7 @@ rec_loop:
/* Try to place a lock on the index record */
/* If innodb_locks_unsafe_for_binlog option is used
or this session is using a READ COMMITTED isolation
or this session is using a READ COMMITTED
or lower
isolation
level we do not lock gaps. Supremum record is really
a gap and therefore we do not set locks there. */
...
...
@@ -4131,7 +4126,7 @@ wrong_offs:
/* Try to place a gap lock on the index
record only if innodb_locks_unsafe_for_binlog
option is not set or this session is not
using a READ COMMITTED isolation level. */
using a READ COMMITTED
or lower
isolation level. */
err
=
sel_set_rec_lock
(
btr_pcur_get_block
(
pcur
),
...
...
@@ -4178,7 +4173,7 @@ wrong_offs:
/* Try to place a gap lock on the index
record only if innodb_locks_unsafe_for_binlog
option is not set or this session is not
using a READ COMMITTED isolation level. */
using a READ COMMITTED
or lower
isolation level. */
err
=
sel_set_rec_lock
(
btr_pcur_get_block
(
pcur
),
...
...
storage/xtradb/row/row0sel.c
View file @
c9220483
...
...
@@ -879,16 +879,15 @@ row_sel_get_clust_rec(
if
(
!
node
->
read_view
)
{
/* Try to place a lock on the index record */
/* If innodb_locks_unsafe_for_binlog option is used
or this session is using READ COMMITTED isolation level
we lock only the record, i.e., next-key locking is
not used. */
ulint
lock_type
;
trx_t
*
trx
;
trx
=
thr_get_trx
(
thr
);
/* If innodb_locks_unsafe_for_binlog option is used
or this session is using READ COMMITTED or lower isolation level
we lock only the record, i.e., next-key locking is
not used. */
if
(
srv_locks_unsafe_for_binlog
||
trx
->
isolation_level
<=
TRX_ISO_READ_COMMITTED
)
{
lock_type
=
LOCK_REC_NOT_GAP
;
...
...
@@ -1494,12 +1493,6 @@ rec_loop:
search result set, resulting in the phantom problem. */
if
(
!
consistent_read
)
{
/* If innodb_locks_unsafe_for_binlog option is used
or this session is using READ COMMITTED isolation
level, we lock only the record, i.e., next-key
locking is not used. */
rec_t
*
next_rec
=
page_rec_get_next
(
rec
);
ulint
lock_type
;
trx_t
*
trx
;
...
...
@@ -1509,6 +1502,10 @@ rec_loop:
offsets
=
rec_get_offsets
(
next_rec
,
index
,
offsets
,
ULINT_UNDEFINED
,
&
heap
);
/* If innodb_locks_unsafe_for_binlog option is used
or this session is using READ COMMITTED or lower isolation
level, we lock only the record, i.e., next-key
locking is not used. */
if
(
srv_locks_unsafe_for_binlog
||
trx
->
isolation_level
<=
TRX_ISO_READ_COMMITTED
)
{
...
...
@@ -1557,12 +1554,6 @@ skip_lock:
if
(
!
consistent_read
)
{
/* Try to place a lock on the index record */
/* If innodb_locks_unsafe_for_binlog option is used
or this session is using READ COMMITTED isolation level,
we lock only the record, i.e., next-key locking is
not used. */
ulint
lock_type
;
trx_t
*
trx
;
...
...
@@ -1571,6 +1562,10 @@ skip_lock:
trx
=
thr_get_trx
(
thr
);
/* If innodb_locks_unsafe_for_binlog option is used
or this session is using READ COMMITTED or lower isolation level,
we lock only the record, i.e., next-key locking is
not used. */
if
(
srv_locks_unsafe_for_binlog
||
trx
->
isolation_level
<=
TRX_ISO_READ_COMMITTED
)
{
...
...
@@ -4142,7 +4137,7 @@ rec_loop:
/* Try to place a lock on the index record */
/* If innodb_locks_unsafe_for_binlog option is used
or this session is using a READ COMMITTED isolation
or this session is using a READ COMMITTED
or lower
isolation
level we do not lock gaps. Supremum record is really
a gap and therefore we do not set locks there. */
...
...
@@ -4289,7 +4284,7 @@ wrong_offs:
/* Try to place a gap lock on the index
record only if innodb_locks_unsafe_for_binlog
option is not set or this session is not
using a READ COMMITTED isolation level. */
using a READ COMMITTED
or lower
isolation level. */
err
=
sel_set_rec_lock
(
btr_pcur_get_block
(
pcur
),
...
...
@@ -4336,7 +4331,7 @@ wrong_offs:
/* Try to place a gap lock on the index
record only if innodb_locks_unsafe_for_binlog
option is not set or this session is not
using a READ COMMITTED isolation level. */
using a READ COMMITTED
or lower
isolation level. */
err
=
sel_set_rec_lock
(
btr_pcur_get_block
(
pcur
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment