Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

leave aliases in projection #1930

Merged
merged 15 commits into from
Aug 18, 2023
9 changes: 9 additions & 0 deletions enginetest/enginetests.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,23 @@ func TestQueriesPrepared(t *testing.T, harness Harness) {
func TestJoinQueriesPrepared(t *testing.T, harness Harness) {
harness.Setup(setup.MydbData, setup.MytableData, setup.Pk_tablesData, setup.OthertableData, setup.NiltableData, setup.XyData)
for _, tt := range queries.JoinQueryTests {
if tt.SkipPrepared {
continue
}
TestPreparedQuery(t, harness, tt.Query, tt.Expected, tt.ExpectedColumns)
}
for _, ts := range queries.JoinScriptTests {
if ts.SkipPrepared {
continue
}
TestScriptPrepared(t, harness, ts)
}

t.Skip()
for _, tt := range queries.SkippedJoinQueryTests {
if tt.SkipPrepared {
continue
}
TestPreparedQuery(t, harness, tt.Query, tt.Expected, tt.ExpectedColumns)
}
}
Expand Down
15 changes: 15 additions & 0 deletions enginetest/queries/join_queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,21 @@ inner join pq on true order by 1,2,3,4,5,6,7,8 limit 5;`,
{1, "first row", 6, 6, 0, float64(6)},
},
},
{
//SkipPrepared: true,
Query: `SELECT pk as pk, nt.i as i, nt2.i as i FROM one_pk
RIGHT JOIN niltable nt ON pk=nt.i
RIGHT JOIN niltable nt2 ON pk=nt2.i - 1
ORDER BY 3;`,
Expected: []sql.Row{
{nil, nil, 1},
{1, 1, 2},
{2, 2, 3},
{3, 3, 4},
{nil, nil, 5},
{nil, nil, 6},
},
},
{
Query: "select * from ab full join pq on a = p order by 1,2,3,4;",
Expected: []sql.Row{
Expand Down
6 changes: 3 additions & 3 deletions enginetest/queries/queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -763,9 +763,9 @@ var QueryTests = []QueryTest{
{
Query: `SELECT s as i, i as i from mytable order by 1`,
Expected: []sql.Row{
{"first row", "first row"},
{"second row", "second row"},
{"third row", "third row"},
{"first row", 1},
{"second row", 2},
{"third row", 3},
},
},
{
Expand Down
Loading