mirror of
https://github.com/dolthub/dolt.git
synced 2026-01-08 00:39:48 -06:00
Fixed dropped error for some engine errors
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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" {
|
||||
|
||||
@@ -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,<nil>,5]" ]] || false
|
||||
[[ "$output" =~ "bad row" ]] || false
|
||||
[[ "$output" =~ "[5,<nil>,5]" ]] || false
|
||||
[[ "$output" =~ "column name 'v1' is non-nullable but attempted to set a value of null" ]] || false
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user