Skip to content

Commit ef686a4

Browse files
author
钟越
committed
Support database with underscore
1 parent d2726c7 commit ef686a4

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

go/logic/inspect.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,9 @@ func (this *Inspector) validateGrants() error {
233233
if strings.Contains(grant, fmt.Sprintf("GRANT ALL PRIVILEGES ON `%s`.*", this.migrationContext.DatabaseName)) {
234234
foundDBAll = true
235235
}
236+
if strings.Contains(grant, fmt.Sprintf("GRANT ALL PRIVILEGES ON `%s`.*", strings.Replace(this.migrationContext.DatabaseName, "_", "\\_", -1))) {
237+
foundDBAll = true
238+
}
236239
if base.StringContainsAll(grant, `ALTER`, `CREATE`, `DELETE`, `DROP`, `INDEX`, `INSERT`, `LOCK TABLES`, `SELECT`, `TRIGGER`, `UPDATE`, ` ON *.*`) {
237240
foundDBAll = true
238241
}

0 commit comments

Comments
 (0)