Skip to content

Commit

Permalink
Revert some changes in last merge
Browse files Browse the repository at this point in the history
  • Loading branch information
joechenrh committed Jan 21, 2025
1 parent a8f457e commit e107525
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 48 deletions.
40 changes: 2 additions & 38 deletions framework/mainloop.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,20 +523,6 @@ type checker interface {
check(sql string, isReduce bool) (bool, error)
}

// Run random add/drop index
func (c *testCase) runDDL(state *sqlgenerator.State) error {
sql, err := sqlgenerator.AddOrDropIndex.Eval(state)
if err != nil {
return err
}

if err = c.execSQL(sql); err != nil {
return err
}

return nil
}

// execute iterates over two list of operations concurrently, one is
// ddl operations, one is dml operations.
// When one list completes, it starts over from the beginning again.
Expand Down Expand Up @@ -625,30 +611,9 @@ func (c *testCase) execute(ctx context.Context) error {
sqlgenerator.PrepareIndexJoinColumns(state)
defer sqlgenerator.RemoveIndexJoinColumns(state)

stateDDL := sqlgenerator.NewState()
stateDDL.Tables = state.Tables
ddlFailed := false
go func() {
for {
select {
case <-ctx.Done():
return
default:
time.Sleep(time.Second)
if err := c.runDDL(stateDDL); err != nil {
ddlFailed = true
return
}
}
}
}()

cnt := 0
for {
if ddlFailed {
break
}

for {
cnt++
if cnt%10000 == 0 {
err := c.executeAdminCheck()
Expand Down Expand Up @@ -678,7 +643,7 @@ func (c *testCase) execute(ctx context.Context) error {
return err
}
if rand.Intn(100) == 0 {
//dmlSQL, err = sqlgenerator.SetTiFlashReplica.Eval(state)
dmlSQL, err = sqlgenerator.SetTiFlashReplica.Eval(state)
if err != nil {
return err
}
Expand Down Expand Up @@ -764,7 +729,6 @@ func (c *testCase) execute(ctx context.Context) error {
fmt.Sprintf("old count of orginal SQL:%d, new count of orginal SQL:%d,\nold count of reduce SQL:%d, new count of reduce SQL:%d,\nold query of orginal SQL: %s\nnew query of reduce SQL: %s\nreduce query: %s\n\n\n",
c.cntOfOldOriginal, c.cntOfNewOriginal, c.cntOfOldReduce, c.cntOfNewReduce, c.originalSQL, c.reduceChangedSQL, c.reduceSQL))
}
c.outputWriter.Sync()
globalBugSeqNum++
num := globalBugSeqNum

Expand Down
10 changes: 0 additions & 10 deletions sqlgenerator/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,16 +415,6 @@ var DropIndex = NewFn(func(state *State) Fn {
return Strs("drop index", idx.Name)
})

var AddOrDropIndex = NewFn(func(state *State) Fn {
tbl := state.Tables.Rand()
state.env.Table = tbl
return And(Str("alter table"), Str(tbl.Name),
Or(
AddIndex,
DropIndex,
))
})

var AddColumn = NewFn(func(state *State) Fn {
tbl := state.env.Table
newCol := &Column{ID: state.alloc.AllocColumnID()}
Expand Down

0 comments on commit e107525

Please sign in to comment.