Skip to content

Commit

Permalink
feat: add case for dbddl (#246)
Browse files Browse the repository at this point in the history
* feat: add case for dbddl

Signed-off-by: earayu <earayu@163.com>

* feat: add case for dbddl

Signed-off-by: earayu <earayu@163.com>

* feat: add case for dbddl

Signed-off-by: earayu <earayu@163.com>

---------

Signed-off-by: earayu <earayu@163.com>
  • Loading branch information
earayu authored Aug 30, 2023
1 parent 89e6997 commit 245cf04
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions go/vt/topotools/keyspace_manegement.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ package topotools
import (
"fmt"

"github.com/pingcap/failpoint"

"vitess.io/vitess/go/internal/global"

"golang.org/x/net/context"
Expand Down Expand Up @@ -57,6 +59,12 @@ func createDatabaseInternal(ctx context.Context, ts *topo.Server, f func() error
return fmt.Errorf("CreateKeyspace(%v:%v) failed: %v", keyspaceName, defaultShardName, err)
}

failpoint.Inject("create-database-error-on-dbname", func(v failpoint.Value) {
if v != nil && v.(string) == keyspaceName {
failpoint.Return(fmt.Errorf("create-database-error-on-dbname error injected"))
}
})

err = f()
if err != nil {
return err
Expand Down

0 comments on commit 245cf04

Please sign in to comment.