Commit a1fce447 authored by unknown's avatar unknown

BUG#31581: 5.1-telco-6.1 -> 5.1.22. Slave crashes during starting

This patch has two purposes:
(1) To refactor the code so that
   {Write|Update|Delete}_rows_log_event_old does not use code from
   {Write|Update|Delete}_rows_log_event. Before refactoring there
   was the following problem: whenever we modifed the code for new
   events, it affected the old events. This is bad, as it makes
   maintainance difficult. After refactoring, we can safely edit the
   new code without affecting old events. So, if we for instance
   modify the binary format of new events, we no longer need to worry
   about how the new code reads old events.
(2) To fix BUG#31581.

These two objectives are reached by the following changes:
 - Merged Rows_log_event into Old_rows_log_event and
   {Write|Update|Delete}_rows_log_event into
   {Write|Update|Delete}_rows_log_event_old.
 - Fixed the bug by replacing {WRITE|UPDATE|DELETE}_ROWS_EVENT by
   PRE_GA_{WRITE|UPDATE|DELETE}_ROWS_EVENT.
 - Added comments to log_event_old.h

(This patch is identical to the previously committed patch which was
a collapse of three changesets, except that it adds assert(0) to
constructors for old types of row log events that should never be
called.)


sql/log_event_old.cc:
  Merged Rows_log_event into Old_rows_log_event and
  {Write|Update|Delete}_rows_log_event into
  {Write|Update|Delete}_rows_log_event_old. Also fixed the bug by
  replacing {WRITE|UPDATE|DELETE}_ROWS_EVENT by
  PRE_GA_{WRITE|UPDATE|DELETE}_ROWS_EVENT.
sql/log_event_old.h:
  Merged Rows_log_event into Old_rows_log_event and
  {Write|Update|Delete}_rows_log_event into
  {Write|Update|Delete}_rows_log_event_old. Also added comment
  explaining what the file contains and what the classes do.
parent c11fd18b
set autocommit=1;
reset master;
create table bug16206 (a int);
insert into bug16206 values(1);
start transaction;
insert into bug16206 values(2);
commit;
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4
f n Query 1 n use `test`; create table bug16206 (a int)
f n Query 1 n use `test`; insert into bug16206 values(1)
f n Query 1 n use `test`; insert into bug16206 values(2)
drop table bug16206;
reset master;
create table bug16206 (a int) engine= bdb;
insert into bug16206 values(0);
insert into bug16206 values(1);
start transaction;
insert into bug16206 values(2);
commit;
insert into bug16206 values(3);
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4
f n Query 1 n use `test`; create table bug16206 (a int) engine= bdb
f n Query 1 n use `test`; insert into bug16206 values(0)
f n Query 1 n use `test`; insert into bug16206 values(1)
f n Query 1 n use `test`; BEGIN
f n Query 1 n use `test`; insert into bug16206 values(2)
f n Query 1 n use `test`; COMMIT
f n Query 1 n use `test`; insert into bug16206 values(3)
drop table bug16206;
set autocommit=0;
End of 5.0 tests
-- source include/not_embedded.inc
-- source include/have_bdb.inc
#
# Bug #16206: Superfluous COMMIT event in binlog when updating BDB in autocommit mode
#
set autocommit=1;
let $VERSION=`select version()`;
reset master;
create table bug16206 (a int);
insert into bug16206 values(1);
start transaction;
insert into bug16206 values(2);
commit;
--replace_result $VERSION VERSION
--replace_column 1 f 2 n 5 n
show binlog events;
drop table bug16206;
reset master;
create table bug16206 (a int) engine= bdb;
insert into bug16206 values(0);
insert into bug16206 values(1);
start transaction;
insert into bug16206 values(2);
commit;
insert into bug16206 values(3);
--replace_result $VERSION VERSION
--replace_column 1 f 2 n 5 n
show binlog events;
drop table bug16206;
set autocommit=0;
--echo End of 5.0 tests
This diff is collapsed.
This diff is collapsed.
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