I wrote: > I'm inclined to think we have to reject cases like this.
Concretely, about like this. I noticed that the adjacent error cases in RewriteQuery were mostly not covered either by the regression tests, so I added tests to hit them all.
It makes sense to me we reject this case. Tested the patch and it works as expected.