MDEV-26772 InnoDB DDL fails with DUPLICATE KEY error
ha_innobase::delete_table(): When the table that is being dropped has a name starting with #sql, temporarily set innodb_lock_wait_timeout=0 while attempting to lock the persistent statistics tables. If the statistics tables cannot be locked, pretend that statistics did not exist and carry on with dropping the table. The SQL layer is not really prepared for failures of this operation. This is what fixes the test case. ha_innobase::rename_table(): When renaming a table from a name that starts with #sql, try to lock the statistics tables with an immediate timeout, and ignore the statistics if the locks were not available. In fact, during any rename from a #sql name, dict_stats_rename_table() should have no effect, because already when an earlier rename to a #sql name took place we should have deleted the statistics for the table using the non-#sql name. This change is just analogous to the ha_innobase::delete_table().
Showing
Please register or sign in to comment