cubicweb #15393583 KeyError X in SQL generator with both a WHERE and a WITH clause [validation pending]

query to reproduce: Any X ORDERBY X LIMIT 21 WHERE X eid >= 1200 WITH X BEING ((Any X WHERE X is Ticket) UNION (Any X WHERE X is Version)), eg. https://www.cubicweb.org/view?rql=rql%3A+Any+X+ORDERBY+X+LIMIT+21+WHERE+X+eid+%3E%3D+1200+WITH+X+BEING+%28%28Any+X+WHERE+X+is+Ticket%29+UNION+%28Any+X+WHERE+X+is+Version%29%29

prioritynormal
typebug
done in3.24.0
load left0.000
closed by#1913a3e8816a [rql2sql] Handle comparison of eid on variables from an subquery
patch[rql2sql] Handle comparison of eid on variables from an subquery [applied][rql2sql] Handle comparison of eid on variables from an subquery [folded]