Skip to content

Commit

Permalink
Properly quotes column names in post-insert SELECT
Browse files Browse the repository at this point in the history
This commit closes go-gorm#979 by fixing the post-insert SELECT call
  • Loading branch information
moberemk committed May 2, 2016
1 parent 465f8ea commit 3b85ddc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion callback_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func createCallback(scope *Scope) {
if field.IsNormal {
if !field.IsPrimaryKey || !field.IsBlank {
if field.IsBlank && field.HasDefaultValue {
blankColumnsWithDefaultValue = append(blankColumnsWithDefaultValue, field.DBName)
blankColumnsWithDefaultValue = append(blankColumnsWithDefaultValue, scope.Quote(field.DBName))
scope.InstanceSet("gorm:blank_columns_with_default_value", blankColumnsWithDefaultValue)
} else {
columns = append(columns, scope.Quote(field.DBName))
Expand Down

0 comments on commit 3b85ddc

Please sign in to comment.