Skip to content

Commit 916b8d3

Browse files
authored
fix(compiler): Fix left join nullability with table aliases (#1491)
1 parent 9240b66 commit 916b8d3

File tree

7 files changed

+954
-9
lines changed

7 files changed

+954
-9
lines changed

internal/compiler/output_columns.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,15 @@ func outputColumns(qc *QueryCatalog, node ast.Node) ([]*Column, error) {
182182
cname = *res.Name
183183
}
184184
cols = append(cols, &Column{
185-
Name: cname,
186-
Type: c.Type,
187-
Scope: scope,
188-
Table: c.Table,
189-
DataType: c.DataType,
190-
NotNull: c.NotNull,
191-
IsArray: c.IsArray,
192-
Length: c.Length,
185+
Name: cname,
186+
Type: c.Type,
187+
Scope: scope,
188+
Table: c.Table,
189+
TableAlias: t.Rel.Name,
190+
DataType: c.DataType,
191+
NotNull: c.NotNull,
192+
IsArray: c.IsArray,
193+
Length: c.Length,
193194
})
194195
}
195196
}

internal/endtoend/testdata/join_left/mysql/go/models.go

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)