File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -362,12 +362,16 @@ func (this *Migrator) Migrate() (err error) {
362
362
// In MySQL 8.0 (and possibly earlier) some DDL statements can be applied instantly.
363
363
// Attempt to do this if AttemptInstantDDL is set.
364
364
if this .migrationContext .AttemptInstantDDL {
365
- this .migrationContext .Log .Infof ("Attempting to execute alter with ALGORITHM=INSTANT" )
366
- if err := this .applier .AttemptInstantDDL (); err == nil {
367
- this .migrationContext .Log .Infof ("Success! table %s.%s migrated instantly" , sql .EscapeName (this .migrationContext .DatabaseName ), sql .EscapeName (this .migrationContext .OriginalTableName ))
368
- return nil
365
+ if this .migrationContext .Noop {
366
+ this .migrationContext .Log .Debugf ("Noop operation; not really attempting instant DDL" )
369
367
} else {
370
- this .migrationContext .Log .Infof ("ALGORITHM=INSTANT not supported for this operation, proceeding with original algorithm: %s" , err )
368
+ this .migrationContext .Log .Infof ("Attempting to execute alter with ALGORITHM=INSTANT" )
369
+ if err := this .applier .AttemptInstantDDL (); err == nil {
370
+ this .migrationContext .Log .Infof ("Success! table %s.%s migrated instantly" , sql .EscapeName (this .migrationContext .DatabaseName ), sql .EscapeName (this .migrationContext .OriginalTableName ))
371
+ return nil
372
+ } else {
373
+ this .migrationContext .Log .Infof ("ALGORITHM=INSTANT not supported for this operation, proceeding with original algorithm: %s" , err )
374
+ }
371
375
}
372
376
}
373
377
You can’t perform that action at this time.
0 commit comments