Jon Olav Hauglid
7fd30bf610
Bug #51240 ALTER TABLE of a locked MERGE table fails
...
The problem was that ALTER TABLE on a merge table which was locked
using LOCK TABLE ... WRITE, by mistake gave
ER_TABLE_NOT_LOCKED_FOR_WRITE.
During opening of the table to be ALTERed, open_table() tried to
get an upgradable metadata lock. In LOCK TABLEs mode, this lock
must already exist (i.e. taken by LOCK TABLE) as new locks of this
type cannot be acquired for fear of deadlock. So in LOCK TABLEs
mode, open_table() tried to find an existing upgradable lock for
the table to be altered.
The problem was that open_table() also tried to find upgradable
metadata locks for children of merge tables even if no such
locks are needed to execute ALTER TABLE on merge tables.
This patch fixes the problem by making sure that open tables code
only searches for upgradable metadata locks for the merge table
and not for the merge children tables.
The patch also fixes a related bug where an upgradable metadata
lock was aquired outside of LOCK TABLEs mode even if the table in
question was temporary. This bug meant that LOCK TABLES or DDL on
temporary tables by mistake could be blocked/aborted by locks held
on base tables with the same table name by other connections.
Test cases added to merge.test and lock_multi.test.
2010-02-26 13:40:25 +01:00
..
2009-11-10 18:43:43 -02:00
2009-08-25 15:56:50 +02:00
2010-02-11 18:02:41 +01:00
2009-10-30 11:40:44 +02:00
2010-01-12 20:07:09 +08:00
2009-08-20 14:30:59 +02:00
2010-01-11 18:47:27 -07:00
2010-02-03 19:21:17 +03:00
2009-09-18 16:01:18 +03:00
2009-09-18 16:01:18 +03:00
2010-02-17 10:18:17 +01:00
2009-11-30 10:54:26 +05:30
2009-12-22 19:23:13 +03:00
2009-12-22 10:35:56 +01:00
2010-02-20 13:07:32 +03:00
2010-02-20 13:07:32 +03:00
2010-02-20 13:07:32 +03:00
2010-02-20 13:07:32 +03:00
2009-11-03 19:02:56 +00:00
2010-01-22 19:00:19 -07:00
2009-06-08 20:03:01 -03:00
2009-12-22 13:52:23 +04:00
2010-02-06 13:28:06 +03:00
2009-12-03 17:18:43 +05:30
2010-01-14 15:17:57 +04:00
2009-11-06 11:49:27 +01:00
2010-02-15 09:57:24 +04:00
2009-11-09 14:53:49 +04:00
2009-10-15 17:23:43 +05:00
2010-02-15 09:57:24 +04:00
2010-01-14 15:17:57 +04:00
2010-01-14 15:17:57 +04:00
2009-09-07 13:42:54 +08:00
2010-01-14 15:17:57 +04:00
2010-02-17 10:18:17 +01:00
2009-12-15 23:20:53 +03:00
2010-02-15 09:57:24 +04:00
2010-02-17 10:18:17 +01:00
2009-12-14 16:11:47 +01:00
2010-02-15 09:57:24 +04:00
2009-12-16 21:02:21 +03:00
2009-12-22 10:35:56 +01:00
2009-12-22 10:35:56 +01:00
2009-12-22 10:35:56 +01:00
2010-02-01 14:43:06 +03:00
2010-02-02 02:22:16 +03:00
2010-01-31 01:06:50 +03:00
2009-11-04 12:28:20 +00:00
2009-11-10 16:48:46 -02:00
2009-11-13 10:56:38 -02:00
2010-02-06 13:28:06 +03:00
2009-09-06 00:42:17 +04:00
2009-12-08 10:53:40 +03:00
2009-10-09 18:52:49 +04:00
2010-01-12 16:15:21 +01:00
2009-12-22 10:35:56 +01:00
2009-12-22 10:35:56 +01:00
2009-12-22 10:35:56 +01:00
2009-08-27 15:17:09 +02:00
2010-01-06 15:00:51 +01:00
2009-11-06 17:20:27 +03:00
2009-12-05 02:02:48 +03:00
2009-12-09 18:56:34 +03:00
2009-10-20 11:00:07 -07:00
2009-11-30 18:55:03 +03:00
2010-02-15 14:23:36 +03:00
2010-01-25 04:55:31 -07:00
2009-12-22 17:52:15 +02:00
2009-11-09 12:32:48 +01:00
2010-02-03 23:15:57 +03:00
2009-06-19 11:27:19 +02:00
2010-01-13 08:16:36 +04:00
2009-09-10 03:18:29 -06:00
2009-11-24 18:26:13 +03:00
2009-10-05 10:27:36 +05:00
2009-11-03 17:54:41 +04:00
2009-10-13 12:31:42 +04:00
2009-06-16 16:36:15 +02:00
2009-12-11 19:40:58 +03:00
2010-02-17 10:18:17 +01:00
2009-10-23 23:37:57 +05:00
2010-02-11 18:32:53 +01:00
2009-10-29 22:06:10 -07:00
2009-10-20 11:47:57 +05:30
2009-10-19 14:58:13 +02:00
2009-10-27 12:09:19 +04:00
2009-10-22 16:51:51 +04:00
2009-11-20 22:51:12 +03:00
2010-02-12 11:51:52 +03:00
2009-08-21 10:55:35 +05:00
2010-02-26 10:58:33 +01:00
2009-10-07 19:37:36 +04:00
2009-12-22 10:35:56 +01:00
2009-10-23 15:22:21 +04:00
2010-01-15 15:42:15 +04:00
2010-01-15 15:42:15 +04:00
2009-10-05 16:22:48 +02:00
2010-02-06 13:28:06 +03:00
2009-07-06 18:20:17 -04:00
2009-07-10 17:05:53 +05:30
2009-12-02 19:30:50 +05:30
2009-11-05 18:06:28 +04:00
2009-06-25 15:20:26 +05:30
2009-12-02 19:30:50 +05:30
2009-12-22 10:35:56 +01:00
2009-12-22 10:35:56 +01:00
2009-12-02 19:30:50 +05:30
2009-10-16 17:28:02 +05:30
2009-06-22 16:58:00 +05:30
2009-11-25 15:29:25 +05:30
2009-11-25 15:08:52 +05:30
2009-10-28 17:49:56 +03:00
2009-11-12 12:43:33 +01:00
2009-12-08 14:27:33 +01:00
2010-02-01 14:43:06 +03:00
2009-12-09 09:32:29 +01:00
2010-02-17 11:24:53 +01:00
2009-07-30 16:31:45 +02:00
2010-01-22 14:02:17 +04:00
2009-10-16 17:28:02 +05:30
2009-10-16 17:28:02 +05:30
2010-02-01 14:43:06 +03:00
2009-12-02 19:30:50 +05:30
2009-12-02 19:30:50 +05:30
2010-02-02 02:22:16 +03:00
2009-12-03 23:08:27 +03:00
2009-09-04 15:20:58 +02:00
2009-12-22 19:23:13 +03:00
2009-11-23 17:38:42 +01:00
2010-01-29 11:48:11 +01:00
2009-11-23 17:38:42 +01:00
2010-01-29 11:48:11 +01:00
2009-10-19 15:14:43 +02:00
2009-12-17 10:55:18 +01:00
2009-10-30 10:03:18 +02:00
2009-12-22 10:35:56 +01:00
2009-11-30 19:09:42 +03:00
2010-01-05 22:36:08 +01:00
2009-11-06 12:52:45 +03:00
2009-08-28 18:49:16 -03:00
2009-08-28 18:49:16 -03:00
2010-02-26 13:40:25 +01:00
2010-02-11 19:10:34 +03:00
2010-02-01 14:43:06 +03:00
2009-10-12 15:35:30 +02:00
2009-10-12 15:35:30 +02:00
2009-10-15 11:09:31 +02:00
2009-06-15 20:27:27 -03:00
2009-08-27 15:17:09 +02:00
2009-11-24 12:08:04 +01:00
2009-10-27 14:09:36 +04:00
2009-09-09 14:38:50 +05:00
2009-09-09 14:38:50 +05:00
2009-09-09 14:38:50 +05:00
2009-12-10 12:46:16 +01:00
2009-08-28 16:13:27 +02:00
2010-02-10 18:46:03 +03:00
2009-12-08 16:57:25 +03:00
2009-12-08 16:57:25 +03:00
2009-12-03 02:09:22 +03:00
2010-02-26 13:40:25 +01:00
2009-09-30 12:25:50 +02:00
2009-06-08 19:18:31 -03:00
2010-02-01 14:43:06 +03:00
2009-11-25 16:25:01 +04:00
2009-09-17 16:33:23 +05:00
2009-12-17 22:16:54 +03:00
2009-11-26 13:47:55 +01:00
2009-12-22 10:35:56 +01:00
2009-12-11 19:40:58 +03:00
2009-12-22 10:35:56 +01:00
2009-06-17 20:10:48 +04:00
2009-12-24 10:56:13 +03:00
2009-10-21 17:59:47 +05:00
2009-11-03 19:02:56 +00:00
2009-09-07 13:42:54 +08:00
2010-02-17 10:18:17 +01:00
2009-10-21 17:59:47 +05:00
2010-01-11 18:47:27 -07:00
2010-01-11 18:47:27 -07:00
2010-01-12 20:07:09 +08:00
2009-08-07 22:04:53 +02:00
2010-02-09 18:13:57 +01:00
2009-11-10 17:36:38 -02:00
2009-12-05 02:02:48 +03:00
2009-11-17 17:08:37 +01:00
2009-11-03 17:54:41 +04:00
2009-11-06 09:44:01 +03:00
2010-01-29 16:54:27 +02:00
2010-01-06 11:54:45 +01:00
2010-01-06 11:54:45 +01:00
2010-01-06 11:54:45 +01:00
2010-01-06 11:54:45 +01:00
2009-12-10 17:38:01 +02:00
2009-07-31 22:14:52 +05:00
2009-10-19 14:58:13 +02:00
2009-06-19 11:27:19 +02:00
2009-12-22 19:23:13 +03:00
2009-08-11 14:18:26 +02:00
2009-12-13 23:29:50 +03:00
2009-10-29 18:04:23 +01:00
2009-12-21 11:38:31 +01:00
2009-09-04 15:20:58 +02:00
2009-10-28 01:11:17 +01:00
2009-08-12 12:03:05 +02:00
2009-12-16 16:47:07 +03:00
2009-12-02 19:30:50 +05:30
2010-02-16 18:23:21 +01:00
2009-07-14 21:31:19 +02:00
2010-02-06 13:28:06 +03:00
2009-12-22 10:35:56 +01:00
2009-10-21 20:04:34 +02:00
2009-09-15 17:07:52 +02:00
2009-07-27 16:50:43 +05:30
2009-10-08 15:36:43 +02:00
2009-10-09 16:12:01 +02:00
2010-01-27 22:55:51 +03:00
2009-12-17 18:39:10 +01:00
2009-07-27 16:50:43 +05:30
2009-12-10 14:41:41 +01:00
2009-09-10 11:15:39 +02:00
2009-11-02 14:49:26 +01:00
2010-02-02 12:22:17 +03:00
2010-02-24 00:22:19 -07:00
2009-06-10 10:59:49 +02:00
2009-10-08 10:39:15 +02:00
2009-11-02 21:05:42 +01:00
2009-12-22 10:35:56 +01:00
2009-11-04 12:28:20 +00:00
2009-12-29 15:19:05 +03:00
2010-02-06 13:28:06 +03:00
2009-11-10 20:45:15 +02:00
2010-02-17 10:18:17 +01:00
2010-02-06 13:28:06 +03:00
2009-12-03 23:08:27 +03:00
2009-06-17 16:28:11 +02:00
2009-10-29 12:19:36 +01:00
2009-10-29 12:19:36 +01:00
2009-11-20 22:51:12 +03:00
2010-02-26 10:58:33 +01:00
2009-11-25 11:02:25 +01:00
2009-12-09 18:56:34 +03:00
2010-02-03 08:32:38 +03:00
2009-11-04 14:31:03 +01:00
2010-01-12 16:15:21 +01:00
2009-12-22 10:35:56 +01:00
2010-01-31 01:06:50 +03:00
2009-11-10 17:36:38 -02:00
2010-02-17 10:18:17 +01:00
2009-12-22 10:35:56 +01:00
2010-02-05 17:31:34 +01: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
2009-11-25 13:53:23 +03:00
2009-12-03 23:08:27 +03:00
2010-02-06 13:28:06 +03:00
2009-09-29 14:16:23 +03:00
2010-01-07 15:39:11 +00:00
2009-10-26 11:55:57 +02:00
2009-11-21 09:18:21 -02:00
2009-12-29 15:19:05 +03:00
2009-07-03 10:19:32 +02:00
2009-12-30 20:53:30 +03:00
2009-10-29 10:51:04 -06:00
2009-11-27 18:10:28 +02:00
2009-12-16 21:02:21 +03:00
2009-10-09 15:34:07 +02:00
2010-02-06 13:28:06 +03:00
2009-10-09 16:52:02 +02:00
2009-08-27 15:17:09 +02:00
2009-12-03 23:08:27 +03:00
2010-02-20 13:07:32 +03:00
2010-01-04 10:39:42 +01:00
2009-09-18 12:34:08 +03:00
2010-01-28 00:32:29 +03:00
2009-11-04 12:28:20 +00:00
2009-11-04 12:28:20 +00:00
2009-11-04 12:28:20 +00:00
2009-11-30 18:55:03 +03:00
2009-12-09 12:37:54 +03:00
2010-02-01 14:43:06 +03:00
2009-12-11 15:24:23 +03:00
2009-10-08 16:36:36 +01:00
2009-12-02 18:50:14 +03:00
2009-10-13 21:50:08 +05:00
2009-12-22 19:23:13 +03:00
2009-12-22 19:23:13 +03:00
2009-12-22 19:23:13 +03:00
2009-11-04 11:28:50 +01:00
2009-11-11 02:02:23 +00:00
2009-10-09 15:34:07 +02:00
2009-12-15 10:37:10 +02:00
2010-02-23 11:43:26 -07:00
2010-02-17 10:18:17 +01:00
2010-01-19 19:36:14 +03:00
2009-10-23 15:09:14 +02:00
2009-08-25 15:56:50 +02:00
2009-12-22 10:35:56 +01:00
2010-01-19 19:36:14 +03:00
2010-02-11 14:33:21 +01:00
2010-02-20 12:40:21 +03:00
2009-11-30 18:55:03 +03:00
2010-02-18 14:54:38 +01:00
2009-11-13 10:17:53 +00:00
2009-09-22 08:22:07 -03:00
2009-12-05 02:02:48 +03:00