Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bugs in offline mode #16

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cmd/capture.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ func newCaptureCmd() *cobra.Command {
}

cmd.Flags().StringVar(&opt.mode, "mode", "", "online / offline")
cmd.Flags().StringVar(&opt.db1.addr, "addr1", "127.0.0.1", "address of the first TiDB")
cmd.Flags().StringVar(&opt.db1.addr, "addr1", "", "address of the first TiDB")
cmd.Flags().StringVar(&opt.db1.port, "port1", "4000", "port of the first TiDB")
cmd.Flags().StringVar(&opt.db1.statusPort, "status-port1", "10080", "status port of the first TiDB")
cmd.Flags().StringVar(&opt.db1.user, "user1", "", "user name to access the first TiDB")
cmd.Flags().StringVar(&opt.db1.user, "user1", "root", "user name to access the first TiDB")
cmd.Flags().StringVar(&opt.db1.password, "password1", "", "password to access the first TiDB")
cmd.Flags().StringVar(&opt.db2.addr, "addr2", "127.0.0.1", "address of the first TiDB")
cmd.Flags().StringVar(&opt.db2.port, "port2", "4000", "port of the first TiDB")
cmd.Flags().StringVar(&opt.db2.user, "user2", "", "user name to access the first TiDB")
cmd.Flags().StringVar(&opt.db2.password, "password2", "", "password to access the first TiDB")
cmd.Flags().StringVar(&opt.db2.addr, "addr2", "", "address of the second TiDB")
cmd.Flags().StringVar(&opt.db2.port, "port2", "", "port of the second TiDB")
cmd.Flags().StringVar(&opt.db2.user, "user2", "root", "user name to access the second TiDB")
cmd.Flags().StringVar(&opt.db2.password, "password2", "", "password to access the second TiDB")
cmd.Flags().StringVar(&opt.db1.version, "ver1", "", "version of the first TiDB")
cmd.Flags().StringVar(&opt.db2.version, "ver2", "", "version of the second TiDB")
cmd.Flags().StringVar(&opt.queryFile, "query-file", "", "query file path")
Expand Down
7 changes: 5 additions & 2 deletions cmd/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ func importSchemas(db *tidbHandler, dbName, table, dir string) error {
func importStats(db *tidbHandler, dbName, table, dir string) error {
statsPath := statsPath(dbName, table, dir)
mysql.RegisterLocalFile(statsPath)
fmt.Printf("import schemas from %v successfully\n", statsPath)
return db.execute(fmt.Sprintf("load stats '%v'", statsPath))
err := db.execute(fmt.Sprintf("load stats '%v'", statsPath))
if err != nil {
fmt.Printf("import schemas from %v successfully\n", statsPath)
}
return err
}