mariadb/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test

492 lines
13 KiB
Text
Raw Normal View History

--source include/have_log_bin.inc
--source include/have_binlog_format_row.inc
--source include/have_ucs2.inc
--echo #
--echo # Preparatory cleanup.
--echo #
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
--echo #
--echo # We need a fixed timestamp to avoid varying results.
--echo #
SET timestamp=1000000000;
--echo #
--echo # Delete all existing binary logs.
--echo #
RESET MASTER;
CREATE TABLE t1 (c01 BIT);
INSERT INTO t1 VALUES (0);
INSERT INTO t1 VALUES (1);
DROP TABLE t1;
CREATE TABLE t1 (c01 BIT(7));
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (4);
INSERT INTO t1 VALUES (8);
INSERT INTO t1 VALUES (16);
INSERT INTO t1 VALUES (32);
INSERT INTO t1 VALUES (64);
INSERT INTO t1 VALUES (127);
DELETE FROM t1 WHERE c01=127;
UPDATE t1 SET c01=15 WHERE c01=16;
DROP TABLE t1;
CREATE TABLE t1 (a BIT(20), b CHAR(2));
INSERT INTO t1 VALUES (b'00010010010010001001', 'ab');
DROP TABLE t1;
CREATE TABLE t1 (c02 BIT(64));
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (128);
INSERT INTO t1 VALUES (b'1111111111111111111111111111111111111111111111111111111111111111');
DROP TABLE t1;
CREATE TABLE t1 (c03 TINYINT);
INSERT INTO t1 VALUES (1),(2),(3);
INSERT INTO t1 VALUES (-128);
UPDATE t1 SET c03=2 WHERE c03=1;
DELETE FROM t1 WHERE c03=-128;
DROP TABLE t1;
CREATE TABLE t1 (c04 TINYINT UNSIGNED);
INSERT INTO t1 VALUES (128), (255);
UPDATE t1 SET c04=2 WHERE c04=1;
DELETE FROM t1 WHERE c04=255;
DROP TABLE t1;
CREATE TABLE t1 (c06 BOOL);
INSERT INTO t1 VALUES (TRUE);
DELETE FROM t1 WHERE c06=TRUE;
DROP TABLE t1;
CREATE TABLE t1 (c07 SMALLINT);
INSERT INTO t1 VALUES (1234);
DELETE FROM t1 WHERE c07=1234;
DROP TABLE t1;
CREATE TABLE t1 (c08 SMALLINT UNSIGNED);
INSERT INTO t1 VALUES (32768), (65535);
UPDATE t1 SET c08=2 WHERE c08=32768;
DELETE FROM t1 WHERE c08=65535;
DROP TABLE t1;
CREATE TABLE t1 (c10 MEDIUMINT);
INSERT INTO t1 VALUES (12345);
DELETE FROM t1 WHERE c10=12345;
DROP TABLE t1;
CREATE TABLE t1 (c11 MEDIUMINT UNSIGNED);
INSERT INTO t1 VALUES (8388608), (16777215);
UPDATE t1 SET c11=2 WHERE c11=8388608;
DELETE FROM t1 WHERE c11=16777215;
DROP TABLE t1;
CREATE TABLE t1 (c13 INT);
INSERT INTO t1 VALUES (123456);
DELETE FROM t1 WHERE c13=123456;
DROP TABLE t1;
CREATE TABLE t1 (c14 INT UNSIGNED);
INSERT INTO t1 VALUES (2147483648), (4294967295);
UPDATE t1 SET c14=2 WHERE c14=2147483648;
DELETE FROM t1 WHERE c14=4294967295;
DROP TABLE t1;
CREATE TABLE t1 (c16 BIGINT);
INSERT INTO t1 VALUES (1234567890);
DELETE FROM t1 WHERE c16=1234567890;
DROP TABLE t1;
CREATE TABLE t1 (c17 BIGINT UNSIGNED);
INSERT INTO t1 VALUES (9223372036854775808), (18446744073709551615);
UPDATE t1 SET c17=2 WHERE c17=9223372036854775808;
DELETE FROM t1 WHERE c17=18446744073709551615;
DROP TABLE t1;
CREATE TABLE t1 (c19 FLOAT);
INSERT INTO t1 VALUES (123.2234);
DELETE FROM t1 WHERE c19>123;
DROP TABLE t1;
CREATE TABLE t1 (c22 DOUBLE);
INSERT INTO t1 VALUES (123434.22344545);
DELETE FROM t1 WHERE c22>123434;
DROP TABLE t1;
#
CREATE TABLE t1 (c25 DECIMAL(10,5));
INSERT INTO t1 VALUES (124.45);
INSERT INTO t1 VALUES (-543.21);
DELETE FROM t1 WHERE c25=124.45;
DROP TABLE t1;
#
CREATE TABLE t1 (c28 DATE);
INSERT INTO t1 VALUES ('2001-02-03');
DELETE FROM t1 WHERE c28='2001-02-03';
DROP TABLE t1;
CREATE TABLE t1 (c29 DATETIME);
INSERT INTO t1 VALUES ('2001-02-03 10:20:30');
DELETE FROM t1 WHERE c29='2001-02-03 10:20:30';
DROP TABLE t1;
CREATE TABLE t1 (c30 TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
INSERT INTO t1 VALUES ('2001-02-03 10:20:30');
DELETE FROM t1 WHERE c30='2001-02-03 10:20:30';
DROP TABLE t1;
CREATE TABLE t1 (c31 TIME);
INSERT INTO t1 VALUES ('11:22:33');
DELETE FROM t1 WHERE c31='11:22:33';
DROP TABLE t1;
CREATE TABLE t1 (c32 YEAR);
INSERT INTO t1 VALUES ('2001');
DELETE FROM t1 WHERE c32=2001;
DROP TABLE t1;
#
CREATE TABLE t1 (c33 CHAR);
INSERT INTO t1 VALUES ('a');
DELETE FROM t1 WHERE c33='a';
DROP TABLE t1;
CREATE TABLE t1 (c34 CHAR(0));
INSERT INTO t1 VALUES ('');
DELETE FROM t1 WHERE c34='';
DROP TABLE t1;
CREATE TABLE t1 (c35 CHAR(1));
INSERT INTO t1 VALUES ('b');
DELETE FROM t1 WHERE c35='b';
DROP TABLE t1;
CREATE TABLE t1 (c36 CHAR(255));
INSERT INTO t1 VALUES (repeat('c',255));
DELETE FROM t1 WHERE c36>'c';
DROP TABLE t1;
#
CREATE TABLE t1 (c37 NATIONAL CHAR);
INSERT INTO t1 VALUES ('a');
DELETE FROM t1 WHERE c37='a';
DROP TABLE t1;
CREATE TABLE t1 (c38 NATIONAL CHAR(0));
INSERT INTO t1 VALUES ('');
DELETE FROM t1 WHERE c38='';
DROP TABLE t1;
CREATE TABLE t1 (c39 NATIONAL CHAR(1));
INSERT INTO t1 VALUES ('a');
DELETE FROM t1 WHERE c39='a';
DROP TABLE t1;
CREATE TABLE t1 (c40 NATIONAL CHAR(255));
INSERT INTO t1 VALUES (repeat('a', 255));
INSERT INTO t1 VALUES (repeat(_latin1 0xDF, 255));
DELETE FROM t1 WHERE c40>'a';
DROP TABLE t1;
#
CREATE TABLE t1 (c41 CHAR CHARACTER SET UCS2);
INSERT INTO t1 VALUES ('a');
DELETE FROM t1 WHERE c41='a';
DROP TABLE t1;
CREATE TABLE t1 (c42 CHAR(0) CHARACTER SET UCS2);
INSERT INTO t1 VALUES ('');
DELETE FROM t1 WHERE c42='';
DROP TABLE t1;
CREATE TABLE t1 (c43 CHAR(1) CHARACTER SET UCS2);
INSERT INTO t1 VALUES ('a');
DELETE FROM t1 WHERE c43='a';
DROP TABLE t1;
CREATE TABLE t1 (c44 CHAR(255) CHARACTER SET UCS2);
INSERT INTO t1 VALUES (repeat('a', 255));
INSERT INTO t1 VALUES (repeat(_latin1 0xDF, 255));
DELETE FROM t1 WHERE c44>'a';
DROP TABLE t1;
#
CREATE TABLE t1 (c45 VARCHAR(0));
INSERT INTO t1 VALUES ('');
DELETE FROM t1 WHERE c45='';
DROP TABLE t1;
CREATE TABLE t1 (c46 VARCHAR(1));
INSERT INTO t1 VALUES ('a');
DELETE FROM t1 WHERE c46='a';
DROP TABLE t1;
CREATE TABLE t1 (c47 VARCHAR(255));
INSERT INTO t1 VALUES (repeat('a',255));
DELETE FROM t1 WHERE c47>'a';
DROP TABLE t1;
CREATE TABLE t1 (c48 VARCHAR(261));
INSERT INTO t1 VALUES (repeat('a',261));
DELETE FROM t1 WHERE c48>'a';
DROP TABLE t1;
#
CREATE TABLE t1 (c49 NATIONAL VARCHAR(0));
INSERT INTO t1 VALUES ('');
DELETE FROM t1 WHERE c49='';
DROP TABLE t1;
CREATE TABLE t1 (c50 NATIONAL VARCHAR(1));
INSERT INTO t1 VALUES ('a');
DELETE FROM t1 WHERE c50='a';
DROP TABLE t1;
CREATE TABLE t1 (c51 NATIONAL VARCHAR(255));
INSERT INTO t1 VALUES (repeat('a',255));
INSERT INTO t1 VALUES (repeat(_latin1 0xDF, 255));
DELETE FROM t1 WHERE c51>'a';
DROP TABLE t1;
CREATE TABLE t1 (c52 NATIONAL VARCHAR(261));
INSERT INTO t1 VALUES (repeat('a',261));
INSERT INTO t1 VALUES (repeat(_latin1 0xDF, 261));
DELETE FROM t1 WHERE c52>'a';
DROP TABLE t1;
#
CREATE TABLE t1 (c53 VARCHAR(0) CHARACTER SET ucs2);
INSERT INTO t1 VALUES ('');
DELETE FROM t1 WHERE c53='';
DROP TABLE t1;
CREATE TABLE t1 (c54 VARCHAR(1) CHARACTER SET ucs2);
INSERT INTO t1 VALUES ('a');
DELETE FROM t1 WHERE c54='a';
DROP TABLE t1;
CREATE TABLE t1 (c55 VARCHAR(255) CHARACTER SET ucs2);
INSERT INTO t1 VALUES (repeat('ab', 127));
DELETE FROM t1 WHERE c55>'a';
DROP TABLE t1;
CREATE TABLE t1 (c56 VARCHAR(261) CHARACTER SET ucs2);
INSERT INTO t1 VALUES (repeat('ab', 130));
DELETE FROM t1 WHERE c56>'a';
DROP TABLE t1;
#
CREATE TABLE t1 (c57 BINARY);
INSERT INTO t1 VALUES (0x00);
INSERT INTO t1 VALUES (0x02);
INSERT INTO t1 VALUES ('a');
DELETE FROM t1 WHERE c57='a';
DROP TABLE t1;
CREATE TABLE t1 (c58 BINARY(0));
INSERT INTO t1 VALUES ('');
DELETE FROM t1 WHERE c58='';
DROP TABLE t1;
CREATE TABLE t1 (c59 BINARY(1));
INSERT INTO t1 VALUES (0x00);
INSERT INTO t1 VALUES (0x02);
INSERT INTO t1 VALUES ('a');
DELETE FROM t1 WHERE c59='a';
DROP TABLE t1;
CREATE TABLE t1 (c60 BINARY(255));
INSERT INTO t1 VALUES (0x00);
INSERT INTO t1 VALUES (0x02);
INSERT INTO t1 VALUES (repeat('a\0',120));
DELETE FROM t1 WHERE c60<0x02;
DROP TABLE t1;
#
CREATE TABLE t1 (c61 VARBINARY(0));
INSERT INTO t1 VALUES ('');
DELETE FROM t1 WHERE c61='';
DROP TABLE t1;
CREATE TABLE t1 (c62 VARBINARY(1));
INSERT INTO t1 VALUES (0x00);
INSERT INTO t1 VALUES (0x02);
INSERT INTO t1 VALUES ('a');
DELETE FROM t1 WHERE c62=0x02;
DROP TABLE t1;
CREATE TABLE t1 (c63 VARBINARY(255));
INSERT INTO t1 VALUES (0x00);
INSERT INTO t1 VALUES (0x02);
INSERT INTO t1 VALUES (repeat('a\0',120));
DELETE FROM t1 WHERE c63=0x02;
DROP TABLE t1;
#
CREATE TABLE t1 (c65 TINYBLOB);
INSERT INTO t1 VALUES ('tinyblob1');
DELETE FROM t1 WHERE c65='tinyblob1';
DROP TABLE t1;
CREATE TABLE t1 (c68 BLOB);
INSERT INTO t1 VALUES ('blob1');
DELETE FROM t1 WHERE c68='blob1';
DROP TABLE t1;
CREATE TABLE t1 (c71 MEDIUMBLOB);
INSERT INTO t1 VALUES ('mediumblob1');
DELETE FROM t1 WHERE c71='mediumblob1';
DROP TABLE t1;
CREATE TABLE t1 (c74 LONGBLOB);
INSERT INTO t1 VALUES ('longblob1');
DELETE FROM t1 WHERE c74='longblob1';
DROP TABLE t1;
CREATE TABLE t1 (c66 TINYTEXT);
INSERT INTO t1 VALUES ('tinytext1');
DELETE FROM t1 WHERE c66='tinytext1';
DROP TABLE t1;
CREATE TABLE t1 (c69 TEXT);
INSERT INTO t1 VALUES ('text1');
DELETE FROM t1 WHERE c69='text1';
DROP TABLE t1;
CREATE TABLE t1 (c72 MEDIUMTEXT);
INSERT INTO t1 VALUES ('mediumtext1');
DELETE FROM t1 WHERE c72='mediumtext1';
DROP TABLE t1;
CREATE TABLE t1 (c75 LONGTEXT);
INSERT INTO t1 VALUES ('longtext1');
DELETE FROM t1 WHERE c75='longtext1';
DROP TABLE t1;
#
CREATE TABLE t1 (c67 TINYTEXT CHARACTER SET UCS2);
INSERT INTO t1 VALUES ('tinytext1');
DELETE FROM t1 WHERE c67='tinytext1';
DROP TABLE t1;
CREATE TABLE t1 (c70 TEXT CHARACTER SET UCS2);
INSERT INTO t1 VALUES ('text1');
DELETE FROM t1 WHERE c70='text1';
DROP TABLE t1;
CREATE TABLE t1 (c73 MEDIUMTEXT CHARACTER SET UCS2);
INSERT INTO t1 VALUES ('mediumtext1');
DELETE FROM t1 WHERE c73='mediumtext1';
DROP TABLE t1;
CREATE TABLE t1 (c76 LONGTEXT CHARACTER SET UCS2);
INSERT INTO t1 VALUES ('longtext1');
DELETE FROM t1 WHERE c76='longtext1';
DROP TABLE t1;
#
CREATE TABLE t1 (c77 ENUM('a','b','c'));
INSERT INTO t1 VALUES ('b');
DELETE FROM t1 WHERE c77='b';
DROP TABLE t1;
#
CREATE TABLE t1 (c78 SET('a','b','c','d','e','f'));
INSERT INTO t1 VALUES ('a,b');
INSERT INTO t1 VALUES ('a,c');
INSERT INTO t1 VALUES ('b,c');
INSERT INTO t1 VALUES ('a,b,c');
INSERT INTO t1 VALUES ('a,b,c,d');
INSERT INTO t1 VALUES ('a,b,c,d,e');
INSERT INTO t1 VALUES ('a,b,c,d,e,f');
DELETE FROM t1 WHERE c78='a,b';
DROP TABLE t1;
#
# Check multi-table update
#
CREATE TABLE t1 (a int NOT NULL DEFAULT 0, b int NOT NULL DEFAULT 0);
CREATE TABLE t2 (a int NOT NULL DEFAULT 0, b int NOT NULL DEFAULT 0);
INSERT INTO t1 SET a=1;
INSERT INTO t1 SET b=1;
INSERT INTO t2 SET a=1;
INSERT INTO t2 SET b=1;
UPDATE t1, t2 SET t1.a=10, t2.a=20;
DROP TABLE t1,t2;
--echo #
--echo # MDEV-20591 Wrong Number of rows in mysqlbinlog output.
--echo #
CREATE TABLE t1(c_char_utf8 CHAR(10) ,
c_varchar_utf8 char(10) ,
c_text_utf8 blob );
INSERT into t1 values("B", "B", REPEAT("#", 2000));
drop table t1;
mysqlbinlog now prints "# Number of rows" and stops on errors Main problem was that no log-event print function checked for disk full error on the IO_CACHE. All changes in this patch only affects mysqlbinlog, not the server! - Changed all log-event print functions to return 1 on error - Fixed memory usage when not using --flashback. - Added printing of number of rows in row events. Can be disabled with --print-row-count=0 - Print annotated rows when using mysqlbinlog --short-form - Fixed that mysqlbinlog --debug works - Fixed create_drop_binlog.test test failure - Reorganized fields in PRINT_EVENT_INFO to be according to size to optimize storage - Don't change print_row_event_position or print_row_counts if set by user - Remove some testing of argument to my_free is 0 - base64-output=never is now supported and works in all context - Updated help information for --base64-output and --short-form - print_row_count is now on by default. Reset automatically if --short-form is used - Removed obsolote warning for mysql 5.6.0 - More DBUG_PRINT for mysqltest.cc - my_b_write_byte() now checks for flush failures. This fixed a memory overrun on disk full - my_b_printf() now returns 1 on failure, 0 on ok. This simplifies code and no old code was using the old return value of my_b_printf(). - my_b_Write_backtick_quote() now returns 1 on failure and 0 on ok - Fixed some error conditions in log printing that was not previously handled. - Slave_rows_error_report() can now handle longlong positions - Write_on_release_cache() rewritten so that we can detect errors on flush. Not depending on automatic release anymore. - Changed types for Pos and End_log_pos to 64 bit in SHOW BINLOG EVENTS - Fixed that copy_event_cache_to_string_and_reinit() works with strings longer than 4G (Changed to use LEX_STRING instead of String) - Restricted binlog_rows_event_max_size to UINT32_MAX-1 as String's are anyway restricted to UINT32_MAX - Fixed bug in rpl_binlog_state::write_to_iocache() which hide write failures (duplicate variable name) - Fixed bug in String::append if original string was not allocated - Stop mysqlbinlog output at once if there is an error. - Before printing error message, flush result file. This ensures that the error message is printed last. (Easier to find)
2017-12-23 15:59:41 +01:00
flush logs;
let $MYSQLD_DATADIR= `select @@datadir`;
--copy_file std_data/old_decimal/t1dec102.frm $MYSQLD_DATADIR/test/t1dec102.frm
--copy_file std_data/old_decimal/t1dec102.MYD $MYSQLD_DATADIR/test/t1dec102.MYD
--copy_file std_data/old_decimal/t1dec102.MYI $MYSQLD_DATADIR/test/t1dec102.MYI
INSERT INTO t1dec102 VALUES (-999.99);
INSERT INTO t1dec102 VALUES (0);
INSERT INTO t1dec102 VALUES (999.99);
SELECT * FROM t1dec102 ORDER BY a;
DROP TABLE t1dec102;
flush logs;
#
# MDEV-22330: mysqlbinlog stops with an error Don't know how to handle column
# type: 255 meta: 4 (0004)
# Check support for GEOMETRY type with verbose mode.
#
CREATE TABLE t1 (a GEOMETRY DEFAULT NULL);
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (POINT(10,10));
DROP TABLE t1;
FLUSH LOGS;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
MDEV-23842 Atomic RENAME TABLE - 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.
2020-10-15 01:25:57 +02:00
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9]*[.][0-9]{1,3})[0-9e+-]*[^ ]*(.*(FLOAT|DOUBLE).*[*].)/\1...\2/ /CRC32 0x[0-9a-f]*/CRC32 XXX/ /collation_server=[0-9]+/collation_server=X/ /character_set_client=[0-9]+/character_set_client=X/ /collation_connection=[0-9]+/collation_connection=X/ /xid=\d*/xid=<xid>/
2008-09-06 06:49:43 +02:00
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001
mysqlbinlog now prints "# Number of rows" and stops on errors Main problem was that no log-event print function checked for disk full error on the IO_CACHE. All changes in this patch only affects mysqlbinlog, not the server! - Changed all log-event print functions to return 1 on error - Fixed memory usage when not using --flashback. - Added printing of number of rows in row events. Can be disabled with --print-row-count=0 - Print annotated rows when using mysqlbinlog --short-form - Fixed that mysqlbinlog --debug works - Fixed create_drop_binlog.test test failure - Reorganized fields in PRINT_EVENT_INFO to be according to size to optimize storage - Don't change print_row_event_position or print_row_counts if set by user - Remove some testing of argument to my_free is 0 - base64-output=never is now supported and works in all context - Updated help information for --base64-output and --short-form - print_row_count is now on by default. Reset automatically if --short-form is used - Removed obsolote warning for mysql 5.6.0 - More DBUG_PRINT for mysqltest.cc - my_b_write_byte() now checks for flush failures. This fixed a memory overrun on disk full - my_b_printf() now returns 1 on failure, 0 on ok. This simplifies code and no old code was using the old return value of my_b_printf(). - my_b_Write_backtick_quote() now returns 1 on failure and 0 on ok - Fixed some error conditions in log printing that was not previously handled. - Slave_rows_error_report() can now handle longlong positions - Write_on_release_cache() rewritten so that we can detect errors on flush. Not depending on automatic release anymore. - Changed types for Pos and End_log_pos to 64 bit in SHOW BINLOG EVENTS - Fixed that copy_event_cache_to_string_and_reinit() works with strings longer than 4G (Changed to use LEX_STRING instead of String) - Restricted binlog_rows_event_max_size to UINT32_MAX-1 as String's are anyway restricted to UINT32_MAX - Fixed bug in rpl_binlog_state::write_to_iocache() which hide write failures (duplicate variable name) - Fixed bug in String::append if original string was not allocated - Stop mysqlbinlog output at once if there is an error. - Before printing error message, flush result file. This ensures that the error message is printed last. (Easier to find)
2017-12-23 15:59:41 +01:00
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
MDEV-23842 Atomic RENAME TABLE - 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.
2020-10-15 01:25:57 +02:00
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9]*[.][0-9]{1,3})[0-9e+-]*[^ ]*(.*(FLOAT|DOUBLE).*[*].)/\1...\2/ /CRC32 0x[0-9a-f]*/CRC32 XXX/ /xid=\d*/xid=<xid>/
mysqlbinlog now prints "# Number of rows" and stops on errors Main problem was that no log-event print function checked for disk full error on the IO_CACHE. All changes in this patch only affects mysqlbinlog, not the server! - Changed all log-event print functions to return 1 on error - Fixed memory usage when not using --flashback. - Added printing of number of rows in row events. Can be disabled with --print-row-count=0 - Print annotated rows when using mysqlbinlog --short-form - Fixed that mysqlbinlog --debug works - Fixed create_drop_binlog.test test failure - Reorganized fields in PRINT_EVENT_INFO to be according to size to optimize storage - Don't change print_row_event_position or print_row_counts if set by user - Remove some testing of argument to my_free is 0 - base64-output=never is now supported and works in all context - Updated help information for --base64-output and --short-form - print_row_count is now on by default. Reset automatically if --short-form is used - Removed obsolote warning for mysql 5.6.0 - More DBUG_PRINT for mysqltest.cc - my_b_write_byte() now checks for flush failures. This fixed a memory overrun on disk full - my_b_printf() now returns 1 on failure, 0 on ok. This simplifies code and no old code was using the old return value of my_b_printf(). - my_b_Write_backtick_quote() now returns 1 on failure and 0 on ok - Fixed some error conditions in log printing that was not previously handled. - Slave_rows_error_report() can now handle longlong positions - Write_on_release_cache() rewritten so that we can detect errors on flush. Not depending on automatic release anymore. - Changed types for Pos and End_log_pos to 64 bit in SHOW BINLOG EVENTS - Fixed that copy_event_cache_to_string_and_reinit() works with strings longer than 4G (Changed to use LEX_STRING instead of String) - Restricted binlog_rows_event_max_size to UINT32_MAX-1 as String's are anyway restricted to UINT32_MAX - Fixed bug in rpl_binlog_state::write_to_iocache() which hide write failures (duplicate variable name) - Fixed bug in String::append if original string was not allocated - Stop mysqlbinlog output at once if there is an error. - Before printing error message, flush result file. This ensures that the error message is printed last. (Easier to find)
2017-12-23 15:59:41 +01:00
--error 1
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000002 2>&1
2020-09-28 13:57:42 +02:00
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
MDEV-23842 Atomic RENAME TABLE - 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.
2020-10-15 01:25:57 +02:00
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9]*[.][0-9]{1,3})[0-9e+-]*[^ ]*(.*(FLOAT|DOUBLE).*[*].)/\1...\2/ /CRC32 0x[0-9a-f]*/CRC32 XXX/ /collation_server=[0-9]+/collation_server=X/ /character_set_client=[0-9]+/character_set_client=X/ /collation_connection=[0-9]+/collation_connection=X/ /xid=\d*/xid=<xid>/
2020-09-28 13:57:42 +02:00
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000003