Skip to content

Commit

Permalink
fix db default charset error (go-xorm#1072)
Browse files Browse the repository at this point in the history
* fix db default charset error

* add table charset empty check
  • Loading branch information
zhanglin authored and lunny committed Aug 25, 2018
1 parent 5b080b7 commit 4e21af9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dialect_mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,9 +551,12 @@ func (db *mysql) CreateTableSql(table *core.Table, tableName, storeEngine, chars

if len(charset) == 0 {
charset = db.URI().Charset
} else if len(charset) > 0 {
}
if len(charset) != 0 {
sql += " DEFAULT CHARSET " + charset
}



if db.rowFormat != "" {
sql += " ROW_FORMAT=" + db.rowFormat
Expand Down

0 comments on commit 4e21af9

Please sign in to comment.