Skip to content

Commit

Permalink
Merge pull request #823 from jsclayton/fix/mysql-delete-alias
Browse files Browse the repository at this point in the history
fix: Allow MySQL table aliases for DELETE in >= v8.0.16
  • Loading branch information
vmihailenco committed May 4, 2023
2 parents 522ad5a + 096fabe commit 74a0939
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions dialect/mysqldialect/dialect.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,12 @@ func (d *Dialect) Init(db *sql.DB) {
return
}

version = semver.MajorMinor("v" + cleanupVersion(version))
version = "v" + cleanupVersion(version)
if semver.Compare(version, "v8.0") >= 0 {
d.features |= feature.CTE | feature.WithValues | feature.DeleteTableAlias
d.features |= feature.CTE | feature.WithValues
}
if semver.Compare(version, "v8.0.16") >= 0 {
d.features |= feature.DeleteTableAlias
}
}

Expand Down

0 comments on commit 74a0939

Please sign in to comment.