Skip to content

Commit

Permalink
OrderedDistinct passes join tree row during exec (#1700)
Browse files Browse the repository at this point in the history
* OrderedDistinct passes join tree row during exec

* float result
  • Loading branch information
max-hoffman authored Apr 7, 2023
1 parent 4d14ac4 commit 76d35db
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions enginetest/join_op_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,16 @@ var joinOpTests = []struct {
setup.XyData[0],
},
tests: []JoinOpTests{
{
Query: `
SELECT SUM(x) FROM xy WHERE x IN (
SELECT u FROM uv WHERE u IN (
SELECT a FROM ab WHERE a = 2
)
) AND
x = 2;`,
Expected: []sql.Row{{float64(2)}},
},
{
Query: "select * from ab left join uv on a = u where exists (select * from uv where false)",
Expected: []sql.Row{},
Expand Down
2 changes: 1 addition & 1 deletion sql/plan/distinct.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func (d *OrderedDistinct) Resolved() bool {
func (d *OrderedDistinct) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error) {
span, ctx := ctx.Span("plan.OrderedDistinct")

it, err := d.Child.RowIter(ctx, nil)
it, err := d.Child.RowIter(ctx, row)
if err != nil {
span.End()
return nil, err
Expand Down

0 comments on commit 76d35db

Please sign in to comment.