diff --git a/go/cmd/dolt/commands/tblcmds/import.go b/go/cmd/dolt/commands/tblcmds/import.go index d2b20852be..9406956c77 100644 --- a/go/cmd/dolt/commands/tblcmds/import.go +++ b/go/cmd/dolt/commands/tblcmds/import.go @@ -557,8 +557,13 @@ func move(ctx context.Context, rd table.SqlRowReader, wr *mvdata.SqlEngineTableW err := g.Wait() if err != nil && err != io.EOF { + // don't lose the rowErr if there is one + if rowErr != nil { + return badCount, fmt.Errorf("%w\n%s", err, rowErr.Error()) + } return badCount, err } + if rowErr != nil { return badCount, rowErr } diff --git a/integration-tests/bats/1pk5col-ints.bats b/integration-tests/bats/1pk5col-ints.bats index ccf21e1fe5..66d8c0e963 100755 --- a/integration-tests/bats/1pk5col-ints.bats +++ b/integration-tests/bats/1pk5col-ints.bats @@ -514,13 +514,13 @@ pk,c1,c2,c3,c4,c5 1,1,2,3,4,5 2 DELIM + run dolt table import test -u badline.csv [ "$status" -eq 1 ] echo $output [[ "${lines[0]}" =~ "Additions: 2" ]] || false - [[ "${lines[1]}" =~ "A bad row was encountered" ]] || false - [[ "${lines[2]}" =~ "Bad Row: [2]" ]] || false - [[ "${lines[3]}" =~ "CSV reader expected 6 values, but saw 1" ]] || false + [[ "$output" =~ "row values" ]] || false + [[ "$output" =~ "CSV reader expected 6 values, but saw 1" ]] || false } @test "1pk5col-ints: import data from a csv file with a bad header" { diff --git a/integration-tests/bats/default-values.bats b/integration-tests/bats/default-values.bats index 1be7e61d7a..17b8a99c7b 100644 --- a/integration-tests/bats/default-values.bats +++ b/integration-tests/bats/default-values.bats @@ -482,9 +482,11 @@ pk,v1,v2 5,,5 6,,6 DELIM + run dolt table import -u test bad-update.csv [ "$status" -eq "1" ] - [[ "$output" =~ "Bad Row: [5,,5]" ]] || false + [[ "$output" =~ "bad row" ]] || false + [[ "$output" =~ "[5,,5]" ]] || false [[ "$output" =~ "column name 'v1' is non-nullable but attempted to set a value of null" ]] || false }