Fixed raiseError - an invalid query no longer crashes the server; select now checks if a column is valid