fix MALFORMED_QUERY bug when query_all