diff options
author | Konstantin Osipov <kostja@sun.com> | 2009-12-01 18:20:43 +0300 |
---|---|---|
committer | Konstantin Osipov <kostja@sun.com> | 2009-12-01 18:20:43 +0300 |
commit | b474ad262bca9b53b7267bcf4f86c8a963c1d9d8 (patch) | |
tree | 861487d2be89b022dcce6bfc3f0fae919ee697e6 /sql/mdl.cc | |
parent | 78460958311d6e0cbcaf91af956891dbf6478fa4 (diff) | |
download | mariadb-git-b474ad262bca9b53b7267bcf4f86c8a963c1d9d8.tar.gz |
Backport of:
------------------------------------------------------------
revno: 2630.9.2
committer: Dmitry Lenev <dlenev@mysql.com>
branch nick: mysql-6.0-3726-w3
timestamp: Tue 2008-06-10 18:01:56 +0400
message:
WL#3726 "DDL locking for all metadata objects".
After review fixes in progress.
Diffstat (limited to 'sql/mdl.cc')
-rw-r--r-- | sql/mdl.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/mdl.cc b/sql/mdl.cc index dbf08101159..d3d067cfb9b 100644 --- a/sql/mdl.cc +++ b/sql/mdl.cc @@ -611,6 +611,7 @@ static bool can_grant_lock(MDL_LOCK *lock, MDL_LOCK_DATA *lock_data) This function must be called after the lock is added to a context. + @param context [in] Context containing request for lock @param lock_data [in] Lock request object for lock to be acquired @param retry [out] Indicates that conflicting lock exists and another attempt should be made after releasing all current @@ -622,16 +623,19 @@ static bool can_grant_lock(MDL_LOCK *lock, MDL_LOCK_DATA *lock_data) In the latter case "retry" parameter is set to TRUE. */ -bool mdl_acquire_shared_lock(MDL_LOCK_DATA *lock_data, bool *retry) +bool mdl_acquire_shared_lock(MDL_CONTEXT *context, MDL_LOCK_DATA *lock_data, + bool *retry) { MDL_LOCK *lock; *retry= FALSE; DBUG_ASSERT(is_shared(lock_data) && lock_data->state == MDL_PENDING); + DBUG_ASSERT(lock_data->ctx == context); + safe_mutex_assert_not_owner(&LOCK_open); - if (lock_data->ctx->has_global_shared_lock && + if (context->has_global_shared_lock && lock_data->type == MDL_SHARED_UPGRADABLE) { my_error(ER_CANT_UPDATE_WITH_READLOCK, MYF(0)); |