aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2013-07-11 22:07:55 +0200
committerKim Alvefur <zash@zash.se>2013-07-11 22:07:55 +0200
commit06e7d7b489229a80e144ad883a2addde6d92c730 (patch)
treee493acfddc1f79112f770cb9d96ba4837aaf684f
parent7fa95071ed75a7a988efa3108a2cafd63bf919e9 (diff)
downloadprosody-06e7d7b489229a80e144ad883a2addde6d92c730.tar.gz
prosody-06e7d7b489229a80e144ad883a2addde6d92c730.zip
util.sql: Set charset and collation for MySQL when creating tables
-rw-r--r--util/sql.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/util/sql.lua b/util/sql.lua
index f360d6d0..771df7aa 100644
--- a/util/sql.lua
+++ b/util/sql.lua
@@ -264,6 +264,8 @@ function engine:_create_table(table)
sql = sql.. ");"
if self.params.driver == "PostgreSQL" then
sql = sql:gsub("`", "\"");
+ elseif self.params.driver == "MySQL" then
+ sql = sql:gsub(";$", " CHARACTER SET 'utf8' COLLATE 'utf8_bin';");
end
local success,err = self:execute(sql);
if not success then return success,err; end