Skip to content

Commit d30bc0d

Browse files
authored
Merge pull request #2 from xtrimf/support_for_triggers
Support for triggers
2 parents e049a6c + 1e4bbcb commit d30bc0d

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

go/base/context.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -872,12 +872,7 @@ func (this *MigrationContext) GetGhostTriggerName(triggerName string) string {
872872

873873
// validateGhostTriggerLength check if the ghost trigger name length is not more than 64 characters
874874
func (this *MigrationContext) ValidateGhostTriggerLengthBelowMaxLength(triggerName string) bool {
875-
var ghostTriggerName string
876-
if this.RemoveTriggerSuffix {
877-
ghostTriggerName = strings.TrimSuffix(triggerName, this.TriggerSuffix)
878-
} else {
879-
ghostTriggerName = triggerName + this.TriggerSuffix
880-
}
875+
ghostTriggerName := this.GetGhostTriggerName(triggerName)
881876

882877
return utf8.RuneCountInString(ghostTriggerName) <= mysql.MaxTableNameLength
883878
}

go/logic/inspect.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ func (this *Inspector) validateGhostTriggersLength() error {
566566

567567
}
568568
if len(foundTriggers) > 0 {
569-
return this.migrationContext.Log.Errorf("Gh-ost triggers (%s) length > %d characters. Bailing out", strings.Join(foundTriggers, ","),mysql.MaxTableNameLength)
569+
return this.migrationContext.Log.Errorf("Gh-ost triggers (%s) length > %d characters. Bailing out", strings.Join(foundTriggers, ","), mysql.MaxTableNameLength)
570570
}
571571
}
572572

0 commit comments

Comments
 (0)