Help Center/ GaussDB(for MySQL)/ Troubleshooting/ SQL Issues/ ERROR [1412] Reported for a DB Instance
Updated on 2024-09-05 GMT+08:00

ERROR [1412] Reported for a DB Instance

Scenario

When an SQL statement was executed on a DB 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.