[MDEV-29205] Invalid, non-executed (split) DROP statement is logged to binlog Created: 2022-07-29  Updated: 2022-07-29

Status: Open
Project: MariaDB Server
Component/s: Admin statements, Replication
Affects Version/s: 10.8.3
Fix Version/s: None

Type: Bug Priority: Major
Reporter: sjon Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Given a database that contains foreign keys that cannot be dropped without disabling foreign key checks, mysqladmin drop will fail, but still log the statement to the binlog - leading to replication failures.

unfortunately there seems to be multiple issues combined and I haven't been able to properly reproduce this

  • have a database that cannot be dropped due to mysql saying Cannot delete or update a parent row: a foreign key constraint fails
  • use mysqladmin drop on that database, leading to the error above (this is somewhat unexpected when the FKs are all within that one DB)
  • the server will binlog a 'split' DROP TABLES statement instead of DROP DATABASE - eg it will execute DROP TABLE IF EXISTS a,b,c / DROP TABLE IF EXISTS d,e,f / DROP TABLE IF EXISTS g,h,i which definitely fails with foreign keys
  • slaves fail on this same 'split' query even though the master never actually executed it


 Comments   
Comment by sjon [ 2022-07-29 ]

The magic 'split' DROP TABLE statements seem to be some mariadb feature as they are also referenced in this unittest

The queries are split because the length exceeds MAX_DROP_TABLE_Q_LEN

Generated at Thu Feb 08 10:06:43 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.