summaryrefslogtreecommitdiff
path: root/sql/mdl.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2018-10-09 19:08:16 +0300
committerMonty <monty@mariadb.org>2018-12-09 20:49:05 +0200
commitae58cd6b87bf1f872093816691ebdd46bef50c7f (patch)
tree02fc330a4d1296fce819b7345eb5ef6cbc3061dd /sql/mdl.cc
parent9207a838ededa0d5f40129848de20a2075ab0e44 (diff)
downloadmariadb-git-ae58cd6b87bf1f872093816691ebdd46bef50c7f.tar.gz
Simple cleanups (no logic changes)
Diffstat (limited to 'sql/mdl.cc')
-rw-r--r--sql/mdl.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/sql/mdl.cc b/sql/mdl.cc
index f03fc89fcc1..0778c3e7bd1 100644
--- a/sql/mdl.cc
+++ b/sql/mdl.cc
@@ -1368,17 +1368,23 @@ void MDL_lock::reschedule_waiters()
/**
Compatibility (or rather "incompatibility") matrices for scoped metadata
- lock. Arrays of bitmaps which elements specify which granted/waiting locks
+ lock.
+ Scoped locks are GLOBAL READ LOCK, COMMIT and database (or schema) locks.
+ Arrays of bitmaps which elements specify which granted/waiting locks
are incompatible with type of lock being requested.
The first array specifies if particular type of request can be satisfied
if there is granted scoped lock of certain type.
+ (*) Since intention shared scoped locks (IS) are compatible with all other
+ type of locks, they don't need to be implemented and there is no code
+ for them.
+
| Type of active |
Request | scoped lock |
type | IS(*) IX S X |
---------+------------------+
- IS | + + + + |
+ IS(*) | + + + + |
IX | + + - - |
S | + - + - |
X | + - - - |
@@ -1391,7 +1397,7 @@ void MDL_lock::reschedule_waiters()
Request | scoped lock |
type | IS(*) IX S X |
---------+-----------------+
- IS | + + + + |
+ IS(*) | + + + + |
IX | + + - - |
S | + + + - |
X | + + + + |
@@ -1399,9 +1405,6 @@ void MDL_lock::reschedule_waiters()
Here: "+" -- means that request can be satisfied
"-" -- means that request can't be satisfied and should wait
- (*) Since intention shared scoped locks are compatible with all other
- type of locks we don't even have any accounting for them.
-
Note that relation between scoped locks and objects locks requested
by statement is not straightforward and is therefore fully defined
by SQL-layer.