All Products
Search
Document Center

ApsaraDB RDS:The "1615: Prepared statement needs to be re-prepared" error message is displayed when I use my ApsaraDB RDS for MySQL instance. What do I do?

Last Updated:Aug 24, 2023

Problem description

The following error message is displayed when I execute a prepared statement on my ApsaraDB RDS for MySQL instance:

1615: Prepared statement needs to be re-prepared

Causes

The error may occur due to one of the following causes:

  • Cause 1:

    The execution of a prepared statement is performed in two phases: the phase in which the PREPARE statement is executed and the phase in which the EXECUTE statement is executed. The EXECUTE statement can be executed multiple times.

    During the interval of the preceding phases, data is changed, and TABLE_SHARE is recreated.

  • Cause 2:

    The error is caused by a bug that is introduced in MySQL 8.0.22. If the value of group_concat_max_len is larger than 4294967295, this error occurs. The bug is fixed in MySQL 8.0.26.

Solutions

You can use one of the following solutions:

  • Solution 1: On the Parameters page of your RDS instance, change the value of the table_definition_cache parameter. We recommend that you set this parameter to {LEAST(DBInstanceClassMemory/1073741824*512, 8192)}. For more information, see Modify the parameters of an ApsaraDB RDS for MySQL instance.
  • Solution 2: Update the minor engine version of your RDS instance to the most recent version. For more information, see Update the minor engine version.