Bug #36 A query using both auto_increment and LAST_INSERT_ID() breaks binlog
Submitted: 24 Jan 2003 0:25 Modified: 28 Jan 2003 16:49
Reporter: Guilhem Bichot Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:3.23 and 4.x OS:
Assigned to: Guilhem Bichot CPU Architecture:Any

[24 Jan 2003 0:25] Guilhem Bichot
Description:
A query using both auto_increment and LAST_INSERT_ID() breaks binlog and replication (data on the slave is not the same as on the master).

How to repeat:
On the master do :

create table t1(a int auto_increment, key(a));
create table t2(b int auto_increment, c int, key(b));
insert into t1 values (1),(2),(3);
insert into t1 values (null);
insert into t2 values (null,last_insert_id());

and compare contents of t2 on master and slave.

Suggested fix:
I found a fix. I send the patch to Monty immediately.
[28 Jan 2003 16:49] MySQL Developer
Thank you for your bug report. This issue has already been fixed
in the latest released version of that product, which you can download at 
http://www.mysql.com/downloads/