From 9cc9170fbcfc8d5224c795baf9b7df4023eee919 Mon Sep 17 00:00:00 2001 From: Chunzhu Li Date: Mon, 23 Aug 2021 14:58:51 +0800 Subject: [PATCH] address comments --- v4/export/block_allow_list.go | 2 +- v4/export/block_allow_list_test.go | 4 ++-- v4/export/prepare.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/v4/export/block_allow_list.go b/v4/export/block_allow_list.go index cf0c9ab4..194be0e2 100644 --- a/v4/export/block_allow_list.go +++ b/v4/export/block_allow_list.go @@ -8,7 +8,7 @@ import ( tcontext "github.com/pingcap/dumpling/v4/context" ) -func filterDataBases(tctx *tcontext.Context, conf *Config, databases []string) []string { +func filterDatabases(tctx *tcontext.Context, conf *Config, databases []string) []string { tctx.L().Debug("start to filter databases") newDatabases := make([]string, 0, len(databases)) ignoreDatabases := make([]string, 0, len(databases)) diff --git a/v4/export/block_allow_list_test.go b/v4/export/block_allow_list_test.go index f69bc657..845bcfba 100644 --- a/v4/export/block_allow_list_test.go +++ b/v4/export/block_allow_list_test.go @@ -38,10 +38,10 @@ func (s *testBWListSuite) TestFilterTables(c *C) { } databases := []string{filter.InformationSchemaName, filter.PerformanceSchemaName, "xxx", "yyy"} - c.Assert(filterDataBases(tctx, conf, databases), DeepEquals, databases) + c.Assert(filterDatabases(tctx, conf, databases), DeepEquals, databases) conf.TableFilter = tf.NewSchemasFilter("xxx") - c.Assert(filterDataBases(tctx, conf, databases), DeepEquals, []string{"xxx"}) + c.Assert(filterDatabases(tctx, conf, databases), DeepEquals, []string{"xxx"}) filterTables(tcontext.Background(), conf) c.Assert(conf.Tables, HasLen, 1) c.Assert(conf.Tables, DeepEquals, expectedDBTables) diff --git a/v4/export/prepare.go b/v4/export/prepare.go index 62e1a3e5..2a6d7a14 100644 --- a/v4/export/prepare.go +++ b/v4/export/prepare.go @@ -82,7 +82,7 @@ func prepareDumpingDatabases(tctx *tcontext.Context, conf *Config, db *sql.Conn) if err != nil { return nil, err } - databases = filterDataBases(tctx, conf, databases) + databases = filterDatabases(tctx, conf, databases) if len(conf.Databases) == 0 { return databases, nil }