TEIID-2745 ensuring that the criteria are not disrupted by the rewrite