Skip to content

Commit 0c9925a

Browse files
committed
[ga-format-pr] Run ./format_repo.sh to fix formatting
1 parent f2022cf commit 0c9925a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

enginetest/queries/generated_columns.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ var GeneratedColumnTests = []ScriptTest{
124124
},
125125
{
126126
Query: "update t set j = default where i = 5", // Explicit DEFAULT on specific row
127-
Expected: []sql.Row{{NewUpdateResult(1, 0)}}, // 1 row matched, 0 changed (value already correct)
127+
Expected: []sql.Row{{NewUpdateResult(1, 0)}}, // 1 row matched, 0 changed (value already correct)
128128
},
129129
{
130130
Query: "select * from t where i = 5",

sql/planbuilder/dml.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,13 +291,13 @@ func (b *Builder) assignmentExprsToExpressions(inScope *scope, e ast.AssignmentE
291291
colIdx := tableSch.IndexOfColName(gf.Name())
292292
// TODO: during trigger parsing the table in the node is unresolved, so we need this additional bounds check
293293
// This means that trigger execution will be able to update generated columns
294-
294+
295295
// Check if this is a DEFAULT expression for a generated column
296296
isDefaultExpr := false
297297
if _, ok := updateExpr.Expr.(*ast.Default); ok {
298298
isDefaultExpr = true
299299
}
300-
300+
301301
// Prevent update of generated columns, but allow DEFAULT
302302
if colIdx >= 0 && tableSch[colIdx].Generated != nil && !isDefaultExpr {
303303
err := sql.ErrGeneratedColumnValue.New(tableSch[colIdx].Name, inScope.node.(sql.NameableNode).Name())

0 commit comments

Comments
 (0)