Skip to content

Commit

Permalink
MDEV-23842 Atomic RENAME TABLE
Browse files Browse the repository at this point in the history
- Major rewrite of ddl_log.cc and ddl_log.h
  - ddl_log.cc described in the beginning how the recovery works.
  - ddl_log.log has unique signature and is dynamic. It's easy to
    add more information to the header and other ddl blocks while still
    being able to execute old ddl entries.
  - IO_SIZE for ddl blocks is now dynamic. Can be changed without affecting
    recovery of old logs.
  - Code is more modular and is now usable outside of partition handling.
  - Renamed log file to dll_recovery.log and added option --log-ddl-recovery
    to allow one to specify the path & filename.
- Added ddl_log_entry_phase[], number of phases for each DDL action,
  which allowed me to greatly simply set_global_from_ddl_log_entry()
- Changed how strings are stored in log entries, which allows us to
  store much more information in a log entry.
- ddl log is now always created at start and deleted on normal shutdown.
  This simplices things notable.
- Added probes debug_crash_here() and debug_simulate_error() to simply
  crash testing and allow crash after a given number of times a probe
  is executed. See comments in debug_sync.cc and rename_table.test for
  how this can be used.
- Reverting failed table and view renames is done trough the ddl log.
  This ensures that the ddl log is tested also outside of recovery.
