reverted bad SQL