List:Commits« Previous MessageNext Message »
From:Dmitry Lenev Date:January 25 2012 12:56pm
Subject:bzr push into mysql-trunk-wl5534 branch (Dmitry.Lenev:3465 to 3466) WL#5534
View as plain text  
 3466 Dmitry Lenev	2012-01-25
      WL#5534 Online ALTER, Phase 1.
      
      Patch #74: Updated outdated comment.

    modified:
      sql/mdl.cc
 3465 Dmitry Lenev	2012-01-24
      WL#5534 Online ALTER, Phase 1.
      
      Patch #73: Review changes:
        - Remove redundant call to handler::ha_create_handler_files().
        - Simplify is_candidate_key() helper by relying on
          HA_NULL_PART_KEY key flag.

    modified:
      sql/sql_table.cc
=== modified file 'sql/mdl.cc'
--- a/sql/mdl.cc	2012-01-20 03:54:02 +0000
+++ b/sql/mdl.cc	2012-01-25 12:55:32 +0000
@@ -1340,22 +1340,12 @@ void MDL_lock::reschedule_waiters()
   lock. Arrays of bitmaps which elements specify which granted/waiting locks
   are incompatible with type of lock being requested.
 
-  Here is how types of individual locks are translated to type of scoped lock:
-
-    --------------------+-------------+
-    Type of request     | Correspond. |
-    for indiv. lock     | scoped lock |
-    --------------------+-------------+
-    S, SH, SR, SW       |   IS        |
-    SU, SNW, SNRW, X    |   IX        |
-    SU, SNW, SNRW -> X  |   IX (*)    |
-
   The first array specifies if particular type of request can be satisfied
   if there is granted scoped lock of certain type.
 
              | Type of active   |
      Request |   scoped lock    |
-      type   | IS(**) IX   S  X |
+      type   | IS(*)  IX   S  X |
     ---------+------------------+
     IS       |  +      +   +  + |
     IX       |  +      +   -  - |
@@ -1368,7 +1358,7 @@ void MDL_lock::reschedule_waiters()
 
              |    Pending      |
      Request |  scoped lock    |
-      type   | IS(**) IX  S  X |
+      type   | IS(*)  IX  S  X |
     ---------+-----------------+
     IS       |  +      +  +  + |
     IX       |  +      +  -  - |
@@ -1378,11 +1368,20 @@ void MDL_lock::reschedule_waiters()
   Here: "+" -- means that request can be satisfied
         "-" -- means that request can't be satisfied and should wait
 
-  (*)   Since for upgradable locks we always take intention exclusive scoped
-        lock at the same time when obtaining the shared lock, there is no
-        need to obtain such lock during the upgrade itself.
-  (**)  Since intention shared scoped locks are compatible with all other
-        type of locks we don't even have any accounting for them.
+  (*)  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.
+  For example, in order to support global read lock implementation
+  SQL-layer acquires IX lock in GLOBAL namespace for each statement
+  that can modify metadata or data (i.e. for each statement that
+  needs SW, SU, SNW, SNRW or X object locks). OTOH, to ensure that
+  DROP DATABASE works correctly with concurrent DDL, IX metadata locks
+  in SCHEMA namespace are acquired for DDL statements which can update
+  metadata in the schema (i.e. which acquire SU, SNW, SNRW and X locks
+  on schema objects) and aren't acquired for DML.
 */
 
 const MDL_lock::bitmap_t MDL_scoped_lock::m_granted_incompatible[MDL_TYPE_END] =

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-wl5534 branch (Dmitry.Lenev:3465 to 3466) WL#5534Dmitry Lenev25 Jan