Skip to content

Instantly share code, notes, and snippets.

@3manuek
Last active December 26, 2015 14:19
Show Gist options
  • Save 3manuek/7164696 to your computer and use it in GitHub Desktop.
Save 3manuek/7164696 to your computer and use it in GitHub Desktop.
According an error reported by HL, we tried to reproduce the error : > Last_Error: Error executing row event: 'Cannot execute > statement: impossible to write to binary log since statement is in row > format and BINLOG_FORMAT = STATEMENT.'
Step by step
============
pre-step) Version
mysql> select version();
+--------------------+
| version() |
+--------------------+
| 5.1.71-rel14.9-log |
+--------------------+
1 row in set (0.01 sec)
Server version: 5.1.71-rel14.9-log Percona Server (GPL), 14.9, Revision 589
1) Set the binlog on the master
mysql> set global binlog_format = 'ROW';
Query OK, 0 rows affected (0.00 sec)
2) set the binlog format on the slave
mysql> set global binlog_format = 'STATEMENT';
Query OK, 0 rows affected (0.00 sec)
3) Issuing the following statements:
mysql> set global binlog_format = 'ROW';
Query OK, 0 rows affected (0.00 sec)
mysql> insert into test values(11);
Query OK, 1 row affected (0.00 sec)
mysql> set global binlog_format = 'MIXED';
Query OK, 0 rows affected (0.00 sec)
mysql> insert into test values(12);
Query OK, 1 row affected (0.00 sec)
mysql> set global binlog_format = 'STATEMENT';
Query OK, 0 rows affected (0.00 sec)
mysql> insert into test values(12);
Query OK, 1 row affected (0.00 sec)
mysql> insert into test values(13);
Query OK, 1 row affected (0.00 sec)
mysql> update test set i = 20 where i = 13;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> update test set i = 30 where i = 12;
Query OK, 2 rows affected (0.00 sec)
Rows matched: 2 Changed: 2 Warnings: 0
4) Checked the slaves statuses and no error found.
=======
Following the Giuseppe report:
http://bugs.mysql.com/bug.php?id=69095
mysql> use test ;
Database changed
mysql> drop table if exists t1;
Query OK, 0 rows affected (0.00 sec)
mysql> set binlog_format=statement;
Query OK, 0 rows affected (0.00 sec)
mysql> create table t1 ( i int not null primary key);
Query OK, 0 rows affected (0.03 sec)
mysql> insert into t1 values (1);
Query OK, 1 row affected (0.00 sec)
mysql> set binlog_format=row;
Query OK, 0 rows affected (0.00 sec)
mysql> insert into t1 values (2);
Query OK, 1 row affected (0.00 sec)
mysql> show binlog events;
+-----------+-----+-------------+-----------+-------------+-----------------------------------------------+
| Log_name | Pos | Event_type | Server_id | End_log_pos | Info |
+-----------+-----+-------------+-----------+-------------+-----------------------------------------------+
| M1.000001 | 4 | Format_desc | 2 | 106 | Server ver: 5.1.71-rel14.9-log, Binlog ver: 4 |
| M1.000001 | 106 | Query | 2 | 202 | use `HL`; DELETE FROM `HL`.`POLI_COST_UPDATE` |
| M1.000001 | 202 | Stop | 2 | 221 | |
+-----------+-----+-------------+-----------+-------------+-----------------------------------------------+
3 rows in set (0.00 sec)
But slaves still working!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment