Skip to content

Commit

Permalink
refactoring for protobuf
Browse files Browse the repository at this point in the history
  • Loading branch information
ffffwh committed Jun 4, 2019
1 parent 093f696 commit ca82fb1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions internal/client/driver/mysql/dumper.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
package mysql

import (
"bytes"
"fmt"
"os"
"strings"
Expand Down Expand Up @@ -90,8 +89,7 @@ type DumpEntry struct {
ValuesX [][]*interface{}
TotalCount int64
RowsCount int64
colBuffer bytes.Buffer
err error
Err error
Table *config.Table
}

Expand Down Expand Up @@ -195,7 +193,7 @@ func (d *dumper) getChunkData() (nRows int64, err error) {
// TODO use PS
// TODO escape schema/table/column name once and save
defer func() {
entry.err = err
entry.Err = err
if err == nil && entry.RowsCount == 0 {
return
}
Expand Down
4 changes: 2 additions & 2 deletions internal/client/driver/mysql/extractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1290,8 +1290,8 @@ func (e *Extractor) mysqlDump() error {
e.dumpers = append(e.dumpers, d)
// Scan the rows in the table ...
for entry := range d.resultsChannel {
if entry.err != nil {
e.onError(TaskStateDead, entry.err)
if entry.Err != nil {
e.onError(TaskStateDead, entry.Err)
} else {
if e.needToSendTabelDef() {
entry.Table = d.table
Expand Down

0 comments on commit ca82fb1

Please sign in to comment.