Skip to content

Commit 6ea3ed6

Browse files
elianddbclaude
andcommitted
Revert auto-increment expression evaluation to standard approach
This reverts the PeekNextAutoIncrementValue approach in favor of fixing the real issue at the storage layer where auto-increment counter advancement was being done incorrectly. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 238cc56 commit 6ea3ed6

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

sql/expression/auto_increment.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,11 @@ func (i *AutoIncrement) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
128128
given = nil
129129
}
130130

131-
// Update integrator AUTO_INCREMENT sequence with our value
132131
seq, err := i.autoTbl.GetNextAutoIncrementValue(ctx, given)
133132
if err != nil {
134133
return nil, err
135134
}
136-
137-
// Use sequence value if NULL or 0 were provided
138-
if given == nil {
139-
given = seq
140-
}
135+
given = seq
141136

142137
ret, _, err := i.Type().Convert(ctx, given)
143138
if err != nil {

0 commit comments

Comments
 (0)