Commit da7eca02 authored by Sergei Golubchik's avatar Sergei Golubchik

remove old workaround for replicating from old

MySQL 5.1 and 5.2 alpha trees.
parent 68f6c229
...@@ -38,21 +38,6 @@ SELECT COUNT(*) FROM t3; ...@@ -38,21 +38,6 @@ SELECT COUNT(*) FROM t3;
COUNT(*) COUNT(*)
17920 17920
DROP TABLE t1, t3; DROP TABLE t1, t3;
==== Read binlog from alcatel tree (mysql-5.1-wl2325-5.0-drop6) ====
SELECT * FROM t1 ORDER BY a;
a b
0 last_insert_id
1 one
3 last stm in trx: next event should be xid
4 four
781729 random
SELECT * FROM t2 ORDER BY a;
a b
3 first stm in trx
SELECT COUNT(*) FROM t3;
COUNT(*)
17920
DROP TABLE t1, t2, t3;
==== Read binlog from ndb tree (mysql-5.1-telco-6.1) ==== ==== Read binlog from ndb tree (mysql-5.1-telco-6.1) ====
SELECT * FROM t1 ORDER BY a; SELECT * FROM t1 ORDER BY a;
a b a b
......
...@@ -64,25 +64,6 @@ SELECT COUNT(*) FROM t3; ...@@ -64,25 +64,6 @@ SELECT COUNT(*) FROM t3;
DROP TABLE t1, t3; DROP TABLE t1, t3;
--echo ==== Read binlog from alcatel tree (mysql-5.1-wl2325-5.0-drop6) ====
# In this version, it was not possible to switch between row-based and
# statement-based binlogging without restarting the server. So, we
# have two binlogs; one for row based and one for statement based
# replication.
# Read rbr binlog.
--exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/ suite/binlog/std_data/ver_5_1-wl2325_r.001 | $MYSQL --local-infile=1
# Read stm binlog.
--exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/ suite/binlog/std_data/ver_5_1-wl2325_s.001 | $MYSQL --local-infile=1
# Show result.
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
SELECT COUNT(*) FROM t3;
# Reset.
DROP TABLE t1, t2, t3;
--echo ==== Read binlog from ndb tree (mysql-5.1-telco-6.1) ==== --echo ==== Read binlog from ndb tree (mysql-5.1-telco-6.1) ====
# Read binlog. # Read binlog.
......
...@@ -4568,109 +4568,6 @@ Format_description_log_event(const char* buf, ...@@ -4568,109 +4568,6 @@ Format_description_log_event(const char* buf,
checksum_alg= (uint8) BINLOG_CHECKSUM_ALG_UNDEF; checksum_alg= (uint8) BINLOG_CHECKSUM_ALG_UNDEF;
} }
/*
In some previous versions, the events were given other event type
id numbers than in the present version. When replicating from such
a version, we therefore set up an array that maps those id numbers
to the id numbers of the present server.
If post_header_len is null, it means malloc failed, and is_valid
will fail, so there is no need to do anything.
The trees in which events have wrong id's are:
mysql-5.1-wl1012.old mysql-5.1-wl2325-5.0-drop6p13-alpha
mysql-5.1-wl2325-5.0-drop6 mysql-5.1-wl2325-5.0
mysql-5.1-wl2325-no-dd
(this was found by grepping for two lines in sequence where the
first matches "FORMAT_DESCRIPTION_EVENT," and the second matches
"TABLE_MAP_EVENT," in log_event.h in all trees)
In these trees, the following server_versions existed since
TABLE_MAP_EVENT was introduced:
5.1.1-a_drop5p3 5.1.1-a_drop5p4 5.1.1-alpha
5.1.2-a_drop5p10 5.1.2-a_drop5p11 5.1.2-a_drop5p12
5.1.2-a_drop5p13 5.1.2-a_drop5p14 5.1.2-a_drop5p15
5.1.2-a_drop5p16 5.1.2-a_drop5p16b 5.1.2-a_drop5p16c
5.1.2-a_drop5p17 5.1.2-a_drop5p4 5.1.2-a_drop5p5
5.1.2-a_drop5p6 5.1.2-a_drop5p7 5.1.2-a_drop5p8
5.1.2-a_drop5p9 5.1.3-a_drop5p17 5.1.3-a_drop5p17b
5.1.3-a_drop5p17c 5.1.4-a_drop5p18 5.1.4-a_drop5p19
5.1.4-a_drop5p20 5.1.4-a_drop6p0 5.1.4-a_drop6p1
5.1.4-a_drop6p2 5.1.5-a_drop5p20 5.2.0-a_drop6p3
5.2.0-a_drop6p4 5.2.0-a_drop6p5 5.2.0-a_drop6p6
5.2.1-a_drop6p10 5.2.1-a_drop6p11 5.2.1-a_drop6p12
5.2.1-a_drop6p6 5.2.1-a_drop6p7 5.2.1-a_drop6p8
5.2.2-a_drop6p13 5.2.2-a_drop6p13-alpha 5.2.2-a_drop6p13b
5.2.2-a_drop6p13c
(this was found by grepping for "mysql," in all historical
versions of configure.in in the trees listed above).
There are 5.1.1-alpha versions that use the new event id's, so we
do not test that version string. So replication from 5.1.1-alpha
with the other event id's to a new version does not work.
Moreover, we can safely ignore the part after drop[56]. This
allows us to simplify the big list above to the following regexes:
5\.1\.[1-5]-a_drop5.*
5\.1\.4-a_drop6.*
5\.2\.[0-2]-a_drop6.*
This is what we test for in the 'if' below.
*/
if (post_header_len &&
server_version[0] == '5' && server_version[1] == '.' &&
server_version[3] == '.' &&
strncmp(server_version + 5, "-a_drop", 7) == 0 &&
((server_version[2] == '1' &&
server_version[4] >= '1' && server_version[4] <= '5' &&
server_version[12] == '5') ||
(server_version[2] == '1' &&
server_version[4] == '4' &&
server_version[12] == '6') ||
(server_version[2] == '2' &&
server_version[4] >= '0' && server_version[4] <= '2' &&
server_version[12] == '6')))
{
if (number_of_event_types != 22)
{
DBUG_PRINT("info", (" number_of_event_types=%d",
number_of_event_types));
/* this makes is_valid() return false. */
my_free(post_header_len);
post_header_len= NULL;
DBUG_VOID_RETURN;
}
static const uint8 perm[23]=
{
UNKNOWN_EVENT, START_EVENT_V3, QUERY_EVENT, STOP_EVENT, ROTATE_EVENT,
INTVAR_EVENT, LOAD_EVENT, SLAVE_EVENT, CREATE_FILE_EVENT,
APPEND_BLOCK_EVENT, EXEC_LOAD_EVENT, DELETE_FILE_EVENT,
NEW_LOAD_EVENT,
RAND_EVENT, USER_VAR_EVENT,
FORMAT_DESCRIPTION_EVENT,
TABLE_MAP_EVENT,
PRE_GA_WRITE_ROWS_EVENT,
PRE_GA_UPDATE_ROWS_EVENT,
PRE_GA_DELETE_ROWS_EVENT,
XID_EVENT,
BEGIN_LOAD_QUERY_EVENT,
EXECUTE_LOAD_QUERY_EVENT,
};
event_type_permutation= perm;
/*
Since we use (permuted) event id's to index the post_header_len
array, we need to permute the post_header_len array too.
*/
uint8 post_header_len_temp[23];
for (int i= 1; i < 23; i++)
post_header_len_temp[perm[i] - 1]= post_header_len[i - 1];
for (int i= 0; i < 22; i++)
post_header_len[i] = post_header_len_temp[i];
}
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment