From b7671b6ee496bef860db359d591ae19c2dd79bee Mon Sep 17 00:00:00 2001 From: lance6716 Date: Wed, 30 Dec 2020 15:25:52 +0800 Subject: [PATCH] dump: don't dump data for view (#227) --- dumpling/tests/views/run.sh | 3 ++- dumpling/v4/export/dump.go | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dumpling/tests/views/run.sh b/dumpling/tests/views/run.sh index b99f3f77..6b18e513 100644 --- a/dumpling/tests/views/run.sh +++ b/dumpling/tests/views/run.sh @@ -20,4 +20,5 @@ file_not_exist "$DUMPLING_OUTPUT_DIR/views.v-schema-view.sql" run_dumpling --no-views=false #diff "$DUMPLING_BASE_NAME/data/views-schema-create.sql" "$DUMPLING_OUTPUT_DIR/views-schema-create.sql" diff "$DUMPLING_BASE_NAME/data/views.v-schema.sql" "$DUMPLING_OUTPUT_DIR/views.v-schema.sql" -diff "$DUMPLING_BASE_NAME/data/views.v-schema-view.sql" "$DUMPLING_OUTPUT_DIR/views.v-schema-view.sql" \ No newline at end of file +diff "$DUMPLING_BASE_NAME/data/views.v-schema-view.sql" "$DUMPLING_OUTPUT_DIR/views.v-schema-view.sql" +file_not_exist "$DUMPLING_BASE_NAME/data/views.v.000000000.sql" \ No newline at end of file diff --git a/dumpling/v4/export/dump.go b/dumpling/v4/export/dump.go index c746ea9b..832027f2 100755 --- a/dumpling/v4/export/dump.go +++ b/dumpling/v4/export/dump.go @@ -270,10 +270,10 @@ func (d *Dumper) dumpDatabases(metaConn *sql.Conn, taskChan chan<- Task) error { } else { task := NewTaskTableMeta(dbName, table.Name, meta.ShowCreateTable()) d.sendTaskToChan(task, taskChan) - } - err = d.dumpTableData(metaConn, meta, taskChan) - if err != nil { - return err + err = d.dumpTableData(metaConn, meta, taskChan) + if err != nil { + return err + } } } }