Skip to content

Commit

Permalink
ddl: fix a bug that create two views with same name success (#58770) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Feb 26, 2025
1 parent 2934832 commit 84cd02e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/ddl/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ func onCreateView(d *ddlCtx, t *meta.Meta, job *model.Job) (ver int64, _ error)
tbInfo.State = model.StateNone

oldTableID, err := findTableIDByName(d, t, schemaID, tbInfo.Name.L)
if err == nil && oldTableID > 0 {
err = infoschema.ErrTableExists
}
if infoschema.ErrTableNotExists.Equal(err) {
err = nil
}
Expand Down

0 comments on commit 84cd02e

Please sign in to comment.