Terminated result set processing for failed queries