From 4e21af912258f4b39578a6c869c74a5eb9ea2791 Mon Sep 17 00:00:00 2001 From: zhanglin Date: Sat, 25 Aug 2018 20:34:45 +0800 Subject: [PATCH] fix db default charset error (#1072) * fix db default charset error * add table charset empty check --- dialect_mysql.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dialect_mysql.go b/dialect_mysql.go index f2b4ff7a7..9f5ae3b2e 100644 --- a/dialect_mysql.go +++ b/dialect_mysql.go @@ -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