Skip to content
Snippets Groups Projects
Commit c2ab3691 authored by Cam Saül's avatar Cam Saül
Browse files

Merge pull request #1998 from metabase/force-mysql-utf-8

Force MySQL to use UTF-8 Encoding :database:
parents 048e50eb 336a4d41
No related branches found
No related tags found
No related merge requests found
......@@ -65,7 +65,8 @@
kdb/mysql
;; 0000-00-00 dates are valid in MySQL, but JDBC barfs when queries return them because java.sql.Date doesn't allow it.
;; Add a param to the end of the connection string that tells MySQL to convert 0000-00-00 dates to NULL when returning them.
(update :subname (u/rpartial str "?zeroDateTimeBehavior=convertToNull"))))
;; Also add params to force UTF-8 encoding of results
(update :subname (u/rpartial str "?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=UTF8&characterSetResults=UTF8"))))
(defn- unix-timestamp->timestamp [_ expr seconds-or-milliseconds]
(k/sqlfn :FROM_UNIXTIME (case seconds-or-milliseconds
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment