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
..
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: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
2012-02-09 23:28:33 +05:30
2010-12-19 18:07:28 +01:00
2012-04-23 11:51:19 +03:00
2010-12-19 18:07:28 +01:00
2010-12-21 12:47:22 +08:00
2015-12-01 15:38:11 +05:30
2010-12-19 18:15:12 +01:00
2011-02-23 10:31:37 +01: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: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
2012-11-20 12:37:23 +00:00
2011-02-23 10:31:37 +01:00
2011-04-14 00:18:08 +04:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +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:15:12 +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
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +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-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-21 13:14:22 +01:00
2014-12-29 12:17:55 +05:30
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: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
2012-01-16 09:17:40 +00:00
2012-01-16 09:17:40 +00:00
2013-02-14 17:03:49 +01:00
2013-02-14 17:03:49 +01:00
2011-02-15 11:59:12 +00:00
2012-05-15 22:18:59 +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
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2011-02-04 22:07:48 +03:00
2012-01-25 18:05:10 +00:00
2010-12-19 18:15: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-03-18 16:16:17 +02: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
2012-02-13 14:12:13 +05:30
2012-02-09 23:28:33 +05:30
2010-12-19 18:15:12 +01:00
2011-09-29 14:47:27 +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: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-03-30 18:35:53 +05:30
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2011-02-23 10:31:37 +01:00
2013-03-27 11:59:40 +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
2011-02-23 12:54:58 +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-31 17:07:44 +02: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
2011-02-23 12:54:58 +01:00
2010-12-19 18:07:28 +01:00
2013-09-27 01:24:16 +05:30
2013-09-27 01:24:16 +05:30
2013-07-27 17:35:02 +05:30
2013-07-27 17:35:02 +05:30
2010-04-20 10:10:43 +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
2012-02-09 23:28:33 +05:30
2010-12-19 18:07:28 +01:00
2012-02-09 23:28:33 +05:30
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2013-07-27 17:35:02 +05:30
2013-07-27 17:35:02 +05:30
2013-07-27 17:35:02 +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:15:12 +01:00
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-12-19 18:07:28 +01:00
2011-05-19 16:45:45 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2012-12-04 18:14:01 +05:30
2010-12-19 18:07:28 +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
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2012-04-12 11:07:39 +05:30
2012-04-12 11:07:39 +05:30
2013-02-14 17:03:49 +01:00
2011-02-23 12:54:58 +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
2011-02-23 12:54:58 +01:00
2011-02-23 12:54:58 +01:00
2011-07-14 12:15:24 +01:00
2014-04-28 16:28:09 +05:30
2010-08-18 12:56:06 +08:00
2010-12-19 18:07:28 +01:00
2013-09-27 01:24:16 +05:30
2013-07-27 17:35:02 +05:30
2011-11-11 17:26:56 +00: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-02-23 12:54:58 +01:00
2013-07-27 17:35:02 +05:30
2011-02-23 12:54:58 +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
2012-02-24 16:07:43 +00:00
2013-07-27 17:35:02 +05:30
2012-11-20 12:37:23 +00:00
2010-12-19 18:07:28 +01:00
2011-03-24 10:52:40 +00:00
2011-03-24 10:52:40 +00:00
2013-09-27 01:24:16 +05:30
2011-01-13 12:21:57 +00: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: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
2011-02-23 12:54:58 +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
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
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
2014-05-07 14:33:58 +05:30
2014-05-06 11:23:42 +05:30
2010-12-19 18:07:28 +01:00
2011-05-06 00:50:31 +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
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
2011-02-23 10:31:37 +01:00
2010-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2011-03-16 16:38:30 +00:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:07:28 +01:00
2012-11-20 12:37:23 +00:00
2010-12-19 18:15:12 +01:00
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:07:28 +01: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
2011-02-23 12:54:58 +01:00
2011-02-23 12:54:58 +01:00
2013-09-27 01:24:16 +05:30
2011-02-23 10:31:37 +01:00
2010-12-19 18:07:28 +01:00
2010-12-19 18:15:12 +01:00
2013-07-27 17:35:02 +05:30
2013-09-27 01:24:16 +05:30
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-12-19 18:15:12 +01:00
2010-12-19 18:15:12 +01:00
2011-01-13 12:21:57 +00:00
2013-07-27 17:35:02 +05:30
2010-12-19 18:15:12 +01:00
2010-12-19 18:07:28 +01:00
2012-03-12 23:15:01 +00:00
2013-09-27 01:24:16 +05:30
2010-12-19 18:07:28 +01:00
2012-01-31 17:07:44 +02:00
2011-03-16 16:38:30 +00: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-12-19 18:15:12 +01:00
2013-07-27 17:35:02 +05:30
2010-12-19 18:07:28 +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
2015-03-13 13:13:48 +05:30
2012-05-23 10:12:52 +05:30
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-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: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