rm -rf 83417 scripts/mysql_install_db --basedir=/export/umesh/server/binaries/GABuilds/mysql-5.6.34 --datadir=/export/umesh/server/binaries/GABuilds/mysql-5.6.34/83417 -v bin/mysqld --no-defaults --basedir=/export/umesh/server/binaries/GABuilds/mysql-5.6.34 --datadir=/export/umesh/server/binaries/GABuilds/mysql-5.6.34/83417 --core-file --socket=/tmp/mysql_ushastry.sock --port=3306 --log-error=/export/umesh/server/binaries/GABuilds/mysql-5.6.34/83417/log.err --log-bin=master-bin --server-id=1 --binlog_format=ROW --binlog-row-image=minimal 2>&1 & -- mysql> show variables like 'binlog_row_image'; +------------------+---------+ | Variable_name | Value | +------------------+---------+ | binlog_row_image | MINIMAL | +------------------+---------+ 1 row in set (0.00 sec) mysql> use test Database changed mysql> create table t (a int primary key, b int, c int); Query OK, 0 rows affected (0.00 sec) mysql> insert into t values(1, 1, 1); Query OK, 1 row affected (0.00 sec) mysql> show binlog events; +-------------------+-----+-------------+-----------+-------------+----------------------------------------------------------------------+ | Log_name | Pos | Event_type | Server_id | End_log_pos | Info | +-------------------+-----+-------------+-----------+-------------+----------------------------------------------------------------------+ | master-bin.000001 | 4 | Format_desc | 1 | 120 | Server ver: 5.6.34-enterprise-commercial-advanced-log, Binlog ver: 4 | | master-bin.000001 | 120 | Stop | 1 | 143 | | +-------------------+-----+-------------+-----------+-------------+----------------------------------------------------------------------+ 2 rows in set (0.00 sec) mysql> update t set a = 2, b = 1 where c = 1; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> insert into t values(2, 1, 1) on duplicate key update b = b + 1, c = values(c); Query OK, 2 rows affected (0.00 sec) mysql> select * from t; +---+------+------+ | a | b | c | +---+------+------+ | 2 | 2 | 1 | +---+------+------+ 1 row in set (0.00 sec) -- in binlog [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-5.6.34: bin/mysqlbinlog --base64-output=DECODE-ROWS --verbose 83417/master-bin.000002 . 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 table t (a int primary key, b int, c int) /*!*/; # at 242 #161018 9:00:02 server id 1 end_log_pos 314 CRC32 0x1b3cf850 Query thread_id=1 exec_time=0 error_code=0 SET TIMESTAMP=1476774002/*!*/; BEGIN /*!*/; # at 314 #161018 9:00:02 server id 1 end_log_pos 360 CRC32 0x62dbd526 Table_map: `test`.`t` mapped to number 70 # at 360 #161018 9:00:02 server id 1 end_log_pos 408 CRC32 0x340a4196 Write_rows: table id 70 flags: STMT_END_F ### INSERT INTO `test`.`t` ### SET ### @1=1 ### @2=1 ### @3=1 # at 408 #161018 9:00:02 server id 1 end_log_pos 439 CRC32 0x98310420 Xid = 12 COMMIT/*!*/; # at 439 #161018 9:00:15 server id 1 end_log_pos 511 CRC32 0xe98689ef Query thread_id=1 exec_time=0 error_code=0 SET TIMESTAMP=1476774015/*!*/; BEGIN /*!*/; # at 511 #161018 9:00:15 server id 1 end_log_pos 557 CRC32 0x630afe01 Table_map: `test`.`t` mapped to number 70 # at 557 #161018 9:00:15 server id 1 end_log_pos 607 CRC32 0x968df2f5 Update_rows: table id 70 flags: STMT_END_F ### UPDATE `test`.`t` ### WHERE ### @1=1 ### SET ### @1=2 ### @2=1 # at 607 #161018 9:00:15 server id 1 end_log_pos 638 CRC32 0xc60d2e4e Xid = 14 COMMIT/*!*/; # at 638 #161018 9:00:37 server id 1 end_log_pos 710 CRC32 0xf5d258c6 Query thread_id=1 exec_time=0 error_code=0 SET TIMESTAMP=1476774037/*!*/; BEGIN /*!*/; # at 710 #161018 9:00:37 server id 1 end_log_pos 756 CRC32 0xd0552bc5 Table_map: `test`.`t` mapped to number 70 # at 756 #161018 9:00:37 server id 1 end_log_pos 810 CRC32 0xe912ea5e Update_rows: table id 70 flags: STMT_END_F ### UPDATE `test`.`t` ### WHERE ### @1=2 ### SET ### @1=2 ### @2=2 ### @3=1 # at 810 #161018 9:00:37 server id 1 end_log_pos 841 CRC32 0x86cc54fd Xid = 15 COMMIT/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; ### Trigger case drop table if exists t1; drop table if exists t2; create table t1(id int primary key); create table t2(id int not null auto_increment primary key, cEvent varchar(100)); insert into t1 values(1); DELIMITER // CREATE TRIGGER t1_after_update AFTER UPDATE ON t1 FOR EACH ROW BEGIN INSERT INTO t2(cEvent) values("1=1 updated"); END; // DELIMITER ; mysql> insert into t1 values(1) on duplicate key update id=1; Query OK, 0 rows affected (0.00 sec) mysql> select * from t2; Empty set (0.00 sec) mysql> insert into t1 values(1) on duplicate key update id=2; Query OK, 2 rows affected (0.00 sec) mysql> select * from t2; +----+-------------+ | id | cEvent | +----+-------------+ | 1 | 1=1 updated | +----+-------------+ 1 row in set (0.00 sec)