You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(unparser): keep a DISTINCT ON's sort expressions when naming its outputs
Rebuilding a node from the expressions a plan reports drops what those
expressions do not carry. For `Distinct::On` that is the `ORDER BY`, and
`with_new_exprs` asserts it was never asked to carry it — so naming the outputs
of a projection under a `DISTINCT ON ... ORDER BY` panicked while unparsing a
plan that is otherwise valid.
Replace only the input on each node walked through, leaving every other field as
it stands, which cannot drop a field the walk does not know about.
@r#"SELECT "t.a + t.b" FROM (SELECT DISTINCT ON (t.a) "t.a + t.b", a FROM (SELECT (t.a + t.b) AS "t.a + t.b", t.a FROM t) ORDER BY a ASC NULLS LAST LIMIT 5)"#
0 commit comments