Help Center/ Relational Database Service/ Troubleshooting/ RDS for MySQL/ SQL Issues/ ERROR [1412] Reported for a DB Instance
Updated on 2022-12-05 GMT+08:00

ERROR [1412] Reported for a DB Instance

Scenario

When an SQL statement was executed on an RDS for MySQL instance, the following error message was displayed:

ERROR[1412]:Table definition has changed, please retry transaction``

Possible Causes

After a transaction with consistent snapshot was started, another session was executing DDL statements. Procedure for reproducing the problem:

  1. Session 1 starts a transaction with consistent snapshot.

  2. Session 2 executes a DDL statement to modify the table structure.

  3. Session 1 executes a common query statement.

You can also analyze binlogs or audit logs to check whether a DDL statement and transaction with consistent snapshot are executed concurrently on the same table.

Solution

Do not execute a DDL statement and transaction with consistent snapshot concurrently on the same table.