Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Commit

Permalink
fix: fix wrong shorthand for statement-size (#1195)
Browse files Browse the repository at this point in the history
Signed-off-by: ti-srebot <[email protected]>

Co-authored-by: Xuecheng Zhang <[email protected]>
  • Loading branch information
ti-srebot and csuzhangxc authored Oct 21, 2020
1 parent 5bfbd8a commit 097de17
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dumpling/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func parseExtraArgs(logger *log.Logger, dumpCfg *export.Config, args []string) e
dumplingFlagSet.StringSliceVarP(&tablesList, "tables-list", "T", nil, "Comma delimited table list to dump; must be qualified table names")
dumplingFlagSet.IntVarP(&dumpCfg.Threads, "threads", "t", dumpCfg.Threads, "Number of goroutines to use, default 4")
dumplingFlagSet.StringVarP(&fileSizeStr, "filesize", "F", "", "The approximate size of output file")
dumplingFlagSet.Uint64VarP(&dumpCfg.StatementSize, "statement-size", "S", dumpCfg.StatementSize, "Attempted size of INSERT statement in bytes")
dumplingFlagSet.Uint64VarP(&dumpCfg.StatementSize, "statement-size", "s", dumpCfg.StatementSize, "Attempted size of INSERT statement in bytes")
dumplingFlagSet.StringVar(&dumpCfg.Consistency, "consistency", dumpCfg.Consistency, "Consistency level during dumping: {auto|none|flush|lock|snapshot}")
dumplingFlagSet.StringVar(&dumpCfg.Snapshot, "snapshot", dumpCfg.Snapshot, "Snapshot position. Valid only when consistency=snapshot")
dumplingFlagSet.BoolVarP(&dumpCfg.NoViews, "no-views", "W", dumpCfg.NoViews, "Do not dump views")
Expand Down
3 changes: 2 additions & 1 deletion dumpling/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,13 @@ func (m *testDumplingSuite) TestParseArgsWontOverwrite(c *C) {
}
cfg.BAList = rules
// make sure we enter `parseExtraArgs`
cfg.ExtraArgs = "--statement-size=4000 --consistency lock"
cfg.ExtraArgs = "-s=4000 --consistency lock"

d := NewDumpling(cfg)
exportCfg, err := d.constructArgs()
c.Assert(err, IsNil)

c.Assert(exportCfg.StatementSize, Equals, uint64(4000))
c.Assert(exportCfg.FileSize, Equals, uint64(1*units.MiB))

f, err2 := tfilter.ParseMySQLReplicationRules(rules)
Expand Down

0 comments on commit 097de17

Please sign in to comment.