Added an additional test join query

This commit is contained in:
Zach Musgrave
2019-07-16 11:19:55 -07:00
parent b94008f5e9
commit 5de95a5cf7

View File

@@ -1120,6 +1120,19 @@ var JoinTests = []SelectTest{
ExpectedSchema: NewResultSetSchema("eid", types.IntKind, "p.id", types.IntKind,
"ename", types.StringKind, "pfirst", types.StringKind, "last", types.StringKind),
},
{
Name: "Join from table with two key columns to table with one key column",
Query: "select a.episode_id as aid, p.id as pid, p.first from appearances a join people p on a.character_id = p.id order by 1",
ExpectedRows: Rs(
NewResultSetRow(types.Int(0), types.Int(0), types.String("Homer")),
NewResultSetRow(types.Int(1), types.Int(1), types.String("Marge")),
NewResultSetRow(types.Int(2), types.Int(2), types.String("Bart")),
NewResultSetRow(types.Int(3), types.Int(3), types.String("Lisa")),
NewResultSetRow(types.Int(4), types.Int(4), types.String("Moe")),
),
ExpectedSchema: NewResultSetSchema("aid", types.IntKind, "pid", types.IntKind,
"first", types.StringKind),
},
}
// CreateTableFn returns a SetupFunc that creates a table with the rows given