1
0
mirror of https://github.com/MariaDB/server.git synced 2026-10-23 18:49:29 +03:00

Merge branch 'knielsen_log_event_read_validation_base_11.4' into 11.4

This commit is contained in:
Kristian Nielsen
2026-10-23 13:08:46 +02:00
27 changed files with 715 additions and 1200 deletions

View File

@@ -1319,7 +1319,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
size_t len_to= 0;
const char* db_to= binlog_filter->get_rewrite_db(map->get_db_name(), &len_to);
if (len_to && map->rewrite_db(db_to, len_to, glob_description_event))
if (len_to && map->rewrite_db(db_to, len_to))
{
error("Could not rewrite database name");
goto err;
@@ -2398,6 +2398,53 @@ static Exit_status safe_connect()
}
/**
Copied from sql-common/pack.c, since it is needed for reading Log_event
objects in sql/log_event.cc, but this function is not available in
libmariadbclient.
The function is simple and the format of the variable length field is
fixed, so we can probably live with copying the code for now.
*/
my_ulonglong safe_net_field_length_ll(uchar **packet, size_t packet_len)
{
uchar *pos= *packet;
if (packet_len < 1)
goto err;
if (*pos < 251)
{
(*packet)++;
return (my_ulonglong) *pos;
}
if (*pos == 251)
{
(*packet)++;
return (my_ulonglong) NULL_LENGTH;
}
if (*pos == 252)
{
if (packet_len < 3)
goto err;
(*packet)+=3;
return (my_ulonglong) uint2korr(pos+1);
}
if (*pos == 253)
{
if (packet_len < 4)
goto err;
(*packet)+=4;
return (my_ulonglong) uint3korr(pos+1);
}
if (packet_len < 9 || *pos != 254)
goto err;
(*packet)+=9;
return (my_ulonglong) uint8korr(pos+1);
err:
*packet = NULL;
return 0;
}
/**
High-level function for dumping a named binlog.

View File

@@ -958,255 +958,6 @@ SET GLOBAL SERVER_ID = 1;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#130807 20:29:20 server id 1 end_log_pos 106
# Position
# |Timestamp |Type |Master ID |Size |Master Pos |Flags
# 4 |20 ae 02 52 |0f |01 00 00 00 |66 00 00 00 |6a 00 00 00 |00 01
#
# 17 04 00 35 2e 31 2e 36 33 2d 67 6f 6f 67 6c 65 2d |..5.1.63-google-|
# 27 64 65 62 75 67 2d 6c 6f 67 00 00 00 00 00 00 00 |debug-log.......|
# 37 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
# 47 00 00 00 00 20 ae 02 52 17 38 0d 00 08 00 12 00 |.... ..R.8......|
# 57 04 04 04 04 12 00 00 53 00 04 1a 08 00 00 00 08 |.......S........|
# 67 08 08 02 |...|
#
# Event: Start: binlog v 4, server v 5.1.63-google-debug-log created 130807 20:29:20 at startup
ROLLBACK/*!*/;
BINLOG '
IK4CUg8BAAAAZgAAAGoAAAAAAQQANS4xLjYzLWdvb2dsZS1kZWJ1Zy1sb2cAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAgrgJSFzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
'/*!*/;
# at 106
#130807 20:29:24 server id 1 end_log_pos 207
# Position
# |Timestamp |Type |Master ID |Size |Master Pos |Flags
# 6a |24 ae 02 52 |02 |01 00 00 00 |65 00 00 00 |cf 00 00 00 |00 00
#
# 81 01 00 00 00 00 00 00 00 00 00 00 1a 00 00 00 40 |...............@|
# 91 00 00 01 00 00 00 00 00 00 00 00 06 03 73 74 64 |.............std|
# a1 04 08 00 08 00 08 00 00 63 72 65 61 74 65 20 74 |........create t|
# b1 61 62 6c 65 20 74 65 73 74 2e 74 31 20 28 69 64 |able test.t1 (id|
# c1 20 69 6e 74 20 6e 6f 74 20 6e 75 6c 6c 29 | int not null)|
#
# Event: Query thread_id=1 exec_time=0 error_code=0 xid=0
SET TIMESTAMP=1375907364/*!*/;
SET @@session.pseudo_thread_id=1/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.system_versioning_insert_history=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=latin1,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table test.t1 (id int not null)
/*!*/;
# at 207
#130807 20:29:26 server id 1 end_log_pos 305
# Position
# |Timestamp |Type |Master ID |Size |Master Pos |Flags
# cf |26 ae 02 52 |02 |01 00 00 00 |62 00 00 00 |31 01 00 00 |00 00
#
# e6 01 00 00 00 00 00 00 00 00 00 00 1a 00 00 00 40 |...............@|
# f6 00 00 01 00 00 00 00 00 00 00 00 06 03 73 74 64 |.............std|
# 106 04 08 00 08 00 08 00 00 69 6e 73 65 72 74 20 69 |........insert i|
# 116 6e 74 6f 20 74 65 73 74 2e 74 31 20 28 69 64 29 |nto test.t1 (id)|
# 126 20 76 61 6c 75 65 73 20 28 31 29 | values (1)|
#
# Event: Query thread_id=1 exec_time=0 error_code=0 xid=0
SET TIMESTAMP=1375907366/*!*/;
insert into test.t1 (id) values (1)
/*!*/;
# at 305
#130807 20:29:28 server id 1 end_log_pos 386
# Position
# |Timestamp |Type |Master ID |Size |Master Pos |Flags
# 131 |28 ae 02 52 |02 |01 00 00 00 |51 00 00 00 |82 01 00 00 |00 00
#
# 148 01 00 00 00 00 00 00 00 00 00 00 1a 00 00 00 40 |...............@|
# 158 00 00 01 00 00 00 00 00 00 00 00 06 03 73 74 64 |.............std|
# 168 04 08 00 08 00 08 00 00 64 72 6f 70 20 74 61 62 |........drop tab|
# 178 6c 65 20 74 65 73 74 2e 74 31 |le test.t1|
#
# Event: Query thread_id=1 exec_time=0 error_code=0 xid=0
SET TIMESTAMP=1375907368/*!*/;
drop table test.t1
/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#130807 20:25:35 server id 1 end_log_pos 106
# Position
# |Timestamp |Type |Master ID |Size |Master Pos |Flags
# 4 |3f ad 02 52 |0f |01 00 00 00 |66 00 00 00 |6a 00 00 00 |00 00
#
# 17 04 00 35 2e 31 2e 36 33 2d 67 6f 6f 67 6c 65 2d |..5.1.63-google-|
# 27 64 65 62 75 67 2d 6c 6f 67 00 00 00 00 00 00 00 |debug-log.......|
# 37 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
# 47 00 00 00 00 3f ad 02 52 1b 38 0d 00 08 00 12 00 |....?..R.8......|
# 57 04 04 04 04 12 00 00 53 00 04 1a 08 00 00 00 08 |.......S........|
# 67 08 08 02 |...|
#
# Event: Start: binlog v 4, server v 5.1.63-google-debug-log created 130807 20:25:35 at startup
ROLLBACK/*!*/;
BINLOG '
P60CUg8BAAAAZgAAAGoAAAAAAAQANS4xLjYzLWdvb2dsZS1kZWJ1Zy1sb2cAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAA/rQJSGzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
'/*!*/;
# at 106
#130807 20:25:41 server id 1 end_log_pos 211
# Position
# |Timestamp |Type |Master ID |Size |Master Pos |Flags
# 6a |45 ad 02 52 |02 |01 00 00 00 |69 00 00 00 |d3 00 00 00 |00 00
#
# 85 01 00 00 00 01 00 00 00 00 00 00 1a 00 00 00 40 |...............@|
# 95 00 00 01 00 00 00 00 00 00 00 00 06 03 73 74 64 |.............std|
# a5 04 08 00 08 00 08 00 00 63 72 65 61 74 65 20 74 |........create t|
# b5 61 62 6c 65 20 74 65 73 74 2e 74 31 20 28 69 64 |able test.t1 (id|
# c5 20 69 6e 74 20 6e 6f 74 20 6e 75 6c 6c 29 | int not null)|
#
# Event: Query thread_id=1 exec_time=1 error_code=0 xid=0
SET TIMESTAMP=1375907141/*!*/;
SET @@session.pseudo_thread_id=1/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.system_versioning_insert_history=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=latin1,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table test.t1 (id int not null)
/*!*/;
# at 211
#130807 20:25:44 server id 1 end_log_pos 313
# Position
# |Timestamp |Type |Master ID |Size |Master Pos |Flags
# d3 |48 ad 02 52 |02 |01 00 00 00 |66 00 00 00 |39 01 00 00 |00 00
#
# ee 01 00 00 00 00 00 00 00 00 00 00 1a 00 00 00 40 |...............@|
# fe 00 00 01 00 00 00 00 00 00 00 00 06 03 73 74 64 |.............std|
# 10e 04 08 00 08 00 08 00 00 69 6e 73 65 72 74 20 69 |........insert i|
# 11e 6e 74 6f 20 74 65 73 74 2e 74 31 20 28 69 64 29 |nto test.t1 (id)|
# 12e 20 76 61 6c 75 65 73 20 28 31 29 | values (1)|
#
# Event: Query thread_id=1 exec_time=0 error_code=0 xid=0
SET TIMESTAMP=1375907144/*!*/;
insert into test.t1 (id) values (1)
/*!*/;
# at 313
#130807 20:25:48 server id 1 end_log_pos 398
# Position
# |Timestamp |Type |Master ID |Size |Master Pos |Flags
# 139 |4c ad 02 52 |02 |01 00 00 00 |55 00 00 00 |8e 01 00 00 |00 00
#
# 154 01 00 00 00 00 00 00 00 00 00 00 1a 00 00 00 40 |...............@|
# 164 00 00 01 00 00 00 00 00 00 00 00 06 03 73 74 64 |.............std|
# 174 04 08 00 08 00 08 00 00 64 72 6f 70 20 74 61 62 |........drop tab|
# 184 6c 65 20 74 65 73 74 2e 74 31 |le test.t1|
#
# Event: Query thread_id=1 exec_time=0 error_code=0 xid=0
SET TIMESTAMP=1375907148/*!*/;
drop table test.t1
/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#130807 20:20:55 server id 1 end_log_pos 106
# Position
# |Timestamp |Type |Master ID |Size |Master Pos |Flags
# 4 |27 ac 02 52 |0f |01 00 00 00 |66 00 00 00 |6a 00 00 00 |00 01
#
# 17 04 00 35 2e 31 2e 36 33 2d 67 6f 6f 67 6c 65 2d |..5.1.63-google-|
# 27 64 65 62 75 67 2d 6c 6f 67 00 00 00 00 00 00 00 |debug-log.......|
# 37 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
# 47 00 00 00 00 27 ac 02 52 1f 38 0d 00 08 00 12 00 |....'..R.8......|
# 57 04 04 04 04 12 00 00 53 00 04 1a 08 00 00 00 08 |.......S........|
# 67 08 08 02 |...|
#
# Event: Start: binlog v 4, server v 5.1.63-google-debug-log created 130807 20:20:55 at startup
ROLLBACK/*!*/;
BINLOG '
J6wCUg8BAAAAZgAAAGoAAAAAAQQANS4xLjYzLWdvb2dsZS1kZWJ1Zy1sb2cAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAnrAJSHzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
'/*!*/;
# at 106
#130807 20:21:19 server id 1 end_log_pos 215
# Position
# |Timestamp |Type |Master ID |Size |Master Pos |Flags
# 6a |3f ac 02 52 |02 |01 00 00 00 |6d 00 00 00 |d7 00 00 00 |00 00
#
# 89 01 00 00 00 00 00 00 00 00 00 00 1a 00 00 00 40 |...............@|
# 99 00 00 01 00 00 00 00 00 00 00 00 06 03 73 74 64 |.............std|
# a9 04 08 00 08 00 08 00 00 63 72 65 61 74 65 20 74 |........create t|
# b9 61 62 6c 65 20 74 65 73 74 2e 74 31 20 28 69 64 |able test.t1 (id|
# c9 20 69 6e 74 20 6e 6f 74 20 6e 75 6c 6c 29 | int not null)|
#
# Event: Query thread_id=1 exec_time=0 error_code=0 xid=0
SET TIMESTAMP=1375906879/*!*/;
SET @@session.pseudo_thread_id=1/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.system_versioning_insert_history=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=latin1,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table test.t1 (id int not null)
/*!*/;
# at 215
#130807 20:21:31 server id 1 end_log_pos 321
# Position
# |Timestamp |Type |Master ID |Size |Master Pos |Flags
# d7 |4b ac 02 52 |02 |01 00 00 00 |6a 00 00 00 |41 01 00 00 |00 00
#
# f6 01 00 00 00 00 00 00 00 00 00 00 1a 00 00 00 40 |...............@|
# 106 00 00 01 00 00 00 00 00 00 00 00 06 03 73 74 64 |.............std|
# 116 04 08 00 08 00 08 00 00 69 6e 73 65 72 74 20 69 |........insert i|
# 126 6e 74 6f 20 74 65 73 74 2e 74 31 20 28 69 64 29 |nto test.t1 (id)|
# 136 20 76 61 6c 75 65 73 20 28 31 29 | values (1)|
#
# Event: Query thread_id=1 exec_time=0 error_code=0 xid=0
SET TIMESTAMP=1375906891/*!*/;
insert into test.t1 (id) values (1)
/*!*/;
# at 321
#130807 20:21:41 server id 1 end_log_pos 410
# Position
# |Timestamp |Type |Master ID |Size |Master Pos |Flags
# 141 |55 ac 02 52 |02 |01 00 00 00 |59 00 00 00 |9a 01 00 00 |00 00
#
# 160 01 00 00 00 00 00 00 00 00 00 00 1a 00 00 00 40 |...............@|
# 170 00 00 01 00 00 00 00 00 00 00 00 06 03 73 74 64 |.............std|
# 180 04 08 00 08 00 08 00 00 64 72 6f 70 20 74 61 62 |........drop tab|
# 190 6c 65 20 74 65 73 74 2e 74 31 |le test.t1|
#
# Event: Query thread_id=1 exec_time=0 error_code=0 xid=0
SET TIMESTAMP=1375906901/*!*/;
drop table test.t1
/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#130807 20:38:51 server id 1 end_log_pos 106
# Position
# |Timestamp |Type |Master ID |Size |Master Pos |Flags

