CDB-2081 Returns original query in case there are no clauses to apply.