Permalink
Browse files

MySQL: SqlDayTimeZoned uses Text (#78)

  • Loading branch information...
1 parent 757049b commit d0eb56db5908cc748363f37d87d70313460cc128 @snoyberg snoyberg committed Jul 25, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 persistent-mysql/Database/Persist/MySQL.hs
@@ -590,7 +590,7 @@ showSqlType SqlBlob (Just i) = "VARBINARY(" ++ show i ++ ")"
showSqlType SqlBool _ = "TINYINT(1)"
showSqlType SqlDay _ = "DATE"
showSqlType SqlDayTime _ = "DATETIME"
-showSqlType SqlDayTimeZoned _ = "DATETIME"
+showSqlType SqlDayTimeZoned _ = "TEXT CHARACTER SET utf8"
@meteficha

meteficha Jul 25, 2012

Owner

It would be better to use VARCHAR(???) CHARACTER SET utf8 where ??? is large enough to accomodate any ZonedTime (since TEXT has quite an overhead on MySQL, "Each BLOB or TEXT value is represented internally by a separately allocated object."). On my single test it took 30 characters, how about putting VARCHAR(50) CHARACTER SET utf8 here?

showSqlType SqlInt32 _ = "INT"
showSqlType SqlInt64 _ = "BIGINT"
showSqlType SqlReal _ = "DOUBLE PRECISION"

0 comments on commit d0eb56d

Please sign in to comment.