- Added helper function 'handler::needs_lower_case_filenames()'
- Extend binary log with Q_XID events. ddl log handling is using this
  to check if a ddl log entry was logged to the binary log (if yes,
  it will be deleted from the log during ddl_log_close_binlogged_events()
- If a DDL entry fails 3 time, disable it. This is to ensure that if
  we have a crash in ddl recovery code the server will not get stuck
  in a forever crash-restart-crash loop.

mysqltest.cc changes:
- --die will now replace $variables with their values
- $error will contain the error of the last failed statement

storage engine changes:
- maria_rename() was changed to be more robust against crashes during
  rename.
  • Loading branch information
montywi authored and vuvova committed May 19, 2021
1 parent 55c771b commit 47010cc
Show file tree
Hide file tree
Showing 69 changed files with 4,096 additions and 1,378 deletions.
25 changes: 22 additions & 3 deletions client/mysqltest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8096,9 +8096,10 @@ void handle_error(struct st_command *command,
const char *err_sqlstate, DYNAMIC_STRING *ds)
{
int i;

DBUG_ENTER("handle_error");

var_set_int("$errno", err_errno);

command->used_replace= 1;
if (command->require_file)
{
Expand Down Expand Up @@ -9694,10 +9695,28 @@ int main(int argc, char **argv)
report_or_die("Parsing is already enabled");
break;
case Q_DIE:
{
char message[160];
const char *msg;
DYNAMIC_STRING ds_echo;

if (command->first_argument[0])
{
/* Evaluate variables in the message */
init_dynamic_string(&ds_echo, "", command->query_len, 256);
do_eval(&ds_echo, command->first_argument, command->end, FALSE);
strmake(message, ds_echo.str, MY_MIN(sizeof(message)-1,
ds_echo.length));
dynstr_free(&ds_echo);
msg= message;
}
else
msg= "Explicit --die command executed";

/* Abort test with error code and error message */
die("%s", command->first_argument[0] ? command->first_argument :
"Explicit --die command executed");
die("%s", msg);
break;
}
case Q_EXIT:
/* Stop processing any more commands */
abort_flag= 1;
Expand Down
6 changes: 5 additions & 1 deletion libmysqld/lib_sql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,11 @@ int init_embedded_server(int argc, char **argv, char **groups)
}
}

ddl_log_execute_recovery();
if (ddl_log_execute_recovery() > 0)
{
mysql_server_end();
return 1;
}
mysql_embedded_init= 1;
return 0;
}
Expand Down
24 changes: 12 additions & 12 deletions mysql-test/main/mysqlbinlog.result
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ AAAAAAAAAAAAAAAAAAAgrgJSFzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
# 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
# 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.sql_if_exists=0/*!*/;
Expand All @@ -994,7 +994,7 @@ create table test.t1 (id int not null)
# 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
# Event: Query thread_id=1 exec_time=0 error_code=0 xid=0
SET TIMESTAMP=1375907366/*!*/;
insert into test.t1 (id) values (1)
/*!*/;
Expand All @@ -1009,7 +1009,7 @@ insert into test.t1 (id) values (1)
# 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
# Event: Query thread_id=1 exec_time=0 error_code=0 xid=0
SET TIMESTAMP=1375907368/*!*/;
drop table test.t1
/*!*/;
Expand Down Expand Up @@ -1053,7 +1053,7 @@ AAAAAAAAAAAAAAAAAAA/rQJSGzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
# 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
# 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.sql_if_exists=0/*!*/;
Expand All @@ -1077,7 +1077,7 @@ create table test.t1 (id int not null)
# 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
# Event: Query thread_id=1 exec_time=0 error_code=0 xid=0
SET TIMESTAMP=1375907144/*!*/;
insert into test.t1 (id) values (1)
/*!*/;
Expand All @@ -1092,7 +1092,7 @@ insert into test.t1 (id) values (1)
# 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
# Event: Query thread_id=1 exec_time=0 error_code=0 xid=0
SET TIMESTAMP=1375907148/*!*/;
drop table test.t1
/*!*/;
Expand Down Expand Up @@ -1136,7 +1136,7 @@ AAAAAAAAAAAAAAAAAAAnrAJSHzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
# 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
# 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.sql_if_exists=0/*!*/;
Expand All @@ -1160,7 +1160,7 @@ create table test.t1 (id int not null)
# 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
# Event: Query thread_id=1 exec_time=0 error_code=0 xid=0
SET TIMESTAMP=1375906891/*!*/;
insert into test.t1 (id) values (1)
/*!*/;
Expand All @@ -1175,7 +1175,7 @@ insert into test.t1 (id) values (1)
# 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
# Event: Query thread_id=1 exec_time=0 error_code=0 xid=0
SET TIMESTAMP=1375906901/*!*/;
drop table test.t1
/*!*/;
Expand Down Expand Up @@ -1219,7 +1219,7 @@ AAAAAAAAAAAAAAAAAABbsAJSEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
# ad 61 62 6c 65 20 74 65 73 74 2e 74 31 20 28 69 64 |able test.t1 (id|
# bd 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
# Event: Query thread_id=1 exec_time=0 error_code=0 xid=0
SET TIMESTAMP=1375907933/*!*/;
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.sql_if_exists=0/*!*/;
Expand All @@ -1243,7 +1243,7 @@ create table test.t1 (id int not null)
# 10e 6e 74 6f 20 74 65 73 74 2e 74 31 20 28 69 64 29 |nto test.t1 (id)|
# 11e 20 76 61 6c 75 65 73 20 28 31 29 | values (1)|
#
# Event: Query thread_id=1 exec_time=0 error_code=0
# Event: Query thread_id=1 exec_time=0 error_code=0 xid=0
SET TIMESTAMP=1375907935/*!*/;
insert into test.t1 (id) values (1)
/*!*/;
Expand All @@ -1258,7 +1258,7 @@ insert into test.t1 (id) values (1)
# 15c 04 08 00 08 00 08 00 00 64 72 6f 70 20 74 61 62 |........drop tab|
# 16c 6c 65 20 74 65 73 74 2e 74 31 |le test.t1|
#
# Event: Query thread_id=1 exec_time=0 error_code=0
# Event: Query thread_id=1 exec_time=0 error_code=0 xid=0
SET TIMESTAMP=1375907937/*!*/;
drop table test.t1
/*!*/;
Expand Down
20 changes: 10 additions & 10 deletions mysql-test/main/mysqlbinlog_row_compressed.result
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ROLLBACK/*!*/;
/*!100001 SET @@session.server_id=1*//*!*/;
/*!100001 SET @@session.gtid_seq_no=1*//*!*/;
# at 371
#<date> server id 1 end_log_pos 533 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0
#<date> server id 1 end_log_pos 533 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0 xid=<xid>
use `test`/*!*/;
SET TIMESTAMP=X/*!*/;
SET @@session.pseudo_thread_id=5/*!*/;
Expand All @@ -46,7 +46,7 @@ CREATE TABLE t1 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 TINYINT, f4 MEDIUMINT, f
#<date> server id 1 end_log_pos 575 CRC32 XXX GTID 0-1-2 ddl
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
# at 575
#<date> server id 1 end_log_pos 727 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0
#<date> server id 1 end_log_pos 727 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0 xid=<xid>
SET TIMESTAMP=X/*!*/;
CREATE TABLE t2 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 INT, f4 INT, f5 MEDIUMINT, f6 INT, f7 INT, f8 char(1))
/*!*/;
Expand Down Expand Up @@ -75,7 +75,7 @@ START TRANSACTION
### @9='' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# Number of rows: 1
# at 967
#<date> server id 1 end_log_pos 1040 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
#<date> server id 1 end_log_pos 1040 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 xid=<xid>
SET TIMESTAMP=X/*!*/;
COMMIT
/*!*/;
Expand Down Expand Up @@ -104,7 +104,7 @@ START TRANSACTION
### @9=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
# Number of rows: 1
# at 1281
#<date> server id 1 end_log_pos 1354 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
#<date> server id 1 end_log_pos 1354 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 xid=<xid>
SET TIMESTAMP=X/*!*/;
COMMIT
/*!*/;
Expand Down Expand Up @@ -133,7 +133,7 @@ START TRANSACTION
### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# Number of rows: 1
# at 1596
#<date> server id 1 end_log_pos 1669 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
#<date> server id 1 end_log_pos 1669 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 xid=<xid>
SET TIMESTAMP=X/*!*/;
COMMIT
/*!*/;
Expand Down Expand Up @@ -162,7 +162,7 @@ START TRANSACTION
### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# Number of rows: 1
# at 1909
#<date> server id 1 end_log_pos 1982 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
#<date> server id 1 end_log_pos 1982 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 xid=<xid>
SET TIMESTAMP=X/*!*/;
COMMIT
/*!*/;
Expand Down Expand Up @@ -224,7 +224,7 @@ START TRANSACTION
### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# Number of rows: 4
# at 2225
#<date> server id 1 end_log_pos 2298 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
#<date> server id 1 end_log_pos 2298 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 xid=<xid>
SET TIMESTAMP=X/*!*/;
COMMIT
/*!*/;
Expand Down Expand Up @@ -305,7 +305,7 @@ START TRANSACTION
### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# Number of rows: 3
# at 2561
#<date> server id 1 end_log_pos 2634 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
#<date> server id 1 end_log_pos 2634 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 xid=<xid>
SET TIMESTAMP=X/*!*/;
COMMIT
/*!*/;
Expand Down Expand Up @@ -367,7 +367,7 @@ START TRANSACTION
### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# Number of rows: 4
# at 2861
#<date> server id 1 end_log_pos 2934 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
#<date> server id 1 end_log_pos 2934 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 xid=<xid>
SET TIMESTAMP=X/*!*/;
COMMIT
/*!*/;
Expand Down Expand Up @@ -429,7 +429,7 @@ START TRANSACTION
### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# Number of rows: 4
# at 3154
#<date> server id 1 end_log_pos 3227 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
#<date> server id 1 end_log_pos 3227 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 xid=<xid>
SET TIMESTAMP=X/*!*/;
COMMIT
/*!*/;
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/main/mysqlbinlog_row_compressed.test
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ DELETE FROM t2;

