rm -rf 93423 scripts/mysql_install_db --basedir=$PWD --datadir=$PWD/93423 -v bin/mysqld --no-defaults --basedir=$PWD --datadir=$PWD/93423 --core-file --socket=/tmp/mysql.sock --port=3333 --log-error=$PWD/93423/log.err --log-bin=master-bin --server_id=1 2>&1 & bin/mysql -uroot -S /tmp/mysql.sock Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.6.45-log MySQL Community Server (GPL) Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> set binlog_format='MIXED'; Query OK, 0 rows affected (0.00 sec) mysql> set binlog_row_image="full"; Query OK, 0 rows affected (0.00 sec) mysql> set tx_isolation='READ-COMMITTED'; Query OK, 0 rows affected (0.00 sec) mysql> create database a; Query OK, 1 row affected (0.00 sec) mysql> create database b; Query OK, 1 row affected (0.00 sec) mysql> create table a.test (id int primary key, name varchar(50) default null, age bigint); Query OK, 0 rows affected (0.01 sec) mysql> create table b.test (id int primary key, name varchar(50) default null, age bigint); Query OK, 0 rows affected (0.00 sec) mysql> insert into a.test(id, age) values (1,5), (2,10); /* This insert event is written with full row image in binary log */ Query OK, 2 rows affected (0.00 sec) Records: 2 Duplicates: 0 Warnings: 0 mysql> insert into b.test(id,age) select id , age from a.test ; /* name column information is not present in row image */ Query OK, 2 rows affected (0.00 sec) Records: 2 Duplicates: 0 Warnings: 0 mysql> - extract from binary log bin/mysqlbinlog --base64-output=decode-rows -vv 93423/master-bin.000001 /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; # at 4 #190819 11:50:27 server id 1 end_log_pos 120 CRC32 0xf3986f12 Start: binlog v 4, server v 5.6.45-log created 190819 11:50:27 at startup # Warning: this binlog is either in use or was not closed properly. ROLLBACK/*!*/; # at 120 #190819 11:50:39 server id 1 end_log_pos 205 CRC32 0x2dd762c9 Query thread_id=1 exec_time=0 error_code=0 SET TIMESTAMP=1566208239/*!*/; SET @@session.pseudo_thread_id=1/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=1073741824/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C utf8 *//*!*/; SET @@session.character_set_client=33,@@session.collation_connection=33,@@session.collation_server=8/*!*/; SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; create database a /*!*/; # at 205 #190819 11:50:39 server id 1 end_log_pos 290 CRC32 0xea4067ed Query thread_id=1 exec_time=0 error_code=0 SET TIMESTAMP=1566208239/*!*/; create database b /*!*/; # at 290 #190819 11:50:39 server id 1 end_log_pos 440 CRC32 0xf3169ab6 Query thread_id=1 exec_time=0 error_code=0 SET TIMESTAMP=1566208239/*!*/; create table a.test (id int primary key, name varchar(50) default null, age bigint) /*!*/; # at 440 #190819 11:50:39 server id 1 end_log_pos 590 CRC32 0x8e9229ef Query thread_id=1 exec_time=0 error_code=0 SET TIMESTAMP=1566208239/*!*/; create table b.test (id int primary key, name varchar(50) default null, age bigint) /*!*/; # at 590 #190819 11:50:39 server id 1 end_log_pos 658 CRC32 0x04752417 Query thread_id=1 exec_time=0 error_code=0 SET TIMESTAMP=1566208239/*!*/; BEGIN /*!*/; # at 658 #190819 11:50:39 server id 1 end_log_pos 706 CRC32 0xba97f256 Table_map: `a`.`test` mapped to number 70 # at 706 #190819 11:50:39 server id 1 end_log_pos 767 CRC32 0x172a7d35 Write_rows: table id 70 flags: STMT_END_F ### INSERT INTO `a`.`test` ### SET ### @1=1 /* INT meta=0 nullable=0 is_null=0 */ ### @2=NULL /* INT meta=50 nullable=1 is_null=1 */ ### @3=5 /* LONGINT meta=0 nullable=1 is_null=0 */ ### INSERT INTO `a`.`test` ### SET ### @1=2 /* INT meta=0 nullable=0 is_null=0 */ ### @2=NULL /* INT meta=50 nullable=1 is_null=1 */ ### @3=10 /* LONGINT meta=0 nullable=1 is_null=0 */ # at 767 #190819 11:50:39 server id 1 end_log_pos 798 CRC32 0x1867aba4 Xid = 10 COMMIT/*!*/; # at 798 #190819 11:50:40 server id 1 end_log_pos 866 CRC32 0x61a17685 Query thread_id=1 exec_time=0 error_code=0 SET TIMESTAMP=1566208240/*!*/; BEGIN /*!*/; # at 866 #190819 11:50:40 server id 1 end_log_pos 914 CRC32 0x782a60ec Table_map: `b`.`test` mapped to number 71 # at 914 #190819 11:50:40 server id 1 end_log_pos 975 CRC32 0xd6868db0 Write_rows: table id 71 flags: STMT_END_F ### INSERT INTO `b`.`test` ### SET ### @1=1 /* INT meta=0 nullable=0 is_null=0 */ ### @3=5 /* LONGINT meta=0 nullable=1 is_null=0 */ ### INSERT INTO `b`.`test` ### SET ### @1=2 /* INT meta=0 nullable=0 is_null=0 */ ### @3=10 /* LONGINT meta=0 nullable=1 is_null=0 */ # at 975 #190819 11:50:40 server id 1 end_log_pos 1006 CRC32 0xf3f2ccc4 Xid = 11 COMMIT/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TY -- mysql> TRUNCATE TABLE a.test; Query OK, 0 rows affected (0.01 sec) mysql> TRUNCATE TABLE b.test; Query OK, 0 rows affected (0.00 sec) mysql> SET binlog_format="ROW"; Query OK, 0 rows affected (0.00 sec) mysql> insert into a.test(id, age) values (1,5), (2,10); /* This insert event is written with full row image in binary log */ Query OK, 2 rows affected (0.00 sec) Records: 2 Duplicates: 0 Warnings: 0 mysql> insert into b.test(id,age) select id , age from a.test ; /* name column information is not present in row image */ Query OK, 2 rows affected (0.00 sec) Records: 2 Duplicates: 0 Warnings: 0 mysql> - extract from binary log # at 1006 #190819 11:51:55 server id 1 end_log_pos 1090 CRC32 0xdf700695 Query thread_id=1 exec_time=0 error_code=0 SET TIMESTAMP=1566208315/*!*/; TRUNCATE TABLE a.test /*!*/; # at 1090 #190819 11:51:55 server id 1 end_log_pos 1174 CRC32 0xf8017b0d Query thread_id=1 exec_time=0 error_code=0 SET TIMESTAMP=1566208315/*!*/; TRUNCATE TABLE b.test /*!*/; # at 1174 #190819 11:51:55 server id 1 end_log_pos 1242 CRC32 0xb94db50d Query thread_id=1 exec_time=0 error_code=0 SET TIMESTAMP=1566208315/*!*/; BEGIN /*!*/; # at 1242 #190819 11:51:55 server id 1 end_log_pos 1290 CRC32 0x4a407772 Table_map: `a`.`test` mapped to number 72 # at 1290 #190819 11:51:55 server id 1 end_log_pos 1351 CRC32 0xaa41996d Write_rows: table id 72 flags: STMT_END_F ### INSERT INTO `a`.`test` ### SET ### @1=1 /* INT meta=0 nullable=0 is_null=0 */ ### @2=NULL /* INT meta=50 nullable=1 is_null=1 */ ### @3=5 /* LONGINT meta=0 nullable=1 is_null=0 */ ### INSERT INTO `a`.`test` ### SET ### @1=2 /* INT meta=0 nullable=0 is_null=0 */ ### @2=NULL /* INT meta=50 nullable=1 is_null=1 */ ### @3=10 /* LONGINT meta=0 nullable=1 is_null=0 */ # at 1351 #190819 11:51:55 server id 1 end_log_pos 1382 CRC32 0xcde94a97 Xid = 15 COMMIT/*!*/; # at 1382 #190819 11:51:56 server id 1 end_log_pos 1450 CRC32 0x4fd96574 Query thread_id=1 exec_time=0 error_code=0 SET TIMESTAMP=1566208316/*!*/; BEGIN /*!*/; # at 1450 #190819 11:51:56 server id 1 end_log_pos 1498 CRC32 0xef8d3ef6 Table_map: `b`.`test` mapped to number 73 # at 1498 #190819 11:51:56 server id 1 end_log_pos 1559 CRC32 0xe019f353 Write_rows: table id 73 flags: STMT_END_F ### INSERT INTO `b`.`test` ### SET ### @1=1 /* INT meta=0 nullable=0 is_null=0 */ ### @2=NULL /* INT meta=50 nullable=1 is_null=1 */ ### @3=5 /* LONGINT meta=0 nullable=1 is_null=0 */ ### INSERT INTO `b`.`test` ### SET ### @1=2 /* INT meta=0 nullable=0 is_null=0 */ ### @2=NULL /* INT meta=50 nullable=1 is_null=1 */ ### @3=10 /* LONGINT meta=0 nullable=1 is_null=0 */ # at 1559 #190819 11:51:56 server id 1 end_log_pos 1590 CRC32 0x206688c5 Xid = 16 COMMIT/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;