Fixed #22975: Don't call rename SQL if not needed