View File

@@ -600,9 +600,10 @@ eval SET GLOBAL SERVER_ID = $old_server_id;
--echo # FDE corrupted in relay log
--echo #
--let TZ=GMT
--exec $MYSQL_BINLOG --hexdump std_data/mdev-4645-binlog_checksum.binlog
--exec $MYSQL_BINLOG --hexdump std_data/mdev-4645-binlog_group_id.binlog
--exec $MYSQL_BINLOG --hexdump std_data/mdev-4645-binlog_group_id_checksum.binlog
# Here used to be testing with special binlog files where the Format Description
# event had common_header_len increased. We no longer support different
# common_header_len, as such are never generated by MariaDB nor MySQL, would
# require custom fork of the server code.
--exec $MYSQL_BINLOG --hexdump std_data/mdev-4645-binlog_none.binlog
#

View File

@@ -49,21 +49,6 @@ a
SELECT @binlog_fragment_0, @binlog_fragment_1 as 'NULL','NULL';
@binlog_fragment_0 NULL NULL
NULL NULL NULL
==== Test non-matching FD event and Row event ====
BINLOG '
4CdYRw8BAAAAYgAAAGYAAAAAAAQANS4xLjE1LW5kYi02LjEuMjQtZGVidWctbG9nAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAADgJ1hHEzgNAAgAEgAEBAQEEgAATwAEGggICAg=
';
BINLOG '
Dl1YRxMBAAAAKQAAADQBAAAAABAAAAAAAAAABHRlc3QAAnQxAAEDAAE=
Dl1YRxcBAAAAIgAAAFYBAAAQABAAAAAAAAEAAf/+BQAAAA==
';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use
select * from t1;
a
1
1
3
CREATE TABLE char128_utf8 (
i1 INT NOT NULL,
c CHAR(128) CHARACTER SET utf8 NOT NULL,

View File

@@ -76,31 +76,6 @@ select * from t1;
# show "one-shot" feature of binlog_fragment variables
SELECT @binlog_fragment_0, @binlog_fragment_1 as 'NULL','NULL';
# Test that the following fails cleanly: "First, read a
# Format_description event which has N event types. Then, read an
# event of type M>N"
--echo ==== Test non-matching FD event and Row event ====
# This is the Format_description_log_event from
# bug32407.001, encoded in base64. It contains only the old
# row events (number of event types is 22)
BINLOG '
4CdYRw8BAAAAYgAAAGYAAAAAAAQANS4xLjE1LW5kYi02LjEuMjQtZGVidWctbG9nAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAADgJ1hHEzgNAAgAEgAEBAQEEgAATwAEGggICAg=
';
# The following is a Write_rows_log_event with event type 23, i.e.,
# not supported by the Format_description_log_event above. It
# corresponds to the following query:
# INSERT INTO t1 VALUES (5)
error 1149;
BINLOG '
Dl1YRxMBAAAAKQAAADQBAAAAABAAAAAAAAAABHRlc3QAAnQxAAEDAAE=
Dl1YRxcBAAAAIgAAAFYBAAAQABAAAAAAAAEAAf/+BQAAAA==
';
# the above line should fail and 5 should not be in the binlog.
select * from t1;
# Test that BUG#37426 is triggered.
CREATE TABLE char128_utf8 (

View File

@@ -45,7 +45,7 @@ connection master;
CREATE TAB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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2560');
connection slave;
include/wait_for_slave_io_error.inc [errno=1153]
Last_IO_Error = 'Got a packet bigger than 'slave_max_allowed_packet' bytes'

View File

@@ -28,12 +28,12 @@ set @@session.debug_dbug= @saved_dbug;
connection slave;
# Waiting for the IO thread to reject the compressed Query event
include/wait_for_slave_io_error.inc [errno=1256, 1595]
# Ensure the replica rejected the event on its recorded length
# Ensure the slave rejected the event on its recorded length
include/assert_grep.inc [The IO thread reported an oversized uncompressed length]
# Move the replica past the corrupt event
# Move the slave past the corrupt event
include/stop_slave_sql.inc
include/start_slave.inc
# Ensure replication resumes
# Ensure slavetion resumes
connection master;
insert into t1 values (1);
include/save_master_gtid.inc
@@ -54,12 +54,12 @@ set @@session.debug_dbug= @saved_dbug;
connection slave;
# Waiting for the IO thread to reject the compressed Write_rows event
include/wait_for_slave_io_error.inc [errno=1256, 1595]
# Ensure the replica rejected the event on its recorded length
# Ensure the slave rejected the event on its recorded length
include/assert_grep.inc [The IO thread reported an oversized uncompressed length]
# Move the replica past the corrupt event
# Move the slave past the corrupt event
include/stop_slave_sql.inc
include/start_slave.inc
# Ensure replication resumes
# Ensure slavetion resumes
connection master;
insert into t1 values (2);
include/save_master_gtid.inc

View File

@@ -45,7 +45,7 @@ connection master;
CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
connection slave;
connection master;
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2560');
connection slave;
include/wait_for_slave_io_error.inc [errno=1153]
Last_IO_Error = 'Got a packet bigger than 'slave_max_allowed_packet' bytes'

View File

@@ -1,19 +0,0 @@
SET @saved_dbug= @@GLOBAL.debug_dbug;
SET @@GLOBAL.debug_dbug= '+d,truncate_fde_post_header_len';
include/master-slave.inc
[connection master]
FLUSH BINARY LOGS;
CALL mtr.add_suppression('Found invalid event in binary log');
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error
connection slave;
START SLAVE IO_THREAD;
CALL mtr.add_suppression('Slave I/O: Relay log write failure');
include/wait_for_slave_io_error.inc [errno=1595]
connection master;
SET @@GLOBAL.debug_dbug= @saved_dbug;
RESET MASTER;
connection slave;
CHANGE MASTER TO master_use_gtid=SLAVE_POS;
SET @@GLOBAL.gtid_slave_pos='';
include/start_slave.inc
include/rpl_end.inc

View File

@@ -1,28 +0,0 @@
include/master-slave.inc
[connection master]
connection master;
drop database if exists mysqltest1;
create database mysqltest1;
use mysqltest1;
CREATE TABLE t1 (a char(3));
CREATE TABLE t2 (a char(3));
insert into t1 values("ANN");
insert into t1 values("GUI");
insert into t2 values("LIL");
insert into t2 values("ABE");
insert into t2 values("ANG");
connection slave;
use mysqltest1;
select * from t1 order by a;
a
ANN
GUI
select * from t2 order by a;
a
ABE
ANG
LIL
connection master;
DROP DATABASE mysqltest1;
connection slave;
include/rpl_end.inc

View File

@@ -1,15 +1,15 @@
#
# This test verifies that a replica rejects a compressed event whose
# This test verifies that a slave rejects a compressed event whose
# recorded uncompressed length is larger than the biggest packet the
# server accepts. A compressed Query event and a compressed Write_rows
# event are both covered, because the IO thread uncompresses each with
# its own function. MDEV-39762 reported that the compressed Query event
# crashed the replica.
# crashed the slave.
#
# A debug injection makes the master write each of those events with
# a corrupted length field. The event stays in the master's binary log
# and is resent as it is, so each case moves gtid_slave_pos past it
# before checking that replication resumes. The sibling .opt file turns
# before checking that slavetion resumes. The sibling .opt file turns
# on log_bin_compress, without which the master writes no compressed
# events at all.
#
@@ -37,7 +37,7 @@ call mtr.add_suppression("Relay log write failure: could not queue event from ma
--echo # Initialize test data
--echo #
--connection master
# t1 tracks what replicates. t2 takes the corrupt events, and the replica
# t1 tracks what slavetes. t2 takes the corrupt events, and the slave
# never receives its rows.
create table t1 (a int);
create table t2 (a longtext);
@@ -75,21 +75,21 @@ set @@session.debug_dbug= @saved_dbug;
--let $slave_io_errno= 1256, 1595
--source include/wait_for_slave_io_error.inc
--echo # Ensure the replica rejected the event on its recorded length
--echo # Ensure the slave rejected the event on its recorded length
--let $assert_text= The IO thread reported an oversized uncompressed length
--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.2.err
--let $assert_select= Uncompressed data size too large
--let $assert_match= Uncompressed data size too large; the maximum size is 1073741824
--source include/assert_grep.inc
--echo # Move the replica past the corrupt event
--echo # Move the slave past the corrupt event
--source include/stop_slave_sql.inc
--disable_query_log
--eval SET GLOBAL gtid_slave_pos= '$corrupt_gtid_pos'
--enable_query_log
--source include/start_slave.inc
--echo # Ensure replication resumes
--echo # Ensure slavetion resumes
--connection master
insert into t1 values (1);
--source include/save_master_gtid.inc
@@ -122,21 +122,21 @@ set @@session.debug_dbug= @saved_dbug;
--let $slave_io_errno= 1256, 1595
--source include/wait_for_slave_io_error.inc
--echo # Ensure the replica rejected the event on its recorded length
--echo # Ensure the slave rejected the event on its recorded length
--let $assert_text= The IO thread reported an oversized uncompressed length
--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.2.err
--let $assert_select= Uncompressed data size too large
--let $assert_match= Uncompressed data size too large; the maximum size is 1073741824
--source include/assert_grep.inc
--echo # Move the replica past the corrupt event
--echo # Move the slave past the corrupt event
--source include/stop_slave_sql.inc
--disable_query_log
--eval SET GLOBAL gtid_slave_pos= '$corrupt_gtid_pos'
--enable_query_log
--source include/start_slave.inc
--echo # Ensure replication resumes
--echo # Ensure slavetion resumes
--connection master
insert into t1 values (2);
--source include/save_master_gtid.inc

View File

@@ -92,8 +92,10 @@ sync_slave_with_master;
connection master;
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
# The @@slave_max_allowed_packet is configured in .opt to 1024.
# But the slave adds some extra MAX_LOG_EVENT_HEADER bytes.
# So we need a somewhat longer query to exceed the max size.
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2560');
#
# Bug#42914: The slave I/O thread must stop after trying to read the above

View File

@@ -1,51 +0,0 @@
# MDEV-40647 OOB read in IO Thread if the FDEv does not support Rotate Events
--source include/have_debug.inc
--source include/have_binlog_format_mixed.inc # should be format-agnostic
SET @saved_dbug= @@GLOBAL.debug_dbug;
SET @@GLOBAL.debug_dbug= '+d,truncate_fde_post_header_len';
--let $rpl_skip_start_slave= 1
# This setup will also RESET MASTER ...
--source include/master-slave.inc
# ... which means the binlog file is consistent.
--let $binlog_file= master-bin.000001
# Use a specific binlog position to avoid the
# test failing early from other metadata events
--let $binlog_start= query_get_value(SHOW BINLOG STATUS, Position, 1)
# Generate the Rotate Event
FLUSH BINARY LOGS;
# Control: SHOW BINLOG EVENTS fails as expected.
CALL mtr.add_suppression('Found invalid event in binary log');
--disable_query_log
--error ER_ERROR_WHEN_EXECUTING_COMMAND
--eval SHOW BINLOG EVENTS IN '$binlog_file' FROM $binlog_start
--enable_query_log
--connection slave
--disable_query_log
eval CHANGE MASTER TO master_use_gtid=NO,
master_log_file='$binlog_file', master_log_pos=$binlog_start;
--enable_query_log
START SLAVE IO_THREAD;
CALL mtr.add_suppression('Slave I/O: Relay log write failure');
# ER_SLAVE_RELAY_LOG_WRITE_FAILURE
--let $slave_io_errno= 1595
# Experiment: The IO thread should fail.
--source include/wait_for_slave_io_error.inc
# Clean-up
--connection master
SET @@GLOBAL.debug_dbug= @saved_dbug;
RESET MASTER;
--connection slave
CHANGE MASTER TO master_use_gtid=SLAVE_POS; # restore the default
--disable_warnings
SET @@GLOBAL.gtid_slave_pos=''; # for good measure
--enable_warnings
--source include/start_slave.inc
--source include/rpl_end.inc

View File

@@ -1,2 +0,0 @@
--loose-debug-dbug=d,"old_row_based_repl_4_byte_map_id_master"
--log-bin-use-v1-row-events=1

View File

@@ -1,34 +0,0 @@
# This test is to make sure that slaves can read a binlog containining
# table map ids stored in 4 bytes, even though we now store them in 6
# bytes. This is for backward-compatibility.
# If the slave does not detect that the master stores the table map id
# in 4 bytes, slave will read 6 bytes, and so will read the 2 bytes of
# flags at the place where there actually is data, so the test should
# fail.
-- source include/have_binlog_format_row.inc
-- source include/have_debug.inc
-- source include/master-slave.inc
connection master;
--disable_warnings
drop database if exists mysqltest1;
create database mysqltest1;
--enable_warnings
use mysqltest1;
CREATE TABLE t1 (a char(3));
CREATE TABLE t2 (a char(3));
insert into t1 values("ANN");
insert into t1 values("GUI");
insert into t2 values("LIL");
insert into t2 values("ABE");
insert into t2 values("ANG");
sync_slave_with_master;
use mysqltest1;
select * from t1 order by a;
select * from t2 order by a;
connection master;
DROP DATABASE mysqltest1;
sync_slave_with_master;
--source include/rpl_end.inc

File diff suppressed because it is too large Load Diff

View File

@@ -263,16 +263,19 @@ typedef uint32_t rpl_bug_id_t;
1 + 1 + 255 /* type, length, catalog */ + \
1 + 4 /* type, auto_increment */ + \
1 + 6 /* type, charset */ + \
1 + Charset_collation_map_st::binary_size_max() \
/* type, map */ + \
1 + 1 + 255 /* type, length, time_zone */ + \
1 + 1 + 255 + 1/* type, length, catalog, \0 */ + \
1 + 2 /* type, lc_time_names_number */ + \
1 + 2 /* type, charset_database_number */ + \
1 + 8 /* type, table_map_for_update */ + \
1 + 4 /* type, master_data_written */ + \
1 + 1 + 16 + 1 + 60 \
/* type, user_len, user, host_len, host */ + \
1 + 3 /* type, sec_part of NOW() */ + \
1 + 16 + 1 + 60/* type, user_len, user, host_len, host */ + \
1 + 2 + 8 /* type, flags3, seq_no */ + \
1 + Charset_collation_map_st::binary_size_max() \
/* type, map */ \
1 + 8 /* type, (query) xid */ + \
1 + 1 + 8 /* type, flags3, sa_seq_no */ \
)
#define MAX_LOG_EVENT_HEADER ( /* in order of Query_log_event::write */ \
LOG_EVENT_HEADER_LEN + /* write_header */ \
@@ -1574,8 +1577,7 @@ public:
{
return (cache_type == Log_event::EVENT_NO_CACHE);
}
Log_event(const uchar *buf, const Format_description_log_event
*description_event);
Log_event(const uchar *buf, size_t event_len);
virtual ~Log_event() { free_temp_buf();}
void register_temp_buf(uchar* buf, bool must_free)
{
@@ -2262,7 +2264,7 @@ public:
#endif
Query_log_event();
Query_log_event(const uchar *buf, uint event_len,
Query_log_event(const uchar *buf, size_t event_len,
const Format_description_log_event *description_event,
Log_event_type event_type);
~Query_log_event()
@@ -2336,7 +2338,7 @@ class Query_compressed_log_event:public Query_log_event{
protected:
Log_event::Byte* query_buf; // point to the uncompressed query
public:
Query_compressed_log_event(const uchar *buf, uint event_len,
Query_compressed_log_event(const uchar *buf, size_t event_len,
const Format_description_log_event *description_event,
Log_event_type event_type);
~Query_compressed_log_event()
@@ -2436,9 +2438,7 @@ public:
bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override;
#endif
Start_encryption_log_event(const uchar *buf, uint event_len,
const Format_description_log_event
*description_event);
Start_encryption_log_event(const uchar *buf, size_t event_len);
bool is_valid() const override { return crypto_scheme == 1; }
@@ -2478,7 +2478,7 @@ protected:
public:
Version()
{
m_ver[0]= m_ver[1]= m_ver[2]= '\0';
clear();
}
Version(uchar v0, uchar v1, uchar v2)
{
@@ -2487,6 +2487,10 @@ public:
m_ver[2]= v2;
}
Version(const char *version, const char **endptr);
void clear()
{
m_ver[0]= m_ver[1]= m_ver[2]= '\0';
}
const uchar& operator [] (size_t i) const
{
DBUG_ASSERT(i < 3);
@@ -2549,13 +2553,16 @@ public:
LOG_EVENT_HEADER_LEN), except FORMAT_DESCRIPTION_EVENT and ROTATE_EVENT
(those have a header of size LOG_EVENT_MINIMAL_HEADER_LEN).
*/
uint8 common_header_len;
static constexpr uint8 common_header_len= LOG_EVENT_HEADER_LEN;
uint8 number_of_event_types;
/*
The list of post-headers' lengths followed
by the checksum alg description byte
by the checksum alg description byte.
NOTE: This is only to be able to write this data into events for backwards
compatibility. This list is no longer used in new code.
*/
uint8 *post_header_len;
static uint8 byte_data_for_post_header_len[256];
class master_version_split: public Version {
public:
enum {KIND_MYSQL, KIND_MARIADB};
@@ -2569,7 +2576,6 @@ public:
}
};
master_version_split server_version_split;
const uint8 *event_type_permutation;
uint32 options_written_to_bin_log;
/*
The checksum algorithm used in the binlog or relaylog following this
@@ -2578,15 +2584,10 @@ public:
*/
enum_binlog_checksum_alg used_checksum_alg;
Format_description_log_event(uint8 binlog_ver, const char* server_ver= 0,
Format_description_log_event(uint8 binlog_ver, const char* server_ver=0,
enum_binlog_checksum_alg checksum_alg= BINLOG_CHECKSUM_ALG_UNDEF);
Format_description_log_event(const uchar *buf, uint event_len,
const Format_description_log_event
*description_event);
~Format_description_log_event()
{
my_free(post_header_len);
}
Format_description_log_event(const uchar *buf, size_t event_len);
~Format_description_log_event() { }
Log_event_type get_type_code() override { return FORMAT_DESCRIPTION_EVENT;}
my_off_t get_header_len(my_off_t) override
{ return LOG_EVENT_MINIMAL_HEADER_LEN; }
@@ -2598,14 +2599,10 @@ public:
#else
bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override;
#endif
bool header_is_valid() const
{
return common_header_len >= LOG_EVENT_MINIMAL_HEADER_LEN && post_header_len;
}
bool is_valid() const override
{
return header_is_valid() && server_version_split.version_is_valid();
return server_version_split.version_is_valid();
}
int get_data_size() override
@@ -2700,8 +2697,7 @@ Intvar_log_event(THD* thd_arg,uchar type_arg, ulonglong val_arg,
bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override;
#endif
Intvar_log_event(const uchar *buf,
const Format_description_log_event *description_event);
Intvar_log_event(const uchar *buf, size_t event_len);
~Intvar_log_event() = default;
Log_event_type get_type_code() override { return INTVAR_EVENT;}
const char* get_var_type_name();
@@ -2783,8 +2779,7 @@ class Rand_log_event: public Log_event
bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override;
#endif
Rand_log_event(const uchar *buf,
const Format_description_log_event *description_event);
Rand_log_event(const uchar *buf, size_t event_len);
~Rand_log_event() = default;
Log_event_type get_type_code() override { return RAND_EVENT;}
int get_data_size() override { return 16; /* sizeof(ulonglong) * 2*/ }
@@ -2812,9 +2807,8 @@ public:
Xid_apply_log_event(THD* thd_arg):
Log_event(thd_arg, 0, TRUE) {}
#endif
Xid_apply_log_event(const uchar *buf,
const Format_description_log_event *description_event):
Log_event(buf, description_event) {}
Xid_apply_log_event(const uchar *buf, size_t event_len):
Log_event(buf, event_len) {}
~Xid_apply_log_event() = default;
bool is_valid() const override { return 1; }
@@ -2865,8 +2859,7 @@ public:
bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override;
#endif
Xid_log_event(const uchar *buf,
const Format_description_log_event *description_event);
Xid_log_event(const uchar *buf, size_t event_len);
~Xid_log_event() = default;
Log_event_type get_type_code() override { return XID_EVENT;}
int get_data_size() override { return sizeof(xid); }
@@ -3012,8 +3005,7 @@ public:
#else
bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override;
#endif
XA_prepare_log_event(const uchar *buf,
const Format_description_log_event *description_event);
XA_prepare_log_event(const uchar *buf, size_t event_len);
~XA_prepare_log_event() = default;
Log_event_type get_type_code() override { return XA_PREPARE_LOG_EVENT; }
bool is_valid() const override { return m_xid.formatID != -1; }
@@ -3083,8 +3075,7 @@ public:
bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override;
#endif
User_var_log_event(const uchar *buf, uint event_len,
const Format_description_log_event *description_event);
User_var_log_event(const uchar *buf, size_t event_len);
~User_var_log_event() = default;
Log_event_type get_type_code() override { return USER_VAR_EVENT;}
#ifdef MYSQL_SERVER
@@ -3133,9 +3124,8 @@ public:
bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override;
#endif
Stop_log_event(const uchar *buf,
const Format_description_log_event *description_event):
Log_event(buf, description_event)
Stop_log_event(const uchar *buf, size_t event_len):
Log_event(buf, event_len)
{}
~Stop_log_event() = default;
Log_event_type get_type_code() override { return STOP_EVENT;}
@@ -3229,8 +3219,7 @@ public:
bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override;
#endif
Rotate_log_event(const uchar *buf, uint event_len,
const Format_description_log_event* description_event);
Rotate_log_event(const uchar *buf, size_t event_len);
~Rotate_log_event()
{
if (flags & DUP_NAME)
@@ -3268,9 +3257,7 @@ public:
#else
bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override;
#endif
Binlog_checkpoint_log_event(const uchar *buf, uint event_len,
const Format_description_log_event
*description_event);
Binlog_checkpoint_log_event(const uchar *buf, size_t event_len);
~Binlog_checkpoint_log_event() { my_free(binlog_file_name); }
Log_event_type get_type_code() override { return BINLOG_CHECKPOINT_EVENT;}
int get_data_size() override
@@ -3433,8 +3420,7 @@ public:
#else
bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override;
#endif
Gtid_log_event(const uchar *buf, uint event_len,
const Format_description_log_event *description_event);
Gtid_log_event(const uchar *buf, size_t event_len);
~Gtid_log_event() = default;
Log_event_type get_type_code() override { return GTID_EVENT; }
enum_logged_status logged_status() override { return LOGGED_NO_DATA; }
@@ -3462,7 +3448,7 @@ public:
static bool peek(const uchar *event_start, size_t event_len,
enum_binlog_checksum_alg checksum_alg,
uint32 *domain_id, uint32 *server_id, uint64 *seq_no,
uchar *flags2, const Format_description_log_event *fdev);
uchar *flags2);
#endif
};
@@ -3559,8 +3545,7 @@ public:
#else
bool print(FILE *file, PRINT_EVENT_INFO *print_event_info) override;
#endif
Gtid_list_log_event(const uchar *buf, uint event_len,
const Format_description_log_event *description_event);
Gtid_list_log_event(const uchar *buf, size_t event_len);
~Gtid_list_log_event() { my_free(list); my_free(sub_id_list); }
Log_event_type get_type_code() override { return GTID_LIST_EVENT; }
int get_data_size() override {
@@ -3579,9 +3564,8 @@ public:
enum_skip_reason do_shall_skip(rpl_group_info *rgi) override;
#endif
static bool peek(const char *event_start, size_t event_len,
enum_binlog_checksum_alg checksum_alg,
rpl_gtid **out_gtid_list, uint32 *out_list_len,
const Format_description_log_event *fdev);
enum enum_binlog_checksum_alg checksum_alg,
rpl_gtid **out_gtid_list, uint32 *out_list_len);
};
@@ -3619,9 +3603,7 @@ public:
bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) override;
#endif
Append_block_log_event(const uchar *buf, uint event_len,
const Format_description_log_event
*description_event);
Append_block_log_event(const uchar *buf, size_t event_len);
~Append_block_log_event() = default;
Log_event_type get_type_code() override { return APPEND_BLOCK_EVENT;}
int get_data_size() override { return block_len + APPEND_BLOCK_HEADER_LEN ;}
@@ -3661,8 +3643,7 @@ public:
bool enable_local);
#endif
Delete_file_log_event(const uchar *buf, uint event_len,
const Format_description_log_event* description_event);
Delete_file_log_event(const uchar *buf, size_t event_len);
~Delete_file_log_event() = default;
Log_event_type get_type_code() override { return DELETE_FILE_EVENT;}
int get_data_size() override { return DELETE_FILE_HEADER_LEN ;}
@@ -3700,9 +3681,7 @@ public:
int get_create_or_append() const override;
#endif /* HAVE_REPLICATION */
#endif
Begin_load_query_log_event(const uchar *buf, uint event_len,
const Format_description_log_event
*description_event);
Begin_load_query_log_event(const uchar *buf, size_t event_len);
~Begin_load_query_log_event() = default;
Log_event_type get_type_code() override { return BEGIN_LOAD_QUERY_EVENT; }
private:
@@ -3758,7 +3737,7 @@ public:
bool print(FILE* file, PRINT_EVENT_INFO* print_event_info,
const char *local_fname);
#endif
Execute_load_query_log_event(const uchar *buf, uint event_len,
Execute_load_query_log_event(const uchar *buf, size_t event_len,
const Format_description_log_event
*description_event);
~Execute_load_query_log_event() = default;
@@ -3788,14 +3767,8 @@ class Unknown_log_event: public Log_event
{
public:
enum { UNKNOWN, ENCRYPTED } what;
/*
Even if this is an unknown event, we still pass description_event to
Log_event's ctor, this way we can extract maximum information from the
event's header (the unique ID for example).
*/
Unknown_log_event(const uchar *buf,
const Format_description_log_event *description_event):
Log_event(buf, description_event), what(UNKNOWN)
Unknown_log_event(const uchar *buf, size_t event_len):
Log_event(buf, event_len), what(UNKNOWN)
{}
/* constructor for hopelessly corrupted events */
Unknown_log_event(): Log_event(), what(ENCRYPTED) {}
@@ -3825,8 +3798,7 @@ public:
#ifndef MYSQL_CLIENT
Annotate_rows_log_event(THD*, bool using_trans, bool direct);
#endif
Annotate_rows_log_event(const uchar *buf, uint event_len,
const Format_description_log_event*);
Annotate_rows_log_event(const uchar *buf, size_t event_len);
~Annotate_rows_log_event();
int get_data_size() override;
@@ -4480,8 +4452,7 @@ public:
bool is_transactional);
#endif
#ifdef HAVE_REPLICATION
Table_map_log_event(const uchar *buf, uint event_len,
const Format_description_log_event *description_event);
Table_map_log_event(const uchar *buf, size_t event_len);
#endif
~Table_map_log_event();
@@ -4492,8 +4463,7 @@ public:
return new table_def(m_coltype, m_colcnt, m_field_metadata,
m_field_metadata_size, m_null_bits, m_flags);
}
int rewrite_db(const char* new_name, size_t new_name_len,
const Format_description_log_event*);
int rewrite_db(const char* new_name, size_t new_name_len);
#endif
ulonglong get_table_id() const { return m_table_id; }
const char *get_table_name() const { return m_tblnam; }
@@ -4817,8 +4787,7 @@ protected:
MY_BITMAP const *cols, bool is_transactional,
Log_event_type event_type);
#endif
Rows_log_event(const uchar *row_data, uint event_len,
const Format_description_log_event *description_event);
Rows_log_event(const uchar *row_data, size_t event_len);
void uncompress_buf();
#ifdef MYSQL_CLIENT
@@ -5047,8 +5016,7 @@ public:
bool is_transactional);
#endif
#ifdef HAVE_REPLICATION
Write_rows_log_event(const uchar *buf, uint event_len,
const Format_description_log_event *description_event);
Write_rows_log_event(const uchar *buf, uint event_len);
#endif
#if defined(MYSQL_SERVER)
static bool binlog_row_logging_function(THD *thd, TABLE *table,
@@ -5102,8 +5070,7 @@ public:
bool write(Log_event_writer *writer) override;
#endif
#ifdef HAVE_REPLICATION
Write_rows_compressed_log_event(const uchar *buf, uint event_len,
const Format_description_log_event *description_event);
Write_rows_compressed_log_event(const uchar *buf, uint event_len);
#endif
private:
#if defined(MYSQL_CLIENT)
@@ -5139,8 +5106,7 @@ public:
~Update_rows_log_event() override;
#ifdef HAVE_REPLICATION
Update_rows_log_event(const uchar *buf, uint event_len,
const Format_description_log_event *description_event);
Update_rows_log_event(const uchar *buf, uint event_len);
#endif
#ifdef MYSQL_SERVER
@@ -5192,8 +5158,7 @@ public:
bool write(Log_event_writer *writer) override;
#endif
#ifdef HAVE_REPLICATION
Update_rows_compressed_log_event(const uchar *buf, uint event_len,
const Format_description_log_event *description_event);
Update_rows_compressed_log_event(const uchar *buf, uint event_len);
#endif
private:
#if defined(MYSQL_CLIENT)
@@ -5231,8 +5196,7 @@ public:
Delete_rows_log_event(THD*, TABLE*, ulonglong, bool is_transactional);
#endif
#ifdef HAVE_REPLICATION
Delete_rows_log_event(const uchar *buf, uint event_len,
const Format_description_log_event *description_event);
Delete_rows_log_event(const uchar *buf, uint event_len);
#endif
#ifdef MYSQL_SERVER
static bool binlog_row_logging_function(THD *thd, TABLE *table,
@@ -5284,8 +5248,7 @@ public:
bool write(Log_event_writer *writer) override;
#endif
#ifdef HAVE_REPLICATION
Delete_rows_compressed_log_event(const uchar *buf, uint event_len,
const Format_description_log_event *description_event);
Delete_rows_compressed_log_event(const uchar *buf, uint event_len);
#endif
private:
#if defined(MYSQL_CLIENT)
@@ -5377,8 +5340,7 @@ public:
bool write_data_body(Log_event_writer *writer) override;
#endif
Incident_log_event(const uchar *buf, uint event_len,
const Format_description_log_event *descr_event);
Incident_log_event(const uchar *buf, size_t event_len);
virtual ~Incident_log_event();
@@ -5440,8 +5402,8 @@ public:
}
#endif
Ignorable_log_event(const uchar *buf,
const Format_description_log_event *descr_event,
Ignorable_log_event(const uchar *buf, size_t event_len,
Log_event_type event_type,
const char *event_name);
virtual ~Ignorable_log_event();
@@ -5493,8 +5455,7 @@ class Heartbeat_log_event: public Log_event
{
public:
uint8 hb_flags;
Heartbeat_log_event(const uchar *buf, uint event_len,
const Format_description_log_event* description_event);
Heartbeat_log_event(const uchar *buf, uint event_len);
Log_event_type get_type_code() override { return HEARTBEAT_LOG_EVENT; }
bool is_valid() const override
{
@@ -5545,16 +5506,13 @@ int binlog_buf_compress(const uchar *src, uchar *dst, uint32 len,
int binlog_buf_uncompress(const uchar *src, uchar *dst, uint32 len,
uint32 *newlen);
uint32 binlog_get_compress_len(uint32 len);
uint32 binlog_get_uncompress_len(const uchar *buf);
uint32 binlog_get_uncompress_len(const uchar *buf, size_t buf_len);
int query_event_uncompress(const Format_description_log_event *description_event,
bool contain_checksum,
int query_event_uncompress(bool contain_checksum,
const uchar *src, ulong src_len, uchar *buf,
ulong buf_size, bool* is_malloc,
uchar **dst, ulong *newlen);
int row_log_event_uncompress(const Format_description_log_event
*description_event,
bool contain_checksum,
int row_log_event_uncompress(bool contain_checksum,
const uchar *src, ulong src_len,
uchar* buf, ulong buf_size, bool *is_malloc,
uchar **dst, ulong *newlen);

View File

@@ -1701,32 +1701,27 @@ bool Log_event::print_base64(IO_CACHE* file,
switch (ev_type) {
case WRITE_ROWS_EVENT:
ptr[EVENT_TYPE_OFFSET]= DELETE_ROWS_EVENT;
ev= new Delete_rows_log_event(ptr, tmp_size,
glob_description_event);
ev= new Delete_rows_log_event(ptr, tmp_size);
ev->change_to_flashback_event(print_event_info, ptr, ev_type);
break;
case WRITE_ROWS_EVENT_V1:
ptr[EVENT_TYPE_OFFSET]= DELETE_ROWS_EVENT_V1;
ev= new Delete_rows_log_event(ptr, tmp_size,
glob_description_event);
ev= new Delete_rows_log_event(ptr, tmp_size);
ev->change_to_flashback_event(print_event_info, ptr, ev_type);
break;
case DELETE_ROWS_EVENT:
ptr[EVENT_TYPE_OFFSET]= WRITE_ROWS_EVENT;
ev= new Write_rows_log_event(ptr, tmp_size,
glob_description_event);
ev= new Write_rows_log_event(ptr, tmp_size);
ev->change_to_flashback_event(print_event_info, ptr, ev_type);
break;
case DELETE_ROWS_EVENT_V1:
ptr[EVENT_TYPE_OFFSET]= WRITE_ROWS_EVENT_V1;
ev= new Write_rows_log_event(ptr, tmp_size,
glob_description_event);
ev= new Write_rows_log_event(ptr, tmp_size);
ev->change_to_flashback_event(print_event_info, ptr, ev_type);
break;
case UPDATE_ROWS_EVENT:
case UPDATE_ROWS_EVENT_V1:
ev= new Update_rows_log_event(ptr, tmp_size,
glob_description_event);
ev= new Update_rows_log_event(ptr, tmp_size);
ev->change_to_flashback_event(print_event_info, ptr, ev_type);
break;
default:
@@ -1772,8 +1767,7 @@ bool Log_event::print_base64(IO_CACHE* file,
case TABLE_MAP_EVENT:
{
Table_map_log_event *map;
map= new Table_map_log_event(ptr, size,
glob_description_event);
map= new Table_map_log_event(ptr, size);
#ifdef WHEN_FLASHBACK_REVIEW_READY
if (need_flashback_review)
{
@@ -1787,43 +1781,37 @@ bool Log_event::print_base64(IO_CACHE* file,
case WRITE_ROWS_EVENT:
case WRITE_ROWS_EVENT_V1:
{
ev= new Write_rows_log_event(ptr, size,
glob_description_event);
ev= new Write_rows_log_event(ptr, size);
break;
}
case DELETE_ROWS_EVENT:
case DELETE_ROWS_EVENT_V1:
{
ev= new Delete_rows_log_event(ptr, size,
glob_description_event);
ev= new Delete_rows_log_event(ptr, size);
break;
}
case UPDATE_ROWS_EVENT:
case UPDATE_ROWS_EVENT_V1:
{
ev= new Update_rows_log_event(ptr, size,
glob_description_event);
ev= new Update_rows_log_event(ptr, size);
break;
}
case WRITE_ROWS_COMPRESSED_EVENT:
case WRITE_ROWS_COMPRESSED_EVENT_V1:
{
ev= new Write_rows_compressed_log_event(ptr, size,
glob_description_event);
ev= new Write_rows_compressed_log_event(ptr, size);
break;
}
case UPDATE_ROWS_COMPRESSED_EVENT:
case UPDATE_ROWS_COMPRESSED_EVENT_V1:
{
ev= new Update_rows_compressed_log_event(ptr, size,
glob_description_event);
ev= new Update_rows_compressed_log_event(ptr, size);
break;
}
case DELETE_ROWS_COMPRESSED_EVENT:
case DELETE_ROWS_COMPRESSED_EVENT_V1:
{
ev= new Delete_rows_compressed_log_event(ptr, size,
glob_description_event);
ev= new Delete_rows_compressed_log_event(ptr, size);
break;
}
default:
@@ -3084,13 +3072,12 @@ err:
other - Error
*/
int Table_map_log_event::rewrite_db(const char* new_db, size_t new_len,
const Format_description_log_event* desc)
int Table_map_log_event::rewrite_db(const char* new_db, size_t new_len)
{
DBUG_ENTER("Table_map_log_event::rewrite_db");
DBUG_ASSERT(temp_buf);
uint header_len= MY_MIN(desc->common_header_len,
uint header_len= MY_MIN(Format_description_log_event::common_header_len,
LOG_EVENT_MINIMAL_HEADER_LEN) + TABLE_MAP_HEADER_LEN;
int len_diff;
@@ -3617,8 +3604,7 @@ bool Write_rows_compressed_log_event::print(FILE *file,
uchar *new_buf;
ulong len;
bool is_malloc = false;
if(!row_log_event_uncompress(glob_description_event,
read_checksum_alg == BINLOG_CHECKSUM_ALG_CRC32,
if(!row_log_event_uncompress(read_checksum_alg == BINLOG_CHECKSUM_ALG_CRC32,
temp_buf, UINT_MAX32, NULL, 0, &is_malloc,
&new_buf, &len))
{
@@ -3654,8 +3640,7 @@ bool Delete_rows_compressed_log_event::print(FILE *file,
uchar *new_buf;
ulong len;
bool is_malloc = false;
if(!row_log_event_uncompress(glob_description_event,
read_checksum_alg == BINLOG_CHECKSUM_ALG_CRC32,
if(!row_log_event_uncompress(read_checksum_alg == BINLOG_CHECKSUM_ALG_CRC32,
temp_buf, UINT_MAX32, NULL, 0, &is_malloc,
&new_buf, &len))
{
@@ -3691,8 +3676,7 @@ Update_rows_compressed_log_event::print(FILE *file,
uchar *new_buf;
ulong len;
bool is_malloc= false;
if(!row_log_event_uncompress(glob_description_event,
read_checksum_alg == BINLOG_CHECKSUM_ALG_CRC32,
if(!row_log_event_uncompress(read_checksum_alg == BINLOG_CHECKSUM_ALG_CRC32,
temp_buf, UINT_MAX32, NULL, 0, &is_malloc,
&new_buf, &len))
{

View File

@@ -2389,7 +2389,8 @@ Query_log_event::peek_is_commit_rollback(const uchar *event_start,
DBUG_ASSERT(checksum_alg == BINLOG_CHECKSUM_ALG_UNDEF ||
checksum_alg == BINLOG_CHECKSUM_ALG_OFF);
if (event_len < LOG_EVENT_HEADER_LEN + QUERY_HEADER_LEN || event_len < 9)
if (unlikely(event_len < LOG_EVENT_HEADER_LEN + QUERY_HEADER_LEN ||
event_len < 9))
return false;
return !memcmp(event_start + (event_len-7), "\0COMMIT", 7) ||
!memcmp(event_start + (event_len-9), "\0ROLLBACK", 9);
@@ -2461,7 +2462,7 @@ bool Format_description_log_event::write(Log_event_writer *writer)
ret= write_header(writer, rec_size) ||
write_data(writer, buff, buff_size) ||
(!DBUG_IF("truncate_fde_post_header_len") &&
write_data(writer, post_header_len, number_of_event_types)) ||
write_data(writer, byte_data_for_post_header_len, number_of_event_types)) ||
(!DBUG_IF("truncate_fde_used_checksum_alg") &&
write_data(writer, &checksum_byte, sizeof(checksum_byte))) ||
write_footer(writer);
@@ -2945,7 +2946,7 @@ bool
Gtid_log_event::peek(const uchar *event_start, size_t event_len,
enum_binlog_checksum_alg checksum_alg,
uint32 *domain_id, uint32 *server_id, uint64 *seq_no,
uchar *flags2, const Format_description_log_event *fdev)
uchar *flags2)
{
const uchar *p;
@@ -2960,10 +2961,12 @@ Gtid_log_event::peek(const uchar *event_start, size_t event_len,
DBUG_ASSERT(checksum_alg == BINLOG_CHECKSUM_ALG_UNDEF ||
checksum_alg == BINLOG_CHECKSUM_ALG_OFF);
if (event_len < (uint32)fdev->common_header_len + GTID_HEADER_LEN)
if (unlikely(event_len <
(uint32)Format_description_log_event::common_header_len +
GTID_HEADER_LEN))
return true;
*server_id= uint4korr(event_start + SERVER_ID_OFFSET);
p= event_start + fdev->common_header_len;
p= event_start + Format_description_log_event::common_header_len;
*seq_no= uint8korr(p);
p+= 8;
*domain_id= uint4korr(p);
@@ -8148,12 +8151,12 @@ void Ignorable_log_event::pack_info(Protocol *protocol)
#endif
#if defined(HAVE_REPLICATION)
Heartbeat_log_event::Heartbeat_log_event(const uchar *buf, uint event_len,
const Format_description_log_event* description_event)
:Log_event(buf, description_event), ident_len(0), log_ident(NULL)
Heartbeat_log_event::Heartbeat_log_event(const uchar *buf, uint event_len)
:Log_event(buf, event_len), ident_len(0), log_ident(NULL)
{
uint8 header_size= Format_description_log_event::common_header_len;
uint sub_header_len= (log_pos == 0) ? HB_SUB_HEADER_LEN : 0;
uint all_headers_len= description_event->common_header_len + sub_header_len;
uint all_headers_len= header_size + sub_header_len;
/*
The comparison is <= rather than <, so an event whose length stops exactly
@@ -8174,7 +8177,7 @@ Heartbeat_log_event::Heartbeat_log_event(const uchar *buf, uint event_len,
return;
if (log_pos == 0)
log_pos= uint8korr(buf + description_event->common_header_len);
log_pos= uint8korr(buf + header_size);
log_ident= buf + all_headers_len;
ident_len= event_len - all_headers_len;

View File

@@ -145,8 +145,7 @@ typedef struct st_rows_event_tracker
my_off_t last_seen;
bool stmt_end_seen;
void update(const char *file_name, my_off_t pos,
const uchar *buf,
const Format_description_log_event *fdle);
const uchar *buf);
void reset();
bool check_and_report(const char* file_name, my_off_t pos);
} Rows_event_tracker;

View File

@@ -6503,17 +6503,6 @@ static int queue_event(Master_info* mi, const uchar *buf, ulong event_len)
goto err;
case ROTATE_EVENT:
{
/*
This is normally done in Log_event::read_log_event(),
but we bypass it here because it's expensive and costs dynamic memory.
*/
if (unlikely(ROTATE_EVENT >
mi->rli.relay_log.description_event_for_queue->number_of_event_types))
{
// The current FDE does not support `ROTATE_EVENT`.
error= ER_SLAVE_RELAY_LOG_WRITE_FAILURE;
goto err;
}
/*
RSC_1 and RSC_2 below rewrite the fake Rotate (the one that opens a
connection, naming the binary log file the dump starts in; the file
@@ -6555,8 +6544,7 @@ static int queue_event(Master_info* mi, const uchar *buf, ulong event_len)
}
Rotate_log_event rev(buf, event_has_checksum ?
event_len - BINLOG_CHECKSUM_LEN : event_len,
mi->rli.relay_log.description_event_for_queue);
event_len - BINLOG_CHECKSUM_LEN : event_len);
bool master_changed= false;
bool maybe_crashed= false;
// Exclude server start scenario
@@ -6785,8 +6773,7 @@ static int queue_event(Master_info* mi, const uchar *buf, ulong event_len)
Heartbeat_log_event hb(buf,
mi->rli.relay_log.relay_log_checksum_alg
!= BINLOG_CHECKSUM_ALG_OFF ?
event_len - BINLOG_CHECKSUM_LEN : event_len,
mi->rli.relay_log.description_event_for_queue);
event_len - BINLOG_CHECKSUM_LEN : event_len);
if (!hb.is_valid())
{
error= ER_SLAVE_HEARTBEAT_FAILURE;
@@ -6906,8 +6893,7 @@ static int queue_event(Master_info* mi, const uchar *buf, ulong event_len)
if (Gtid_log_event::peek(buf, event_len, checksum_alg,
&event_gtid.domain_id, &event_gtid.server_id,
&event_gtid.seq_no, &gtid_flag,
rli->relay_log.description_event_for_queue))
&event_gtid.seq_no, &gtid_flag))
{
error= ER_SLAVE_RELAY_LOG_WRITE_FAILURE;
goto err;
@@ -7089,8 +7075,7 @@ dbug_gtid_accept:
case QUERY_COMPRESSED_EVENT:
inc_pos= event_len;
if ((error=
query_event_uncompress(rli->relay_log.description_event_for_queue,
checksum_alg == BINLOG_CHECKSUM_ALG_CRC32,
query_event_uncompress(checksum_alg == BINLOG_CHECKSUM_ALG_CRC32,
buf, event_len, new_buf_arr,
sizeof(new_buf_arr),
&is_malloc, &new_buf, &event_len)))
@@ -7114,8 +7099,7 @@ dbug_gtid_accept:
inc_pos = event_len;
{
if ((error=
row_log_event_uncompress(rli->relay_log.description_event_for_queue,
checksum_alg == BINLOG_CHECKSUM_ALG_CRC32,
row_log_event_uncompress(checksum_alg == BINLOG_CHECKSUM_ALG_CRC32,
buf, event_len, new_buf_arr,
sizeof(new_buf_arr),
&is_malloc, &new_buf, &event_len)))
@@ -7146,9 +7130,7 @@ dbug_gtid_accept:
is_rows_event= true;
mi->rows_event_tracker.update(mi->master_log_name,
mi->master_log_pos,
buf,
mi->rli.relay_log.
description_event_for_queue);
buf);
DBUG_EXECUTE_IF("simulate_stmt_end_rows_event_loss",
{
@@ -8347,19 +8329,16 @@ bool rpl_master_erroneous_autoinc(THD *thd)
}
static bool get_row_event_stmt_end(const uchar *buf,
const Format_description_log_event *fdle)
static bool get_row_event_stmt_end(const uchar *buf)
{
uint8 const common_header_len= fdle->common_header_len;
Log_event_type event_type= (Log_event_type)(uchar)buf[EVENT_TYPE_OFFSET];
uint8 const post_header_len= fdle->post_header_len[event_type-1];
uint8 const common_header_len=
Format_description_log_event::common_header_len;
const uchar *flag_start= buf + common_header_len;
/*
The term 4 below signifies that master is of 'an intermediate source', see
Rows_log_event::Rows_log_event.
*/
flag_start += RW_MAPID_OFFSET + ((post_header_len == 6) ? 4 : RW_FLAGS_OFFSET);
flag_start += RW_MAPID_OFFSET + RW_FLAGS_OFFSET;
return (uint2korr(flag_start) & Rows_log_event::STMT_END_F) != 0;
}
@@ -8385,8 +8364,7 @@ void Rows_event_tracker::reset()
*/
void Rows_event_tracker::update(const char *file_name, my_off_t pos,
const uchar *buf,
const Format_description_log_event *fdle)
const uchar *buf)
{
DBUG_ENTER("Rows_event_tracker::update");
if (!first_seen)
@@ -8396,7 +8374,7 @@ void Rows_event_tracker::update(const char *file_name, my_off_t pos,
}
last_seen= pos;
DBUG_ASSERT(stmt_end_seen == 0); // We can only have one
stmt_end_seen= get_row_event_stmt_end(buf, fdle);
stmt_end_seen= get_row_event_stmt_end(buf);
DBUG_VOID_RETURN;
};

View File

@@ -36,23 +36,6 @@ static int check_event_type(int type, Relay_log_info *rli)
{
Format_description_log_event *fd_event=
rli->relay_log.description_event_for_exec;
/*
Convert event type id of certain old versions (see comment in
Format_description_log_event::Format_description_log_event(char*,...)).
*/
if (fd_event && fd_event->event_type_permutation)
{
#ifdef DBUG_TRACE
int new_type= fd_event->event_type_permutation[type];
DBUG_PRINT("info",
("converting event type %d to %d (%s)",
type, new_type,
Log_event::get_type_str((Log_event_type)new_type)));
#endif
type= fd_event->event_type_permutation[type];
}
switch (type)
{
case START_EVENT_V3:

View File

@@ -1746,8 +1746,7 @@ gtid_state_from_pos(const char *name, uint32 offset,
if (unlikely(get_checksum_alg((uchar*) packet.ptr(), packet.length(),
&current_checksum_alg) ||
!(tmp= new Format_description_log_event((uchar*)packet.ptr(),
packet.length(),
fdev))))
packet.length()))))
{
errormsg= "Corrupt Format_description event found or out-of-memory "
"while searching for old-style position in binlog";
@@ -1763,7 +1762,7 @@ gtid_state_from_pos(const char *name, uint32 offset,
{
sele_len -= BINLOG_CHECKSUM_LEN;
}
Start_encryption_log_event sele((uchar*) packet.ptr(), sele_len, fdev);
Start_encryption_log_event sele((uchar*) packet.ptr(), sele_len);
if (fdev->start_decryption(&sele))
{
errormsg= "Could not start decryption of binlog.";
@@ -1813,7 +1812,7 @@ gtid_state_from_pos(const char *name, uint32 offset,
}
status= Gtid_list_log_event::peek(packet.ptr(), packet.length(),
current_checksum_alg,
&gtid_list, &list_len, fdev);
&gtid_list, &list_len);
if (unlikely(status))
{
errormsg= "Error reading Gtid_list_log_event while searching "
@@ -1841,8 +1840,7 @@ gtid_state_from_pos(const char *name, uint32 offset,
uchar flags2;
if (unlikely(Gtid_log_event::peek((uchar*) packet.ptr(), packet.length(),
current_checksum_alg, &gtid.domain_id,
&gtid.server_id, &gtid.seq_no, &flags2,
fdev)))
&gtid.server_id, &gtid.seq_no, &flags2)))
{
errormsg= "Corrupt gtid_log_event found while scanning binlog to find "
"initial slave position";
@@ -1979,7 +1977,7 @@ send_event_to_slave(binlog_send_info *info, Log_event_type event_type,
if (ev_offset > len ||
Gtid_list_log_event::peek(packet->ptr()+ev_offset, len - ev_offset,
current_checksum_alg,
&gtid_list, &list_len, info->fdev))
&gtid_list, &list_len))
{
info->error= ER_MASTER_FATAL_ERROR_READING_BINLOG;
return "Failed to read Gtid_list_log_event: corrupt binlog";
@@ -2008,7 +2006,7 @@ send_event_to_slave(binlog_send_info *info, Log_event_type event_type,
Gtid_log_event::peek((uchar*) packet->ptr()+ev_offset, len - ev_offset,
current_checksum_alg,
&event_gtid.domain_id, &event_gtid.server_id,
&event_gtid.seq_no, &flags2, info->fdev))
&event_gtid.seq_no, &flags2))
{
info->error= ER_MASTER_FATAL_ERROR_READING_BINLOG;
return "Failed to read Gtid_log_event: corrupt binlog";
@@ -2774,7 +2772,7 @@ static int send_format_descriptor_event(binlog_send_info *info, IO_CACHE *log,
Format_description_log_event *tmp;
if (!(tmp= new Format_description_log_event((uchar*) packet->ptr() + ev_offset,
ev_len, info->fdev)))
ev_len)))
{
info->error= ER_MASTER_FATAL_ERROR_READING_BINLOG;
info->errmsg= CORRUPT_FDE;