Skip to content

Commit 151f322

Browse files
committed
add suggested commits
1 parent c840e36 commit 151f322

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
@@ -193,12 +193,12 @@ func (t *tableEditor) Insert(ctx *sql.Context, row sql.Row) error {
193193
t.ea.TableData().autoIncVal = v.(uint64)
194194
nextVal := v.(uint64) + 1
195195
if _, inRange, err := autoCol.Type.Convert(ctx, nextVal); err == nil && inRange == sql.InRange {
196-
t.ea.TableData().autoIncVal++
196+
t.ea.TableData().autoIncVal = nextVal
197197
}
198198
} else if cmp == 0 {
199199
nextVal := t.ea.TableData().autoIncVal + 1
200200
if _, inRange, err := autoCol.Type.Convert(ctx, nextVal); err == nil && inRange == sql.InRange {
201-
t.ea.TableData().autoIncVal++
201+
t.ea.TableData().autoIncVal = nextVal
202202
}
203203
}
204204
}

0 commit comments

Comments
 (0)