Silent MySQL Engine Mismatch Left a Transaction Half-Rolled Back in Production
A developer testing a new ERP screen discovered that an explicit database ROLLBACK only partially undid two writes, leaving one table changed despite the transaction being cancelled. The cause was a mixed-engine schema: the item table used InnoDB, which supports transactions, while the volume table used the older MyISAM engine, which does not — and silently ignores BEGIN, COMMIT, and ROLLBACK commands. The schema had evolved over years in a Delphi-based factory ERP, with different storage engines assigned by different contributors at different times. Crucially, the developer's exported schema snapshot — used as a reference by both humans and an AI coding agent — recorded tables, columns, and indexes but omitted the storage engine field entirely. Since a full conversion of MyISAM tables was not immediately feasible, the fix involved reordering writes so the reversible InnoDB operation runs first and the irreversible MyISAM write only executes after the first has successfully committed.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in