# HG changeset patch # User Matthew Wild # Date 1436364263 -3600 # Node ID fb952032f83ed371724bd3def6eac632d59d692b # Parent 88b89facc3c9ce6db268ac9c3a01dc29c9bfd53d util.sql: Create table with same charset as the charset we selected for our connection, also use corresponding _bin collation diff -r 88b89facc3c9 -r fb952032f83e util/sql.lua --- a/util/sql.lua Tue Jul 07 17:43:14 2015 +0100 +++ b/util/sql.lua Wed Jul 08 15:04:23 2015 +0100 @@ -245,7 +245,7 @@ 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