Sergey Vojtovich
a8ee6e48f7
BUG#11763712 - 56458: KILLING A FLUSH TABLE FOR A MERGE/CHILD
...
CRASHES SERVER
Flushing of MERGE table or one of its child tables, which was
locked by flushing thread using LOCK TABLES, might have caused
crashes or assertion failures if the thread failed to reopen
child or parent table.
Particularly, this might have happened when another connection
killed this FLUSH TABLE statement/connection.
Also this problem might have occurred when we failed to reopen
MERGE table or one of its children when executing DDL statement
under LOCK TABLES.
The problem was caused by the fact that reopen_tables() might
have failed to reopen child table but still tried to reopen,
reattach children for and re-lock its parent. Vice versa it
might have failed to reopen parent but kept references from
children to parent around. Since reopen_tables() closes table
it has failed to reopen and therefore frees all associated
memory such dangling references led to crashes when followed.
This patch solves this problem by ensuring that we always close
parent table and all its children if we fail to reopen this
table or one of its children. Same happens if we fail to reattach
children to parent.
Affects 5.1 only.
mysql-test/r/merge.result:
A test case for BUG#11763712.
mysql-test/t/merge.test:
A test case for BUG#11763712.
sql/sql_base.cc:
When flushing tables under LOCK TABLES, all locked
and flushed tables are released and then reopened.
It may happen that we failed to reopen some tables,
in this case we reopen as much tables as possible.
If it was not possible to reopen MERGE child, MERGE
parent is unusable and must be removed from thread
open tables list.
If it was not possible to reopen MERGE parent, all
MERGE child table objects are unusable as well, at
least because their locks are handled by MERGE parent.
They must also be removed from thread open tables
list.
In other words if it was impossible to reopen any
object of a MERGE table or reattach child tables,
all objects of this MERGE table must be considered
unusable and closed.
2011-08-18 10:38:51 +04:00
..
2009-08-25 15:56:50 +02:00
2010-05-24 21:54:08 +08:00
2009-12-18 14:00:30 +02:00
2011-04-14 12:11:57 +04:00
2009-02-10 16:27:35 +03:00
2010-03-25 23:57:06 +04:00
2011-01-04 14:36:37 +01:00
2010-02-09 11:30:50 +01:00
2010-02-25 23:13:11 +04:00
2010-05-28 00:07:40 +04:00
2010-02-02 14:17:21 +02:00
2010-04-22 15:52:00 +02:00
2009-09-18 16:01:18 +03:00
2009-11-25 12:25:49 +05:30
2009-01-31 15:55:06 -02:00
2009-10-27 12:09:19 +04:00
2009-05-21 13:06:43 +05:00
2010-11-25 03:11:05 +00:00
2009-02-05 21:47:23 +01:00
2011-01-14 19:50:34 +05:30
2011-01-28 12:09:15 +00:00
2010-03-09 07:36:26 -03:00
2009-05-15 12:15:56 +02:00
2009-05-15 12:15:56 +02:00
2010-11-11 07:34:14 +00:00
2009-05-11 20:54:00 -03:00
2009-04-16 13:47:44 -04:00
2009-12-22 13:52:23 +04:00
2010-05-24 21:54:08 +08:00
2010-01-16 15:44:24 +08:00
2011-01-25 12:14:28 +05:30
2010-03-09 16:09:32 +01:00
2009-03-19 13:26:12 +04:00
2009-05-31 13:44:41 +08:00
2011-03-30 14:33:53 +02:00
2011-02-17 12:43:53 +01:00
2011-02-17 12:43:53 +01:00
2011-02-17 12:43:53 +01:00
2009-07-24 11:27:23 +05:00
2009-09-07 13:42:54 +08:00
2010-11-18 11:53:08 +03:00
2010-03-22 16:27:59 +04:00
2011-01-17 15:11:33 +03:00
2009-08-10 15:46:20 -03:00
2011-03-03 18:39:26 +03:00
2011-03-03 18:39:26 +03:00
2010-11-11 13:25:23 +03:00
2010-10-12 23:25:40 +04:00
2010-11-12 13:12:15 +03:00
2011-02-22 19:28:50 +05:30
2011-02-22 19:28:50 +05:30
2009-09-29 17:38:40 +02:00
2010-02-17 16:13:42 +04:00
2009-11-18 13:49:45 +01:00
2010-08-31 02:16:38 +04:00
2010-12-14 12:33:03 +03:00
2009-03-03 21:34:18 +01:00
2009-09-06 00:42:17 +04:00
2010-06-24 15:21:23 +02:00
2011-05-04 16:59:24 +04:00
2011-03-28 21:01:37 +05:30
2011-05-04 16:59:24 +04:00
2010-05-19 11:18:59 +02:00
2009-05-15 12:15:56 +02:00
2010-10-18 16:12:27 +04:00
2010-05-24 21:54:08 +08:00
2009-03-03 21:34:18 +01:00
2009-03-03 21:34:18 +01:00
2009-12-22 17:52:15 +02:00
2010-10-18 14:47:26 +04:00
2009-06-19 11:27:19 +02:00
2010-04-03 00:30:22 +04:00
2009-06-01 16:00:38 +04:00
2009-04-17 18:52:57 +03:00
2011-03-03 15:04:04 +03:00
2009-04-27 15:05:01 +05:00
2010-12-14 23:52:53 +03:00
2011-04-12 14:01:33 +04:00
2011-04-12 13:51:36 +04:00
2010-06-08 10:22:40 +04:00
2011-01-17 12:30:22 +03:00
2011-04-20 11:39:20 +04:00
2010-11-24 23:03:16 +03:00
2010-08-13 16:05:46 +03:00
2009-06-16 16:36:15 +02:00
2011-01-13 08:57:15 +01:00
2011-04-27 11:35:57 +04:00
2010-03-25 15:49:01 +04:00
2011-02-15 14:03:05 +03:00
2009-10-29 22:06:10 -07:00
2010-10-18 21:03:53 +07:00
2009-05-15 12:15:56 +02:00
2009-05-15 12:15:56 +02:00
2009-10-27 12:09:19 +04:00
2011-02-07 15:06:22 +03:00
2009-01-16 12:45:17 +02:00
2011-02-18 11:50:06 +01:00
2010-06-11 09:38:29 +02:00
2009-04-17 13:46:27 +05:00
2010-06-09 14:45:04 +04:00
2009-05-05 17:03:23 -04:00
2009-09-29 17:38:40 +02:00
2009-02-03 14:45:17 +01:00
2011-04-22 11:20:55 +04:00
2009-05-06 15:00:14 +05:30
2010-10-07 10:13:11 +02:00
2010-10-07 10:13:11 +02:00
2010-11-29 18:51:46 -06:00
2010-11-29 18:51:46 -06:00
2010-12-19 18:07:28 +01:00
2009-02-09 19:03:52 +04:00
2010-05-28 00:07:40 +04:00
2011-02-16 21:43:12 +01:00
2009-04-28 20:12:18 +02:00
2010-08-09 13:39:59 +02:00
2010-10-29 12:23:06 +04:00
2010-11-23 00:29:47 +03:00
2010-11-25 03:11:05 +00:00
2011-04-15 12:51:34 +04:00
2009-10-19 13:44:44 +05:00
2009-08-28 18:49:16 -03:00
2009-08-28 18:49:16 -03:00
2009-04-03 16:46:00 -03:00
2011-03-29 10:09:05 +02:00
2009-02-02 22:20:25 +01:00
2009-03-05 15:22:33 +01:00
2010-05-12 13:19:12 +02:00
2009-06-15 20:27:27 -03:00
2010-02-26 09:22:48 -03:00
2010-11-07 23:42:54 +06:00
2009-10-27 12:09:19 +04:00
2009-09-09 14:38:50 +05:00
2011-04-04 16:04:15 +03:00
2009-08-28 16:13:27 +02:00
2010-10-19 12:27:09 +02:00
2009-02-18 16:09:46 +04:00
2010-06-25 15:59:44 +03:00
2011-08-18 10:38:51 +04:00
2010-03-12 10:33:16 +04:00
2010-12-14 12:33:03 +03:00
2009-10-14 16:26:16 +05:00
2009-04-30 16:33:44 +05:30
2010-03-25 16:11:16 +04:00
2009-04-07 17:06:15 +05:30
2010-07-30 09:17:10 -03:00
2010-07-01 12:05:09 +03:00
2009-03-25 10:32:01 +03:00
2009-06-10 11:24:47 +04:00
2010-12-01 12:25:31 +05:30
2011-01-16 02:04:08 +05:30
2011-01-12 19:32:45 +00:00
2010-03-22 13:10:18 +01:00
2009-08-27 10:32:27 +01:00
2009-09-07 13:42:54 +08:00
2011-03-25 15:16:13 +01:00
2009-05-20 18:31:10 -07:00
2010-12-19 18:07:28 +01:00
2009-02-19 18:22:28 +01:00
2011-03-17 16:28:16 +05:30
2010-06-03 10:31:26 +02:00
2010-06-03 10:31:26 +02:00
2011-04-08 12:22:44 +05:30
2011-01-11 15:00:21 +01:00
2010-02-05 17:51:55 +00:00
2011-02-04 10:47:46 +06:00
2009-09-25 11:26:49 +02:00
2009-02-05 13:49:32 +04:00
2009-11-06 17:54:19 +03:00
2010-01-29 16:54:27 +02:00
2011-03-30 14:33:53 +02:00
2010-05-07 00:41:37 +04:00
2009-02-03 14:45:17 +01:00
2011-03-25 12:57:27 +02:00
2009-05-20 17:04:44 -07:00
2009-04-17 16:00:53 -04:00
2010-10-01 13:39:04 +02:00
2009-12-13 23:29:50 +03:00
2009-09-03 08:38:06 +02:00
2010-02-01 16:07:00 +01:00
2011-01-26 16:50:21 +01:00
2010-08-27 10:43:51 +02:00
2009-09-25 11:26:49 +02:00
2010-10-05 14:57:51 +02:00
2010-10-15 20:13:35 +05:00
2009-02-18 21:10:19 +01:00
2009-04-17 16:00:53 -04:00
2011-04-27 17:51:06 +02:00
2010-07-08 14:36:55 +02:00
2009-10-08 15:36:43 +02:00
2010-08-26 17:14:18 +02:00
2010-08-27 10:43:51 +02:00
2009-07-27 16:50:43 +05:30
2011-01-24 13:41:44 +01:00
2010-12-01 13:54:50 +01:00
2009-02-27 16:11:15 +02:00
2009-04-01 10:58:55 +02:00
2010-08-16 16:43:21 +03:00
2010-08-16 16:43:21 +03:00
2010-08-16 16:43:21 +03:00
2010-08-16 16:43:21 +03:00
2010-01-16 15:44:24 +08:00
2009-10-27 14:09:36 +04:00
2010-10-04 12:51:26 +04:00
2009-06-17 16:28:11 +02:00
2009-02-13 17:26:20 -02:00
2010-03-24 17:37:41 +01:00
2009-11-03 17:18:43 +01:00
2011-02-01 13:20:16 +01:00
2009-03-06 15:56:17 +01:00
2010-05-21 22:47:32 +04:00
2009-04-14 19:19:15 +05:00
2010-09-09 16:46:13 +04:00
2010-06-26 19:36:00 +02:00
2010-06-24 12:00:48 +04:00
2011-03-28 13:32:25 +03:00
2011-03-30 14:33:53 +02:00
2010-03-31 16:12:37 +03:00
2010-02-05 13:39:46 +04:00
2010-01-12 15:16:26 +01:00
2010-05-24 21:54:08 +08:00
2010-02-09 11:30:50 +01:00
2010-11-11 10:52:51 +06:00
2011-03-30 14:33:53 +02:00
2010-02-09 11:30:50 +01:00
2009-07-03 10:19:32 +02:00
2009-11-27 18:10:28 +02:00
2009-12-02 15:17:08 +04:00
2010-02-09 11:30:50 +01:00
2009-06-12 18:11:19 -03:00
2011-03-11 16:16:34 +05:30
2009-06-10 11:58:36 +03:00
2009-03-05 08:20:01 -03:00
2010-03-09 07:36:26 -03:00
2011-01-12 09:55:31 +01:00
2011-04-14 16:35:24 +02:00
2010-04-01 18:49:02 +04:00
2009-02-09 22:00:15 +01:00
2009-10-27 14:09:36 +04:00
2010-08-06 23:29:37 +04:00
2010-09-07 15:53:46 +07:00
2009-02-19 18:24:25 -05:00
2010-08-18 12:56:06 +08:00
2010-02-16 13:13:49 +04:00
2010-10-31 19:04:38 +03:00
2010-03-16 10:20:07 +01:00
2011-01-19 15:09:32 +01:00
2009-02-14 20:14:10 +03:00
2009-11-20 12:10:47 +02:00
2010-05-31 13:25:11 +04:00
2011-04-18 10:44:41 +02:00
2011-01-12 10:37:15 +01:00
2010-03-18 11:26:27 +01:00
2010-03-09 07:36:26 -03:00
2010-07-19 11:03:52 +02:00
2010-05-21 22:47:32 +04:00
2010-12-06 23:38:31 +03:00
2009-04-28 20:12:18 +02:00
2010-02-11 14:26:58 +01:00
2010-09-22 23:33:18 +04:00
2010-11-15 16:17:38 +01:00
2011-03-28 13:25:03 +03:00
2011-03-28 13:25:03 +03:00
2010-03-09 07:36:26 -03:00
2011-01-12 16:08:30 +03:00
2011-04-08 12:05:20 +04:00
2009-01-23 18:19:09 +01:00
2010-02-09 11:30:50 +01:00
2009-09-22 08:22:07 -03:00
2010-03-10 19:31:22 +04:00
2011-03-01 15:30:18 +03:00