PlanStateSaver probably should save and restore value for exprToColumn, otherwise external order by can affect build side of the join (what columns this side will produce)
Fix is trivial: serenedb@5ba93e2
I'm not completely sure how to test this in Axiom upstream, any advice is highly appreciate.
SereneDB uses sqllogictest framework and sqllogic tests, and when we tried to run these queries we found this issue.
You can find query here serenedb/serenedb#107
This query can't work in upstream Axiom because Axiom upstream doesn't support such subqueries and cross joins.
@mbasmanova