Skip to content

Commit 1e4bbcb

Browse files
committed
reuse GetGhostTriggerName
1 parent 0f97a08 commit 1e4bbcb

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
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
}

0 commit comments

Comments
 (0)