[MDEV-14598] More robust way to switch table names Created: 2017-12-06  Updated: 2017-12-06

Status: Open
Project: MariaDB Server
Component/s: None
Fix Version/s: None

Type: Task Priority: Minor
Reporter: Federico Razzoli Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Sometimes it happens to replace a table with a new version, and still want to preserve the old table in the db (so it can be quickly restored if needed). In production, we do:

RENAME TABLE
    tab1 TO tmp_tab,
    tab2 TO tab1,
    tmp_tab TO tab2;

If tmp_tab exists, we get an error: this is expected but still annoying when you are doing some massive operation. It would be desirable that the optimiser understands that any free name is equally acceptable, as long as RENAME TABLE ends with the expected result or no change at all.


Generated at Thu Feb 08 08:14:49 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.