Venkatesh Duggirala
2735f0b920
Bug#21205695 DROP TABLE MAY CAUSE SLAVES TO BREAK
...
Problem:
========
1) Drop table queries are re-generated by server
before writing the events(queries) into binlog
for various reasons. If table name/db name contains
a non regular characters (like latin characters),
the generated query is wrong. Hence it breaks the
replication.
2) In the edge case, when table name/db name contains
64 characters, server is throwing an assert
assert(M_TBLLEN < 128)
3) In the edge case, when db name contains 64 latin
characters, binlog content is interpreted badly
which is leading replication failure.
Analysis & Fix :
================
1) Parser reads the table name from the query and converts
it to standard charset(utf8) and stores it in table_name variable.
When drop table query is regenerated with the same table_name
variable, it should be converted back to the original charset
from standard charset(utf8).
2) Latin character takes two bytes for each character. Limit
of the identifier is 64. SYSTEM_CHARSET_MBMAXLEN is set to '3'.
So there is a possiblity that tablename/dbname contains 3 * 64.
Hence assert is changed to
(M_TBLLEN <= NAME_CHAR_LEN*SYSTEM_CHARSET_MBMAXLEN)
3) db_len in the binlog event header is taking 1 byte.
db_len is ranged from 0 to 192 bytes (3 * 64).
While reading the db_len from the event, server
is casting to uint instead of uchar which is leading
to bad db_len. This problem is fixed by changing the
cast type to uchar.
2015-12-01 15:38:11 +05:30
..
2013-02-17 01:42:28 +05:30
2014-05-08 18:13:01 +05:30
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2012-02-09 23:28:33 +05:30
2010-12-19 18:15:12 +01:00
2012-04-23 11:51:19 +03:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2015-12-01 15:38:11 +05:30
2010-03-28 19:57:33 +08:00
2009-05-31 13:44:41 +08:00
2010-12-19 18:15:12 +01:00
2011-02-23 10:31:37 +01:00
2010-11-30 23:32:51 +00:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2011-12-01 00:54:54 +00:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2012-11-20 12:37:23 +00:00
2010-11-06 19:21:12 +01:00
2011-02-23 12:54:58 +01:00
2011-04-14 00:18:08 +04:00
2009-04-30 16:20:38 +03:00
2010-12-19 18:07:28 +01:00
2009-11-20 15:30:35 +02:00
2012-07-13 10:04:59 +01:00
2012-07-13 10:04:59 +01:00
2010-12-19 18:16:01 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2013-02-17 01:45:10 +05:30
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2009-07-06 09:02:14 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2011-11-24 14:51:18 +00:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2013-09-27 01:24:16 +05:30
2010-12-19 18:07:28 +01:00
2010-11-05 15:36:00 +01:00
2011-01-17 18:51:01 +00:00
2010-11-05 15:26:38 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-21 13:14:22 +01:00
2015-01-19 18:22:14 +05:30
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2011-12-14 15:33:43 +02:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2012-01-16 09:17:40 +00:00
2012-01-16 09:17:40 +00:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2012-05-15 22:06:48 +01:00
2009-12-03 16:59:58 +08:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2009-10-29 10:26:59 +08:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2011-02-04 22:07:48 +03:00
2009-10-02 23:24:40 +04:00
2014-04-04 10:42:25 +04:00
2010-12-19 18:15:12 +01:00
2010-11-06 19:21:12 +01:00
2010-12-19 18:15:12 +01:00
2011-02-23 12:54:58 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2011-02-23 12:54:58 +01:00
2011-02-23 10:31:37 +01:00
2011-02-23 10:31:37 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2011-01-31 14:31:33 +00:00
2010-12-19 18:15:12 +01:00
2010-06-20 22:43:34 +02:00
2010-12-19 18:15:12 +01:00
2010-11-06 19:21:12 +01:00
2009-11-23 17:38:42 +01:00
2011-10-19 23:44:17 +02:00
2010-11-06 19:21:12 +01:00
2009-11-23 17:38:42 +01:00
2011-10-19 23:44:17 +02:00
2009-11-23 17:38:42 +01:00
2011-10-19 23:44:17 +02:00
2009-11-23 17:38:42 +01:00
2011-10-19 23:44:17 +02:00
2009-04-09 07:42:51 +08:00
2010-12-19 18:15:12 +01:00
2011-12-26 22:40:56 +05:30
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2011-02-23 10:31:37 +01:00
2013-03-27 11:59:40 +05:30
2011-03-25 12:57:27 +02:00
2011-03-25 12:57:27 +02:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2009-11-28 12:43:16 +08:00
2010-11-05 15:26:38 +01:00
2009-11-28 12:43:16 +08:00
2010-11-05 15:26:38 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2011-05-12 06:23:16 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2013-09-10 16:12:25 +08:00
2013-10-14 15:45:12 +01:00
2012-01-19 16:56:43 +00:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2009-11-28 02:34:47 +03:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2013-09-27 01:24:16 +05:30
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-06-20 22:43:34 +02:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2012-02-09 23:28:33 +05:30
2012-02-09 23:28:33 +05:30
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2012-02-09 23:28:33 +05:30
2010-03-03 22:22:02 +03:00
2012-06-12 12:59:56 +05:30
2012-06-12 12:59:56 +05:30
2012-04-20 22:25:59 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2011-02-15 12:01:52 +00:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-03-03 22:22:02 +03:00
2010-12-19 18:07:28 +01:00
2011-05-19 16:45:45 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2012-04-26 19:34:03 +05:30
2012-12-04 18:14:01 +05:30
2010-12-19 18:07:28 +01:00
2009-08-28 10:45:57 +01:00
2010-12-19 18:07:28 +01:00
2013-09-27 01:24:16 +05:30
2011-10-27 17:14:41 +03:00
2011-10-27 17:14:41 +03:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-06-17 22:51:35 +02:00
2011-02-23 12:54:58 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2011-02-23 12:54:58 +01:00
2010-12-19 18:07:28 +01:00
2011-07-14 12:15:24 +01:00
2011-07-14 12:15:24 +01:00
2014-04-28 16:28:09 +05:30
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2011-11-11 17:26:56 +00:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2011-02-23 12:54:58 +01:00
2010-12-19 18:15:12 +01:00
2011-02-23 12:54:58 +01:00
2010-12-19 18:15:12 +01:00
2010-01-07 15:39:11 +00:00
2010-06-20 22:43:34 +02:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2012-02-24 16:07:43 +00:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2011-03-24 10:52:40 +00:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2013-02-19 01:58:57 +05:30
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2009-12-04 09:46:33 +08:00
2012-02-09 23:28:33 +05:30
2014-05-05 22:22:15 +05:30
2014-05-05 22:22:15 +05:30
2014-05-07 14:33:58 +05:30
2010-11-06 19:21:12 +01:00
2009-09-30 16:09:31 +08:00
2014-05-06 11:23:42 +05:30
2010-12-19 18:07:28 +01:00
2011-05-06 00:50:31 +01:00
2009-10-02 16:15:54 +03:00
2011-12-14 15:33:43 +02:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2009-10-20 14:30:15 +08:00
2012-02-28 14:02:27 +05:30
2010-12-19 18:15:12 +01:00
2011-02-23 10:31:37 +01:00
2011-02-23 12:54:58 +01:00
2010-12-19 18:07:28 +01:00
2011-03-15 16:12:41 +01:00
2010-11-05 15:26:38 +01:00
2009-03-18 10:31:17 +00:00
2011-02-23 10:31:37 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-02-05 17:01:09 +00:00
2011-03-16 16:38:30 +00:00
2010-12-19 18:15:12 +01:00
2009-12-22 10:35:56 +01:00
2009-12-22 10:35:56 +01:00
2010-12-19 18:07:28 +01:00
2009-11-04 12:28:20 +00:00
2009-11-04 12:28:20 +00:00
2010-12-19 18:15:12 +01:00
2009-10-03 22:21:44 +04:00
2010-12-19 18:15:12 +01:00
2015-01-14 14:13:52 +05:30
2015-01-14 14:13:52 +05:30
2015-01-14 14:13:52 +05:30
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2009-03-26 10:25:06 +02:00
2012-01-23 17:39:37 +05:30
2013-09-27 01:24:16 +05:30
2010-12-19 18:15:12 +01:00
2010-01-20 19:08:16 +00:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-06-17 22:51:35 +02:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2012-03-12 12:28:27 +00:00
2012-03-12 23:26:00 +00:00
2010-12-19 18:07:28 +01:00
2012-01-18 00:16:19 +02:00
2010-12-19 18:15:12 +01:00
2013-02-15 00:40:32 +05:30
2010-12-19 18:15:12 +01:00
2014-06-26 12:54:27 +01:00
2010-12-19 18:15:12 +01:00
2010-06-20 22:43:34 +02:00
2010-12-19 18:15:12 +01:00
2011-03-15 16:11:17 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-11-06 19:21:12 +01:00
2011-02-23 12:54:58 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2012-02-09 23:28:33 +05:30
2015-03-13 13:13:48 +05:30
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2011-05-25 16:39:39 +02:00
2010-03-17 15:28:49 +01:00
2011-05-11 09:49:23 +02:00
2010-12-19 18:15:12 +01:00
2015-11-19 13:59:27 +05:30
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00