|
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.
|