--source include/have_innodb.inc
|
--source include/have_binlog_format_mixed.inc
|
--source include/master-slave.inc
|
|
CREATE SEQUENCE s ENGINE=InnoDB;
|
SELECT NEXTVAL(s);
|
CREATE TABLE t ENGINE=InnoDB SELECT LASTVAL(s) AS a;
|
SELECT * FROM t;
|
--sync_slave_with_master
|
SELECT * FROM t;
|
|
# Cleanup
|
--connection master
|
DROP TABLE t;
|
DROP SEQUENCE s;
|
--source include/rpl_end.inc
|
In the test case above, CREATE TABLE t ENGINE=InnoDB SELECT LASTVAL(s) AS a is written to the binary log as is, without splitting it into CREATE and a row insert. However, on the slave LASTVAL expectedly returns NULL, hence the table contents between master and slave diverge, which will naturally cause further replication problems.
Actual result
|
SELECT * FROM t;
|
a
|
1
|
connection slave;
|
SELECT * FROM t;
|
a
|
NULL
|