add table charset empty check

This commit is contained in:
zhanglin 2018-08-25 13:28:10 +08:00 committed by GitHub
parent 2ac6c662e3
commit d87e921b17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -551,8 +551,11 @@ func (db *mysql) CreateTableSql(table *core.Table, tableName, storeEngine, chars
if len(charset) == 0 {
charset = db.URI().Charset
}
if len(charset) != 0 {
sql += " DEFAULT CHARSET " + charset
}
sql += " DEFAULT CHARSET " + charset
if db.rowFormat != "" {