Skip to content

Commit 301564b

Browse files
committed
linter fix
1 parent 9400a26 commit 301564b

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

go/logic/migrator.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,10 +1544,10 @@ func (this *Migrator) Checkpoint(ctx context.Context) (*Checkpoint, error) {
15441544
}
15451545
}
15461546

1547-
// CheckpointCutOver writes a final checkpoint after the cutover completes successfully.
1547+
// CheckpointAfterCutOver writes a final checkpoint after the cutover completes successfully.
15481548
func (this *Migrator) CheckpointAfterCutOver() (*Checkpoint, error) {
15491549
if this.lastLockProcessed == nil || this.lastLockProcessed.coords.IsEmpty() {
1550-
return nil, this.migrationContext.Log.Errorf("lastLockProcessed coords are empty: %+v")
1550+
return nil, this.migrationContext.Log.Errorf("lastLockProcessed coords are empty")
15511551
}
15521552

15531553
chk := &Checkpoint{
@@ -1564,7 +1564,7 @@ func (this *Migrator) CheckpointAfterCutOver() (*Checkpoint, error) {
15641564
chk.IterationRangeMin = this.applier.LastIterationRangeMinValues.Clone()
15651565
}
15661566
if this.applier.LastIterationRangeMaxValues != nil {
1567-
chk.IterationRangeMin = this.applier.LastIterationRangeMaxValues.Clone()
1567+
chk.IterationRangeMax = this.applier.LastIterationRangeMaxValues.Clone()
15681568
}
15691569
this.applier.LastIterationRangeMutex.Unlock()
15701570

go/logic/migrator_test.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -713,9 +713,9 @@ func (suite *MigratorTestSuite) TestRevert() {
713713
suite.Require().NoError(err)
714714
numRows += 1
715715
}
716-
for i := 0; i < numRows; i += 5 {
716+
for i := 0; i < numRows; i += 7 {
717717
_, err = suite.db.ExecContext(ctx,
718-
fmt.Sprintf("UPDATE %s SET s=MD5('%d') where id=%d", getTestTableName(), i, 2*i))
718+
fmt.Sprintf("UPDATE %s SET s=MD5('%d') where id=%d", getTestTableName(), 2*i, i))
719719
suite.Require().NoError(err)
720720
}
721721

@@ -725,7 +725,7 @@ func (suite *MigratorTestSuite) TestRevert() {
725725
migrationContext.ApplierConnectionConfig = connectionConfig
726726
migrationContext.InspectorConnectionConfig = connectionConfig
727727
migrationContext.SetConnectionConfig("innodb")
728-
migrationContext.AlterStatement = "DROP INDEX idx1 (name)"
728+
migrationContext.AlterStatement = "DROP INDEX idx1"
729729
migrationContext.DropServeSocket = true
730730
migrationContext.UseGTIDs = true
731731
migrationContext.Revert = true
@@ -742,10 +742,12 @@ func (suite *MigratorTestSuite) TestRevert() {
742742
var _tableName, checksum1, checksum2 string
743743
rows, err := suite.db.Query(fmt.Sprintf("CHECKSUM TABLE %s, %s", testMysqlTableName, oldTableName))
744744
suite.Require().NoError(err)
745-
rows.Next()
746-
rows.Scan(&_tableName, &checksum1)
747-
rows.Next()
748-
rows.Scan(&_tableName, &checksum2)
745+
suite.Require().True(rows.Next())
746+
suite.Require().NoError(rows.Scan(&_tableName, &checksum1))
747+
suite.Require().True(rows.Next())
748+
suite.Require().NoError(rows.Scan(&_tableName, &checksum2))
749+
suite.Require().NoError(rows.Err())
750+
749751
suite.Require().Equal(checksum1, checksum2)
750752
}
751753

0 commit comments

Comments
 (0)