From ef686a4e7bcd0e723200a232e25a567815cf6bc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=9F=E8=B6=8A?= Date: Fri, 31 Aug 2018 00:40:09 +0800 Subject: [PATCH] Support database with underscore --- go/logic/inspect.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/go/logic/inspect.go b/go/logic/inspect.go index dc69b8123..36169815b 100644 --- a/go/logic/inspect.go +++ b/go/logic/inspect.go @@ -233,6 +233,9 @@ func (this *Inspector) validateGrants() error { if strings.Contains(grant, fmt.Sprintf("GRANT ALL PRIVILEGES ON `%s`.*", this.migrationContext.DatabaseName)) { foundDBAll = true } + if strings.Contains(grant, fmt.Sprintf("GRANT ALL PRIVILEGES ON `%s`.*", strings.Replace(this.migrationContext.DatabaseName, "_", "\\_", -1))) { + foundDBAll = true + } if base.StringContainsAll(grant, `ALTER`, `CREATE`, `DELETE`, `DROP`, `INDEX`, `INSERT`, `LOCK TABLES`, `SELECT`, `TRIGGER`, `UPDATE`, ` ON *.*`) { foundDBAll = true }