Skip to content

Commit

Permalink
support revert fast mode ddl on tidb
Browse files Browse the repository at this point in the history
  • Loading branch information
hongyunyan committed Aug 11, 2022
1 parent facf8f9 commit ea77538
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
3 changes: 1 addition & 2 deletions pkg/loader/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,6 @@ func isTiFlashDDL(sql string) bool {
// Since TiFlash statements are not available in other dbs.
// TiFlash related DDL:
// alter table xx set tiflash replica xx
// alter table xx set tiflash mode xx

stmt, err := parser.New().ParseOneStmt(sql, "", "")
if err != nil {
Expand All @@ -1006,7 +1005,7 @@ func isTiFlashDDL(sql string) bool {
}

for _, spec := range n.Specs {
if spec.Tp == ast.AlterTableSetTiFlashReplica || spec.Tp == ast.AlterTableSetTiFlashMode {
if spec.Tp == ast.AlterTableSetTiFlashReplica {
return true
}
}
Expand Down
8 changes: 0 additions & 8 deletions pkg/loader/load_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,6 @@ func (cs *LoadSuite) TestTiFlash(c *check.C) {
res := isTiFlashDDL(sql)
c.Assert(res, check.IsTrue)

sql = "ALTER TABLE t SET TIFLASH MODE FAST"
res = isTiFlashDDL(sql)
c.Assert(res, check.IsTrue)

sql = "ALTER TABLE t SET TIFLASH MODE NORMAL"
res = isTiFlashDDL(sql)
c.Assert(res, check.IsTrue)

sql = "create table a(id int)"
res = isTiFlashDDL(sql)
c.Assert(res, check.IsFalse)
Expand Down

0 comments on commit ea77538

Please sign in to comment.