aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2015-07-08 15:04:23 +0100
committerMatthew Wild <mwild1@gmail.com>2015-07-08 15:04:23 +0100
commit7d98c3be73c23f8da72b500ebd7f6933a52591cb (patch)
tree0142927dcfe0d8a064b5e44fab0b707997e50d3a /util
parentb0b754aa3350f1425a5eed7b6bb38764346b506a (diff)
downloadprosody-7d98c3be73c23f8da72b500ebd7f6933a52591cb.tar.gz
prosody-7d98c3be73c23f8da72b500ebd7f6933a52591cb.zip
util.sql: Create table with same charset as the charset we selected for our connection, also use corresponding _bin collation
Diffstat (limited to 'util')
-rw-r--r--util/sql.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/sql.lua b/util/sql.lua
index dedef435..562ac709 100644
--- a/util/sql.lua
+++ b/util/sql.lua
@@ -245,7 +245,7 @@ function engine:_create_table(table)
if self.params.driver == "PostgreSQL" then
sql = sql:gsub("`", "\"");
elseif self.params.driver == "MySQL" then
- sql = sql:gsub(";$", " CHARACTER SET 'utf8' COLLATE 'utf8_bin';");
+ sql = sql:gsub(";$", (" CHARACTER SET '%s' COLLATE '%s_bin';"):format(self.charset, self.charset));
end
local success,err = self:execute(sql);
if not success then return success,err; end