summaryrefslogtreecommitdiff
path: root/sql/sql_partition.cc
diff options
context:
space:
mode:
authorunknown <mikael@c-0409e253.1238-1-64736c10.cust.bredbandsbolaget.se>2006-06-12 17:37:32 -0400
committerunknown <mikael@c-0409e253.1238-1-64736c10.cust.bredbandsbolaget.se>2006-06-12 17:37:32 -0400
commit3166382d054656463cabae57b87e68b33f6c79c8 (patch)
tree04e8092ff5c2082f01160196adec325f4eca10ad /sql/sql_partition.cc
parent14c0751c30c4f495bddbd0aefe2787897b806fa5 (diff)
downloadmariadb-git-3166382d054656463cabae57b87e68b33f6c79c8.tar.gz
BUG#19122: Need to close handlers before drop/rename phase
Fixed comments sql/sql_partition.cc: Fixed comments
Diffstat (limited to 'sql/sql_partition.cc')
-rw-r--r--sql/sql_partition.cc26
1 files changed, 18 insertions, 8 deletions
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index 15e1c42bbf3..290a97309f1 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -5742,7 +5742,8 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
be no new threads accessing the table. They will be hanging on the
name lock.
5) Close all tables that have already been opened but didn't stumble on
- the abort locked previously.
+ the abort locked previously. This is done as part of the
+ get_name_lock call.
6) We are now ready to release all locks we got in this thread.
7) Write the bin log
Unfortunately the writing of the binlog is not synchronised with
@@ -5817,15 +5818,24 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
3) Lock all partitions in TL_WRITE_ONLY to ensure that no users
are still using the old partitioning scheme. Wait until all
ongoing users have completed before progressing.
- 4) Write binlog
- 5) Now the change is completed except for the installation of the
+ 4) Get a name lock on the table. This ensures that we can release all
+ locks on the table and since no one can open the table, there can
+ be no new threads accessing the table. They will be hanging on the
+ name lock.
+ 5) Close all tables that have already been opened but didn't stumble on
+ the abort locked previously. This is done as part of the
+ get_name_lock call.
+ 6) Close all table handlers and unlock all handlers but retain name lock
+ 7) Write binlog
+ 8) Now the change is completed except for the installation of the
new frm file. We thus write an action in the log to change to
the shadow frm file
- 6) Install the new frm file of the table where the partitions are
+ 9) Install the new frm file of the table where the partitions are
added to the table.
- 7) Wait until all accesses using the old frm file has completed
- 8) Remove entries from ddl log
- 9) Complete query
+ 10)Wait until all accesses using the old frm file has completed
+ 11)Remove entries from ddl log
+ 12)Release name lock
+ 13)Complete query
*/
if (write_log_add_change_partition(lpt) ||
ERROR_INJECT_CRASH("crash_add_partition_1") ||
@@ -5905,7 +5915,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
7) Close all tables opened but not yet locked, after this call we are
certain that no other thread is in the lock wait queue or has
opened the table. The name lock will ensure that they are blocked
- on the open call.
+ on the open call. This is achieved also by get_name_lock call.
8) Close all partitions opened by this thread, but retain name lock.
9) Write bin log
10) Prepare handlers for rename and delete of partitions