Fix invalid SQL for rename table when there were no records to copy.