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
d12c3540
Commit
d12c3540
authored
Nov 22, 2004
by
jan@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed BUG #6747: innodb_locks_unsafe_for_binlog still uses next-key locking.
parent
e3b94d4e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
62 deletions
+72
-62
innobase/row/row0sel.c
innobase/row/row0sel.c
+72
-62
No files found.
innobase/row/row0sel.c
View file @
d12c3540
...
...
@@ -642,16 +642,17 @@ row_sel_get_clust_rec(
we lock only the record, i.e. next-key locking is
not used.
*/
if
(
srv_locks_unsafe_for_binlog
)
{
err
=
lock_clust_rec_read_check_and_lock
(
0
,
clust_rec
,
index
,
node
->
row_lock_mode
,
LOCK_REC_NOT_GAP
,
thr
);
}
else
{
err
=
lock_clust_rec_read_check_and_lock
(
0
,
clust_rec
,
index
,
node
->
row_lock_mode
,
LOCK_ORDINARY
,
thr
);
if
(
srv_locks_unsafe_for_binlog
)
{
err
=
lock_clust_rec_read_check_and_lock
(
0
,
clust_rec
,
index
,
node
->
row_lock_mode
,
LOCK_REC_NOT_GAP
,
thr
);
}
else
{
err
=
lock_clust_rec_read_check_and_lock
(
0
,
clust_rec
,
index
,
node
->
row_lock_mode
,
LOCK_ORDINARY
,
thr
);
}
if
(
err
!=
DB_SUCCESS
)
{
...
...
@@ -1210,16 +1211,18 @@ rec_loop:
not used.
*/
if
(
srv_locks_unsafe_for_binlog
)
{
err
=
sel_set_rec_lock
(
page_rec_get_next
(
rec
),
index
,
node
->
row_lock_mode
,
LOCK_REC_NOT_GAP
,
thr
);
}
else
{
err
=
sel_set_rec_lock
(
page_rec_get_next
(
rec
),
index
,
node
->
row_lock_mode
,
LOCK_ORDINARY
,
thr
);
if
(
srv_locks_unsafe_for_binlog
)
{
err
=
sel_set_rec_lock
(
page_rec_get_next
(
rec
),
index
,
node
->
row_lock_mode
,
LOCK_REC_NOT_GAP
,
thr
);
}
else
{
err
=
sel_set_rec_lock
(
page_rec_get_next
(
rec
),
index
,
node
->
row_lock_mode
,
LOCK_ORDINARY
,
thr
);
}
if
(
err
!=
DB_SUCCESS
)
{
/* Note that in this case we will store in pcur
the PREDECESSOR of the record we are waiting
...
...
@@ -1250,13 +1253,10 @@ rec_loop:
not used.
*/
if
(
srv_locks_unsafe_for_binlog
)
{
if
(
srv_locks_unsafe_for_binlog
)
{
err
=
sel_set_rec_lock
(
rec
,
index
,
node
->
row_lock_mode
,
LOCK_REC_NOT_GAP
,
thr
);
}
else
{
}
else
{
err
=
sel_set_rec_lock
(
rec
,
index
,
node
->
row_lock_mode
,
LOCK_ORDINARY
,
thr
);
}
...
...
@@ -3209,8 +3209,7 @@ rec_loop:
we do not lock gaps. Supremum record is really
a gap and therefore we do not set locks there. */
if
(
srv_locks_unsafe_for_binlog
==
FALSE
)
{
if
(
srv_locks_unsafe_for_binlog
==
FALSE
)
{
err
=
sel_set_rec_lock
(
rec
,
index
,
prebuilt
->
select_lock_type
,
LOCK_ORDINARY
,
thr
);
...
...
@@ -3312,11 +3311,18 @@ rec_loop:
if
(
prebuilt
->
select_lock_type
!=
LOCK_NONE
&&
set_also_gap_locks
)
{
/* Try to place a lock on the index record */
/* Try to place a gap lock on the index
record only if innodb_locks_unsafe_for_binlog
option is not set */
if
(
srv_locks_unsafe_for_binlog
==
FALSE
)
{
err
=
sel_set_rec_lock
(
rec
,
index
,
prebuilt
->
select_lock_type
,
LOCK_GAP
,
thr
);
}
if
(
err
!=
DB_SUCCESS
)
{
goto
lock_wait_or_error
;
...
...
@@ -3338,11 +3344,18 @@ rec_loop:
if
(
prebuilt
->
select_lock_type
!=
LOCK_NONE
&&
set_also_gap_locks
)
{
/* Try to place a lock on the index record */
/* Try to place a gap lock on the index
record only if innodb_locks_unsafe_for_binlog
option is not set */
if
(
srv_locks_unsafe_for_binlog
==
FALSE
)
{
err
=
sel_set_rec_lock
(
rec
,
index
,
prebuilt
->
select_lock_type
,
LOCK_GAP
,
thr
);
}
if
(
err
!=
DB_SUCCESS
)
{
goto
lock_wait_or_error
;
...
...
@@ -3378,16 +3391,13 @@ rec_loop:
}
else
{
/* If innodb_locks_unsafe_for_binlog option is used,
we lock only the record, i.e. next-key locking is
not used.
*/
if
(
srv_locks_unsafe_for_binlog
)
{
not used. */
if
(
srv_locks_unsafe_for_binlog
)
{
err
=
sel_set_rec_lock
(
rec
,
index
,
prebuilt
->
select_lock_type
,
LOCK_REC_NOT_GAP
,
thr
);
}
else
{
}
else
{
err
=
sel_set_rec_lock
(
rec
,
index
,
prebuilt
->
select_lock_type
,
LOCK_ORDINARY
,
thr
);
...
...
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