mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
Bug#54201: "SET INSERT_ID" event must be ignored if corresponding event is ignored
An INSERT query log event is preceeded by an INSERT_ID intvar event if the INSERT allocates a new auto_increment value. But if we ignore the INSERT due to --replicate-ignore-table or similar, then the INSERT_ID event is still executed, and the set value of INSERT_ID lingers around in the slave sql thread THD object indefinitely until the next INSERT that happens to need allocation of a new auto_increment value. Normally this does not cause problems as such following INSERT would normally come with its own INSERT_ID event. In this bug, the user had a trigger on the slave which was missing on the master, and this trigger had an INSERT which could be affected. In any case, it seems better to not leave a stray INSERT_ID hanging around in the sql thread THD indefinitely. Note that events can also be skipped from apply_event_and_update_pos(); however it is not possible in that code to skip the INSERT without also skipping the INSERT_ID event.
This commit is contained in:
1
mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt
Normal file
1
mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt
Normal file
@@ -0,0 +1 @@
|
||||
--replicate-ignore-table=test.t_ignored1
|
Reference in New Issue
Block a user