Skip to content

Commit 35d5291

Browse files
committed
add suggested commits
1 parent 8e7c332 commit 35d5291

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

memory/table.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1258,7 +1258,7 @@ func addColumnToSchema(ctx *sql.Context, data *TableData, newCol *sql.Column, or
12581258

12591259
nextVal := data.autoIncVal + 1
12601260
if _, inRange, err := newCol.Type.Convert(ctx, nextVal); err == nil && inRange == sql.InRange {
1261-
data.autoIncVal++
1261+
data.autoIncVal = nextVal
12621262
}
12631263
}
12641264

memory/table_editor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,12 @@ func (t *tableEditor) Insert(ctx *sql.Context, row sql.Row) error {
195195
t.ea.TableData().autoIncVal = v.(uint64)
196196
nextVal := v.(uint64) + 1
197197
if _, inRange, err := autoCol.Type.Convert(ctx, nextVal); err == nil && inRange == sql.InRange {
198-
t.ea.TableData().autoIncVal++
198+
t.ea.TableData().autoIncVal = nextVal
199199
}
200200
} else if cmp == 0 {
201201
nextVal := t.ea.TableData().autoIncVal + 1
202202
if _, inRange, err := autoCol.Type.Convert(ctx, nextVal); err == nil && inRange == sql.InRange {
203-
t.ea.TableData().autoIncVal++
203+
t.ea.TableData().autoIncVal = nextVal
204204
}
205205
}
206206
}

0 commit comments

Comments
 (0)