From 3b85ddcc9a9a301b593cffcb92072268eeb5e7cf Mon Sep 17 00:00:00 2001 From: Mark Oberemk Date: Mon, 2 May 2016 12:25:04 -0400 Subject: [PATCH] Properly quotes column names in post-insert SELECT This commit closes #979 by fixing the post-insert SELECT call --- callback_create.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/callback_create.go b/callback_create.go index e3cd2f0b..b57916cc 100644 --- a/callback_create.go +++ b/callback_create.go @@ -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))