From 21dcd99059c36ef94374519e0c083450a7d8250a Mon Sep 17 00:00:00 2001 From: xormplus Date: Sun, 26 Aug 2018 14:57:08 +0800 Subject: [PATCH] fix db default charset error * 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 f3d73f7..cb77501 100644 --- a/dialect_mysql.go +++ b/dialect_mysql.go @@ -568,9 +568,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