Fix query alter.