set global innodb_flush_log_at_trx_commit=0; set binlog_format=statement; drop table if exists `t1`; create table `t1`(`a` serial, `b` int unsigned)engine=innodb; insert into `t1` values(),(),(),(),(); insert into `t1`(`b`) select `t1`.`b` from `t1`,`t1` `a`,`t1` `b`,`t1` `c`, `t1` `d`,`t1` `e`,`t1` `f`,`t1` `g`,`t1` `h`,`t1` `i`,`t1` `j`,`t1` `k`; insert into `t1`(`b`) values (99); set @`id`:=(select last_insert_id()); update `t1` set `b`=0 where `a`=@`id`;