FLUSH BINARY LOGS;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /\d{6} *\d*:\d\d:\d\d/<date>/ /Start:.*at startup/Start: xxx/ /SET TIMESTAMP=\d*/SET TIMESTAMP=X/ /exec_time=\d*/exec_time=x/ /mapped to number \d*/mapped to number num/ /CRC32 0x[0-9a-f]+/CRC32 XXX/ /@@session.sql_mode=\d+/@@session.sql_mode=#/ /collation_server=\d+/collation_server=#/
--replace_regex /\d{6} *\d*:\d\d:\d\d/<date>/ /Start:.*at startup/Start: xxx/ /SET TIMESTAMP=\d*/SET TIMESTAMP=X/ /exec_time=\d*/exec_time=x/ /mapped to number \d*/mapped to number num/ /CRC32 0x[0-9a-f]+/CRC32 XXX/ /@@session.sql_mode=\d+/@@session.sql_mode=#/ /collation_server=\d+/collation_server=#/ /xid=\d*/xid=<xid>/
--exec $MYSQL_BINLOG --verbose --verbose --base64-output=DECODE-ROWS $datadir/$binlog

--echo
Expand Down
22 changes: 11 additions & 11 deletions mysql-test/main/mysqlbinlog_row_minimal.result
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ROLLBACK/*!*/;
/*!100001 SET @@session.server_id=1*//*!*/;
/*!100001 SET @@session.gtid_seq_no=1*//*!*/;
# at 371
#<date> server id 1 end_log_pos 555 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
#<date> server id 1 end_log_pos 555 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 xid=<xid>
use `test`/*!*/;
SET TIMESTAMP=X/*!*/;
SET @@session.pseudo_thread_id=5/*!*/;
Expand All @@ -44,7 +44,7 @@ CREATE TABLE t1 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 TINYINT, f4 MEDIUMINT, f
#<date> server id 1 end_log_pos 597 CRC32 XXX GTID 0-1-2 ddl
/*!100001 SET @@session.gtid_seq_no=2*//*!*/;
# at 597
#<date> server id 1 end_log_pos 774 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
#<date> server id 1 end_log_pos 774 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 xid=<xid>
SET TIMESTAMP=X/*!*/;
CREATE TABLE t2 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 INT, f4 INT, f5 MEDIUMINT, f6 INT, f7 INT, f8 char(1))
/*!*/;
Expand Down Expand Up @@ -73,7 +73,7 @@ START TRANSACTION
### @9='' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# Number of rows: 1
# at 1015
#<date> server id 1 end_log_pos 1088 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
#<date> server id 1 end_log_pos 1088 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 xid=<xid>
SET TIMESTAMP=X/*!*/;
COMMIT
/*!*/;
Expand Down Expand Up @@ -102,7 +102,7 @@ START TRANSACTION
### @9=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
# Number of rows: 1
# at 1330
#<date> server id 1 end_log_pos 1403 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
#<date> server id 1 end_log_pos 1403 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 xid=<xid>
SET TIMESTAMP=X/*!*/;
COMMIT
/*!*/;
Expand Down Expand Up @@ -131,7 +131,7 @@ START TRANSACTION
### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# Number of rows: 1
# at 1646
#<date> server id 1 end_log_pos 1719 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
#<date> server id 1 end_log_pos 1719 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 xid=<xid>
SET TIMESTAMP=X/*!*/;
COMMIT
/*!*/;
Expand Down Expand Up @@ -160,7 +160,7 @@ START TRANSACTION
### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# Number of rows: 1
# at 1962
#<date> server id 1 end_log_pos 2035 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
#<date> server id 1 end_log_pos 2035 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 xid=<xid>
SET TIMESTAMP=X/*!*/;
COMMIT
/*!*/;
Expand Down Expand Up @@ -222,7 +222,7 @@ START TRANSACTION
### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
# Number of rows: 4
# at 2354
#<date> server id 1 end_log_pos 2427 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
#<date> server id 1 end_log_pos 2427 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 xid=<xid>
SET TIMESTAMP=X/*!*/;
COMMIT
/*!*/;
Expand Down Expand Up @@ -255,7 +255,7 @@ START TRANSACTION
### @5=5 /* INT meta=0 nullable=1 is_null=0 */
# Number of rows: 3
# at 2657
#<date> server id 1 end_log_pos 2730 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
#<date> server id 1 end_log_pos 2730 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 xid=<xid>
SET TIMESTAMP=X/*!*/;
COMMIT
/*!*/;
Expand Down Expand Up @@ -285,7 +285,7 @@ START TRANSACTION
### @1=13 /* INT meta=0 nullable=0 is_null=0 */
# Number of rows: 4
# at 2919
#<date> server id 1 end_log_pos 2992 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
#<date> server id 1 end_log_pos 2992 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 xid=<xid>
SET TIMESTAMP=X/*!*/;
COMMIT
/*!*/;
Expand Down Expand Up @@ -315,7 +315,7 @@ START TRANSACTION
### @1=13 /* INT meta=0 nullable=0 is_null=0 */
# Number of rows: 4
# at 3181
#<date> server id 1 end_log_pos 3254 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
#<date> server id 1 end_log_pos 3254 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 xid=<xid>
SET TIMESTAMP=X/*!*/;
COMMIT
/*!*/;
Expand Down Expand Up @@ -394,7 +394,7 @@ START TRANSACTION
### @3=X /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
# Number of rows: 1
# at POS
#<date> server id 1 end_log_pos END_LOG_POS CRC32 XXX Query thread_id=TID exec_time=x error_code=0
#<date> server id 1 end_log_pos END_LOG_POS CRC32 XXX Query thread_id=TID exec_time=x error_code=0 xid=<xid>
SET TIMESTAMP=X/*!*/;
SET @@session.pseudo_thread_id=TID/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/main/mysqlbinlog_row_minimal.test
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ DELETE FROM t2;
FLUSH BINARY LOGS;

--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /\d{6} *\d*:\d\d:\d\d/<date>/ /Start:.*at startup/Start: xxx/ /SET TIMESTAMP=\d*/SET TIMESTAMP=X/ /exec_time=\d*/exec_time=x/ /mapped to number \d*/mapped to number num/ /CRC32 0x[0-9a-f]+/CRC32 XXX/ /@@session.sql_mode=\d+/@@session.sql_mode=#/ /collation_server=\d+/collation_server=#/
--replace_regex /\d{6} *\d*:\d\d:\d\d/<date>/ /Start:.*at startup/Start: xxx/ /SET TIMESTAMP=\d*/SET TIMESTAMP=X/ /exec_time=\d*/exec_time=x/ /mapped to number \d*/mapped to number num/ /CRC32 0x[0-9a-f]+/CRC32 XXX/ /@@session.sql_mode=\d+/@@session.sql_mode=#/ /collation_server=\d+/collation_server=#/ /xid=\d*/xid=<xid>/
--exec $MYSQL_BINLOG --verbose --verbose --base64-output=DECODE-ROWS $datadir/$binlog

DROP TABLE t1,t2;
Expand Down Expand Up @@ -95,7 +95,7 @@ UPDATE t1 t1 INNER JOIN t2 t2 ON t1.ref_id = t2.id

