1
0
mirror of https://github.com/MariaDB/server.git synced 2025-05-28 13:01:41 +03:00
Jon Olav Hauglid 9ff272fbbd A 5.5 version of the fix for Bug #54360 "Deadlock DROP/ALTER/CREATE
DATABASE with open HANDLER"

Remove LOCK_create_db, database name locks, and use metadata locks instead.
This exposes CREATE/DROP/ALTER DATABASE statements to the graph-based
deadlock detector in MDL, and paves the way for a safe, deadlock-free
implementation of RENAME DATABASE.

Database DDL statements will now take exclusive metadata locks on
the database name, while table/view/routine DDL statements take
intention exclusive locks on the database name. This prevents race
conditions between database DDL and table/view/routine DDL.
(e.g. DROP DATABASE with concurrent CREATE/ALTER/DROP TABLE)

By adding database name locks, this patch implements
WL#4450 "DDL locking: CREATE/DROP DATABASE must use database locks" and
WL#4985 "DDL locking: namespace/hierarchical locks".

The patch also changes code to use init_one_table() where appropriate.
The new lock_table_names() function requires TABLE_LIST::db_length to
be set correctly, and this is taken care of by init_one_table().

This patch also adds a simple template to help work with 
the mysys HASH data structure.

Most of the patch was written by Konstantin Osipov.
2010-07-01 15:53:46 +02:00
..
2010-05-31 18:33:38 +05:00
2009-08-20 14:30:59 +02:00
2010-02-25 23:13:11 +04:00
2010-01-11 18:47:27 -07:00
2010-02-24 16:52:27 +03:00
2010-05-26 22:34:25 +08:00
2010-02-24 13:15:34 +04:00
2010-02-24 13:15:34 +04:00
2010-02-24 13:15:34 +04:00
2010-02-02 02:22:16 +03:00
2009-12-08 10:53:40 +03:00
2009-12-09 18:56:34 +03:00
2010-04-13 19:04:45 +04:00
2010-04-13 19:04:45 +04:00
2010-04-13 19:04:45 +04:00
2010-02-11 18:32:53 +01:00
2009-10-19 14:58:13 +02:00
2010-06-11 10:15:55 +02:00
2009-05-06 15:00:14 +05:30
2010-01-15 15:42:15 +04:00
2010-01-15 15:42:15 +04:00
2009-12-03 23:08:27 +03:00
2009-09-04 15:20:58 +02:00
2010-06-01 11:54:06 +04:00
2010-04-27 00:46:52 +04:00
2009-11-30 19:09:42 +03:00
2010-06-09 11:41:24 +03:00
2010-06-30 08:47:49 +02:00
2010-05-26 22:34:25 +08:00
2010-04-20 10:51:50 +02:00
2009-12-24 10:56:13 +03:00
2009-11-17 17:08:37 +01:00
2010-04-13 19:04:45 +04:00
2009-10-19 14:58:13 +02:00
2009-09-04 15:20:58 +02:00
2009-08-12 12:03:05 +02:00
2010-05-28 09:47:58 +04:00
2010-02-24 00:22:19 -07:00
2009-11-02 21:05:42 +01:00
2009-12-29 15:19:05 +03:00
2010-02-06 13:28:06 +03:00
2009-12-03 23:08:27 +03:00
2009-11-20 22:51:12 +03:00
2009-09-10 03:18:29 -06:00
2009-09-10 03:18:29 -06:00
2009-09-10 03:18:29 -06:00
2009-09-10 03:18:29 -06:00
2009-09-10 03:18:29 -06:00
2009-09-10 03:18:29 -06:00
2010-05-26 22:34:25 +08:00
2009-12-29 15:19:05 +03:00
2009-07-03 10:19:32 +02:00
2010-04-19 15:35:13 +02:00
2009-11-27 18:10:28 +02:00
2010-04-13 19:04:45 +04:00
2010-04-13 19:04:45 +04:00
2010-04-13 19:04:45 +04:00
2010-04-13 19:04:45 +04:00
2010-04-13 19:04:45 +04:00
2009-12-03 23:08:27 +03:00
2010-06-04 19:09:50 +03:00