TRUNCATE TABLE Breaks Replication With Errno 1701 From a 5.0/5.1 Master To a 5.5+ Slave (Doc ID 1458857.1)

Last updated on MARCH 14, 2017

Applies to:

MySQL Server - Version 5.0 and later
Information in this document applies to any platform.

Symptoms

When running a TRUNCATE TABLE statement on a 5.0/5.1 Master, the 5.5+ Replication Slave breaks with this error:

Last_Errno: 1701
Last_Error: Error 'Cannot truncate a table referenced in a foreign key constraint ('dbname'.'tblename', CONSTRAINT 'transaction_actions_ibfk_1' FOREIGN KEY ('id1', 'id2') REFERENCES 'dbname'.'tblename2' ('id', 'id2)' on query. Default database: 'dbname'. Query: 'truncate table tblename'

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms