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
7b076f83
Commit
7b076f83
authored
Dec 10, 2004
by
marko@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Plain Diff
Merge marko@bk-internal.mysql.com:/home/bk/mysql-5.0
into hundin.mysql.fi:/home/marko/j/mysql-5.0
parents
be11a7d9
9dc1f514
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
6 deletions
+71
-6
innobase/include/lock0lock.h
innobase/include/lock0lock.h
+27
-0
innobase/lock/lock0lock.c
innobase/lock/lock0lock.c
+42
-0
innobase/row/row0ins.c
innobase/row/row0ins.c
+2
-6
No files found.
innobase/include/lock0lock.h
View file @
7b076f83
...
@@ -345,6 +345,33 @@ lock_clust_rec_read_check_and_lock(
...
@@ -345,6 +345,33 @@ lock_clust_rec_read_check_and_lock(
LOCK_REC_NOT_GAP */
LOCK_REC_NOT_GAP */
que_thr_t
*
thr
);
/* in: query thread */
que_thr_t
*
thr
);
/* in: query thread */
/*************************************************************************
/*************************************************************************
Checks if locks of other transactions prevent an immediate read, or passing
over by a read cursor, of a clustered index record. If they do, first tests
if the query thread should anyway be suspended for some reason; if not, then
puts the transaction and the query thread to the lock wait state and inserts a
waiting request for a record lock to the lock queue. Sets the requested mode
lock on the record. This is an alternative version of
lock_clust_rec_read_check_and_lock() that does not require the parameter
"offsets". */
ulint
lock_clust_rec_read_check_and_lock_alt
(
/*===================================*/
/* out: DB_SUCCESS, DB_LOCK_WAIT,
DB_DEADLOCK, or DB_QUE_THR_SUSPENDED */
ulint
flags
,
/* in: if BTR_NO_LOCKING_FLAG bit is set,
does nothing */
rec_t
*
rec
,
/* in: user record or page supremum record
which should be read or passed over by a read
cursor */
dict_index_t
*
index
,
/* in: clustered index */
ulint
mode
,
/* in: mode of the lock which the read cursor
should set on records: LOCK_S or LOCK_X; the
latter is possible in SELECT FOR UPDATE */
ulint
gap_mode
,
/* in: LOCK_ORDINARY, LOCK_GAP, or
LOCK_REC_NOT_GAP */
que_thr_t
*
thr
);
/* in: query thread */
/*************************************************************************
Checks that a record is seen in a consistent read. */
Checks that a record is seen in a consistent read. */
ibool
ibool
...
...
innobase/lock/lock0lock.c
View file @
7b076f83
...
@@ -5105,3 +5105,45 @@ lock_clust_rec_read_check_and_lock(
...
@@ -5105,3 +5105,45 @@ lock_clust_rec_read_check_and_lock(
return
(
err
);
return
(
err
);
}
}
/*************************************************************************
Checks if locks of other transactions prevent an immediate read, or passing
over by a read cursor, of a clustered index record. If they do, first tests
if the query thread should anyway be suspended for some reason; if not, then
puts the transaction and the query thread to the lock wait state and inserts a
waiting request for a record lock to the lock queue. Sets the requested mode
lock on the record. This is an alternative version of
lock_clust_rec_read_check_and_lock() that does not require the parameter
"offsets". */
ulint
lock_clust_rec_read_check_and_lock_alt
(
/*===================================*/
/* out: DB_SUCCESS, DB_LOCK_WAIT,
DB_DEADLOCK, or DB_QUE_THR_SUSPENDED */
ulint
flags
,
/* in: if BTR_NO_LOCKING_FLAG bit is set,
does nothing */
rec_t
*
rec
,
/* in: user record or page supremum record
which should be read or passed over by a read
cursor */
dict_index_t
*
index
,
/* in: clustered index */
ulint
mode
,
/* in: mode of the lock which the read cursor
should set on records: LOCK_S or LOCK_X; the
latter is possible in SELECT FOR UPDATE */
ulint
gap_mode
,
/* in: LOCK_ORDINARY, LOCK_GAP, or
LOCK_REC_NOT_GAP */
que_thr_t
*
thr
)
/* in: query thread */
{
mem_heap_t
*
tmp_heap
=
NULL
;
ulint
offsets_
[
100
]
=
{
100
,
};
ulint
*
offsets
=
offsets_
;
ulint
ret
;
offsets
=
rec_get_offsets
(
rec
,
index
,
offsets
,
ULINT_UNDEFINED
,
&
tmp_heap
);
ret
=
lock_clust_rec_read_check_and_lock
(
flags
,
rec
,
index
,
offsets
,
mode
,
gap_mode
,
thr
);
if
(
tmp_heap
)
{
mem_heap_free
(
tmp_heap
);
}
return
(
ret
);
}
innobase/row/row0ins.c
View file @
7b076f83
...
@@ -717,8 +717,6 @@ row_ins_foreign_check_on_constraint(
...
@@ -717,8 +717,6 @@ row_ins_foreign_check_on_constraint(
ulint
i
;
ulint
i
;
trx_t
*
trx
;
trx_t
*
trx
;
mem_heap_t
*
tmp_heap
=
NULL
;
mem_heap_t
*
tmp_heap
=
NULL
;
ulint
offsets_
[
100
]
=
{
100
,
};
ulint
*
offsets
=
offsets_
;
ut_a
(
thr
&&
foreign
&&
pcur
&&
mtr
);
ut_a
(
thr
&&
foreign
&&
pcur
&&
mtr
);
...
@@ -886,10 +884,8 @@ row_ins_foreign_check_on_constraint(
...
@@ -886,10 +884,8 @@ row_ins_foreign_check_on_constraint(
we already have a normal shared lock on the appropriate
we already have a normal shared lock on the appropriate
gap if the search criterion was not unique */
gap if the search criterion was not unique */
offsets
=
rec_get_offsets
(
clust_rec
,
clust_index
,
offsets
,
err
=
lock_clust_rec_read_check_and_lock_alt
(
0
,
clust_rec
,
ULINT_UNDEFINED
,
&
tmp_heap
);
clust_index
,
LOCK_X
,
LOCK_REC_NOT_GAP
,
thr
);
err
=
lock_clust_rec_read_check_and_lock
(
0
,
clust_rec
,
clust_index
,
offsets
,
LOCK_X
,
LOCK_REC_NOT_GAP
,
thr
);
}
}
if
(
err
!=
DB_SUCCESS
)
{
if
(
err
!=
DB_SUCCESS
)
{
...
...
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