Skip to content

Conversation

@msullivan
Copy link
Member

Make IteratorStmt bind with WITH instead of FOR when
self_ref_must_bind. This gives us a distinct name for the binding
but still relies on the Select or whatever to do the actual binding,
which makes ORDER BY work properly.

(Previously ORDER BY wouldn't work in these cases because it was
inside a FOR.)

Fixes #893.

Make IteratorStmt bind with WITH instead of FOR when
self_ref_must_bind.  This gives us a distinct name for the binding
but still relies on the Select or whatever to do the actual binding,
which makes ORDER BY work properly.

(Previously ORDER BY wouldn't work in these cases because it was
inside a FOR.)

Fixes #893.
@msullivan msullivan merged commit 30ef7bf into master Sep 4, 2025
42 checks passed
@msullivan msullivan deleted the order-by branch September 4, 2025 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.order_by doesn't work if query uses a FOR for binding

3 participants