Describe the bug
Outputs of the correlated query aren't DISTINCTed, which may result in duplicated rows.
See TODO here: https://github.com/glaredb/glaredb/blob/888b7f39b04fb647dc8131514d6886ec35e04d81/crates/glaredb_core/src/execution/planner/plan_magic_scan.rs#L46
To Reproduce
This should only output two rows:
glaredb> select a, (select a + 1) from (values (1), (1)) v(a);
┌───────┬──────────┐
│ a │ ?column? │
│ Int32 │ Int32 │
├───────┼──────────┤
│ 1 │ 2 │
│ 1 │ 2 │
│ 1 │ 2 │
│ 1 │ 2 │
└───────┴──────────┘
When using distinct values as the input, we produce the correct output:
glaredb> select a, (select a + 1) from (values (1), (2)) v(a);
┌───────┬──────────┐
│ a │ ?column? │
│ Int32 │ Int32 │
├───────┼──────────┤
│ 1 │ 2 │
│ 2 │ 3 │
└───────┴──────────┘
Expected behavior
Correct number of rows returned.
Describe the bug
Outputs of the correlated query aren't DISTINCTed, which may result in duplicated rows.
See TODO here: https://github.com/glaredb/glaredb/blob/888b7f39b04fb647dc8131514d6886ec35e04d81/crates/glaredb_core/src/execution/planner/plan_magic_scan.rs#L46
To Reproduce
This should only output two rows:
When using distinct values as the input, we produce the correct output:
Expected behavior
Correct number of rows returned.