mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Temporary tables vs MysQL GTID consistency #6230
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @arnaud-lb on GitHub (May 2, 2019).
Originally assigned to: @Ocramius on GitHub.
Bug Report
Summary
OneToManyPersister uses
CREATE TEMPORARY TABLEwhen removing orphaned collections, which is not allowed in MySQL when using global transaction IDs.Global transaction IDs is a feature that makes operating MySQL much easier when using replication. It is enabled server-wide. I suspect that it is very common that this feature is enabled on production servers.
Current behavior
When a OneToMany full collection is replaced, the following exception occurs:
Full trace here: https://gist.github.com/arnaud-lb/31b20963b01ff2ccc8b1bcd5f75fc461
@Ocramius commented on GitHub (May 3, 2019):
This is not fixable: as per
1587aac4ff, this is required for Joined Table Inheritance and OneToMany associations inorphanRemoval.Since the GTID consistency is a niche, I'm gonna mark this as "can't fix". If an alternate approach (to
1587aac4ff) is needed, then we'd need that first.@KVestergaard commented on GitHub (Nov 10, 2023):
Not a niche any more. Azure (and others) require enforced gtid compliance for replication (e.g. geo-replication for HA).
@Ocramius commented on GitHub (Nov 10, 2023):
@KVestergaard open a new issue please: this is 4 years old, and the context may have changed.