FLUSH BINARY LOGS;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /table id \d*/table id TID/ /mapped to number \d*/mapped to number TID/ /at \d*/at POS/ /end_log_pos \d*/end_log_pos END_LOG_POS/ /GTID \d*-\d*-\d*/GTID D-S-N/ /\d{6} *\d*:\d\d:\d\d/<date>/ /SET TIMESTAMP=\d*/SET TIMESTAMP=X/ /exec_time=\d*/exec_time=x/ /@3=\d*/@3=X/ /CRC32 0x[0-9a-f]+/CRC32 XXX/ /@@session.sql_mode=\d+/@@session.sql_mode=#/ /collation_server=\d+/collation_server=#/ /thread_id=\d*/thread_id=TID/
--replace_regex /table id \d*/table id TID/ /mapped to number \d*/mapped to number TID/ /at \d*/at POS/ /end_log_pos \d*/end_log_pos END_LOG_POS/ /GTID \d*-\d*-\d*/GTID D-S-N/ /\d{6} *\d*:\d\d:\d\d/<date>/ /SET TIMESTAMP=\d*/SET TIMESTAMP=X/ /exec_time=\d*/exec_time=x/ /@3=\d*/@3=X/ /CRC32 0x[0-9a-f]+/CRC32 XXX/ /@@session.sql_mode=\d+/@@session.sql_mode=#/ /collation_server=\d+/collation_server=#/ /thread_id=\d*/thread_id=TID/ /xid=\d*/xid=<xid>/
--exec $MYSQL_BINLOG --verbose --verbose --base64-output=DECODE-ROWS $datadir/$binlog --start-position=$binlog_pos --stop-position=$binlog_end

DROP TABLE t1,t2;
Expand Down
Loading

0 comments on commit 47010cc

Please sign in to comment.