Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
Signed-off-by: arenatlx <[email protected]>
  • Loading branch information
AilinKid committed Jan 8, 2025
1 parent 0091eb3 commit f47c770
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ Usage of ./mysql-tester:
If --error ERR does not match, return error instead of just warn
-cascades
Record the result based on cascades planner into result file with .casult suffix.
-cascades-suffix
Specify the result file suffix for cascades planner, default with .casult suffix.
```

By default, it connects to the TiDB/MySQL server at `127.0.0.1:4000` with `root` and no passward:
Expand Down
8 changes: 7 additions & 1 deletion src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ var (
collationDisable bool
checkErr bool
cascades bool
cascadesSuffix string
)

func init() {
Expand All @@ -65,6 +66,7 @@ func init() {
flag.BoolVar(&checkErr, "check-error", false, "if --error ERR does not match, return error instead of just warn")
flag.BoolVar(&collationDisable, "collation-disable", false, "run collation related-test with new-collation disabled")
flag.BoolVar(&cascades, "cascades", false, "run exec and query based on cascades planner")
flag.StringVar(&cascadesSuffix, "cascades-suffix", "casult", "the result file suffix for cascades planner")
}

const (
Expand Down Expand Up @@ -202,6 +204,10 @@ func setSessionVariable(db *Conn) {
if _, err := db.conn.ExecContext(ctx, "SET @@tidb_enable_cascades_planner=1"); err != nil {
log.Fatalf("Executing \"SET @@tidb_enable_cascades_planner=1\" err[%v]", err)
}
} else {
if _, err := db.conn.ExecContext(ctx, "SET @@tidb_enable_cascades_planner=0"); err != nil {
log.Fatalf("Executing \"SET @@tidb_enable_cascades_planner=0\" err[%v]", err)
}
}
}

Expand Down Expand Up @@ -1090,7 +1096,7 @@ func (t *tester) resultFileName() string {
}
suffix := "result"
if cascades {
suffix = "casult"
suffix = cascadesSuffix
}
return fmt.Sprintf("./r/%s.%s", name, suffix)
}
Expand Down

0 comments on commit f47c770

Please sign in to comment.