Skip to content

Commit c940a85

Browse files
Merge pull request #835 from ajm188/handle_driver_timeout_error
Add a check to rows.Err after processing all rows
2 parents ebb1de5 + 8b3a8be commit c940a85

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

go/logic/applier.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,8 @@ func (this *Applier) ReadMigrationMinValues(uniqueKey *sql.UniqueKey) error {
370370
}
371371
}
372372
this.migrationContext.Log.Infof("Migration min values: [%s]", this.migrationContext.MigrationRangeMinValues)
373+
374+
err = rows.Err()
373375
return err
374376
}
375377

@@ -391,6 +393,8 @@ func (this *Applier) ReadMigrationMaxValues(uniqueKey *sql.UniqueKey) error {
391393
}
392394
}
393395
this.migrationContext.Log.Infof("Migration max values: [%s]", this.migrationContext.MigrationRangeMaxValues)
396+
397+
err = rows.Err()
394398
return err
395399
}
396400

@@ -443,6 +447,9 @@ func (this *Applier) CalculateNextIterationRangeEndValues() (hasFurtherRange boo
443447
}
444448
hasFurtherRange = true
445449
}
450+
if err = rows.Err(); err != nil {
451+
return hasFurtherRange, err
452+
}
446453
if hasFurtherRange {
447454
this.migrationContext.MigrationIterationRangeMaxValues = iterationRangeMaxValues
448455
return hasFurtherRange, nil

0 commit comments

Comments
 (0)