Skip to content

Commit f65152a

Browse files
authored
Correctly generate code for MySQL cool (#970)
1 parent 7b899f2 commit f65152a

File tree

4 files changed

+11
-20
lines changed

4 files changed

+11
-20
lines changed

internal/compiler/output_columns.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ func outputColumns(qc *QueryCatalog, node ast.Node) ([]*Column, error) {
142142
DataType: c.DataType,
143143
NotNull: c.NotNull,
144144
IsArray: c.IsArray,
145+
Length: c.Length,
145146
})
146147
}
147148
}
@@ -321,6 +322,7 @@ func outputColumnRefs(res *ast.ResTarget, tables []*Table, node *ast.ColumnRef)
321322
DataType: c.DataType,
322323
NotNull: c.NotNull,
323324
IsArray: c.IsArray,
325+
Length: c.Length,
324326
})
325327
}
326328
}

internal/compiler/resolve.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ func resolveCatalogRefs(c *catalog.Catalog, rvs []*ast.RangeVar, args []paramRef
154154
DataType: dataType(&c.Type),
155155
NotNull: c.IsNotNull,
156156
IsArray: c.IsArray,
157+
Length: c.Length,
157158
Table: table,
158159
},
159160
})
@@ -295,6 +296,7 @@ func resolveCatalogRefs(c *catalog.Catalog, rvs []*ast.RangeVar, args []paramRef
295296
NotNull: c.IsNotNull,
296297
IsArray: c.IsArray,
297298
Table: &ast.TableName{Schema: schema, Name: rel},
299+
Length: c.Length,
298300
},
299301
})
300302
} else {

internal/endtoend/testdata/data_type_boolean/mysql/db/query.sql.go

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

internal/endtoend/testdata/insert_select/mysql/go/query.sql.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)