Merge pull request #4229 from dolthub/andy/auto-fix

go/doltcore/sqle/globalstate: Reset AUTO_INCREMENT sequence to 1 on table drop
This commit is contained in:
AndyA
2022-08-30 13:52:23 -07:00
committed by GitHub

View File

@@ -160,8 +160,8 @@ func (a AutoIncrementTracker) DropTable(ctx context.Context, tableName string, w
a.mu.Lock()
defer a.mu.Unlock()
tableName = strings.ToLower(tableName)
delete(a.sequences, tableName)
// reset sequence to the minimum value
a.sequences[strings.ToLower(tableName)] = 1
// Get the new highest value from all tables in the working sets given
for _, ws := range wses {