projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ee31718
)
util.sql: Create table with same charset as the charset we selected for our connectio...
author
Matthew Wild
<mwild1@gmail.com>
Wed, 8 Jul 2015 14:04:23 +0000
(15:04 +0100)
committer
Matthew Wild
<mwild1@gmail.com>
Wed, 8 Jul 2015 14:04:23 +0000
(15:04 +0100)
util/sql.lua
patch
|
blob
|
history
diff --git
a/util/sql.lua
b/util/sql.lua
index dedef435c3534364ec1cb80e746cfc8651965a34..562ac70999868558a136ab16dcf43015dd2ae153 100644
(file)
--- 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