diff --git a/internal/dumper/dumper.go b/internal/dumper/dumper.go index ea9cb145..273d9eaa 100644 --- a/internal/dumper/dumper.go +++ b/internal/dumper/dumper.go @@ -89,7 +89,8 @@ type dumpContext struct { } func (d *Dumper) Run(ctx context.Context) error { - initPool, err := NewPool(d.log, d.cfg.Threads, d.cfg.Address, d.cfg.User, d.cfg.Password, nil, "") + // dumpTableSchema runs against initPool, so it needs --shard's USE pin in SessionVars too. + initPool, err := NewPool(d.log, d.cfg.Threads, d.cfg.Address, d.cfg.User, d.cfg.Password, d.cfg.SessionVars, "") if err != nil { return err }