Skip to content

Commit 3ac3b5d

Browse files
committed
wip
1 parent 3f2c45c commit 3ac3b5d

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

internal/compiler/resolve.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ func (comp *Compiler) resolveCatalogRefs(qc *QueryCatalog, rvs []*ast.RangeVar,
245245
Table: table,
246246
IsNamedParam: isNamed,
247247
IsSqlcSlice: p.IsSqlcSlice(),
248-
IsDefaultNull: c.IsDefaultNull,
248+
IsDefaultNull: c.RawDefault.Pos() == 0,
249249
},
250250
})
251251
}

internal/sql/catalog/table.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -332,15 +332,16 @@ func (c *Catalog) createTable(stmt *ast.CreateTableStmt) error {
332332

333333
func (c *Catalog) defineColumn(table *ast.TableName, col *ast.ColumnDef) (*Column, error) {
334334
tc := &Column{
335-
Name: col.Colname,
336-
Type: *col.TypeName,
337-
IsNotNull: col.IsNotNull,
338-
IsUnsigned: col.IsUnsigned,
339-
IsArray: col.IsArray,
340-
ArrayDims: col.ArrayDims,
341-
Comment: col.Comment,
342-
Length: col.Length,
343-
RawDefault: col.RawDefault,
335+
Name: col.Colname,
336+
Type: *col.TypeName,
337+
IsNotNull: col.IsNotNull,
338+
IsUnsigned: col.IsUnsigned,
339+
IsArray: col.IsArray,
340+
ArrayDims: col.ArrayDims,
341+
Comment: col.Comment,
342+
Length: col.Length,
343+
RawDefault: col.RawDefault,
344+
IsDefaultNull: col.RawDefault == nil,
344345
}
345346
if col.Vals != nil {
346347
typeName := ast.TypeName{

0 commit comments

Comments
 (0)