4105
MySQLWARNINGNotableMEDIUM confidence

Implicit inner transaction rollback behavior is deprecated

Production Risk

Medium — Transaction semantics may change in future MySQL versions, causing unexpected data states.

Why it happens
  1. 1An error occurred inside a transaction that triggered a statement-level rollback only.

Fix 1

Handle errors explicitly in application code

Why this works

Check for errors after each statement and issue ROLLBACK explicitly when an error is detected.

Fix 2

Use SAVEPOINT for partial rollback semantics

Use SAVEPOINT for partial rollback semantics
SAVEPOINT sp1; -- statement -- ROLLBACK TO sp1;

Why this works

SAVEPOINTs provide explicit control over partial rollback without relying on deprecated implicit behavior.

What not to do

Sources
Official documentation ↗

MySQL 8.0 — 4105 ER_WARN_DEPRECATED_INNER_TRX_ROLLBACK

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All MySQL errors