@@ -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