Skip to content

Commit 0540edb

Browse files
committed
add implicit default null
1 parent ebf955b commit 0540edb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sql/planbuilder/ddl.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,11 +1421,11 @@ func (b *Builder) tableSpecToSchema(inScope, outScope *scope, db sql.Database, t
14211421
schema[i].Default = b.convertDefaultExpression(outScope, def, schema[i].Type, schema[i].Nullable)
14221422
if schema[i].Default == nil && schema[i].Nullable {
14231423
schema[i].Default = &sql.ColumnDefaultValue{
1424-
Expr: expression.NewLiteral(nil, schema[i].Type),
1425-
OutType: nil,
1424+
Expr: b.buildScalar(inScope, &ast.NullVal{}),
1425+
OutType: types.Null,
14261426
Literal: true,
1427-
Parenthesized: false,
14281427
ReturnNil: true,
1428+
Parenthesized: false,
14291429
}
14301430
}
14311431
err := validateDefaultExprs(schema[i])

0 commit comments

Comments
 (0)