提交 a75d1c65 编写于 作者: martianzhang's avatar martianzhang

fix #176

  JSON datatype only support utf8mb4 now
上级 d9f6ef72
......@@ -137,6 +137,9 @@ func (db *Connector) startSampling(onlineConn *sql.DB, database, table string, w
values = append(values, "NULL")
} else {
switch columnTypes[i].DatabaseTypeName() {
case "JSON":
// https://github.com/XiaoMi/soar/issues/178
values = append(values, fmt.Sprintf(`convert(X'%s' using utf8mb4)`, fmt.Sprintf("%x", val)))
case "TIMESTAMP", "DATETIME":
t, err := time.Parse(time.RFC3339, string(val))
if err != nil {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册