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

fix: fix wrong shorthand for statement-size (#1195) #1196

Merged
merged 1 commit into from
Oct 21, 2020
Merged
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
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