util.sql: Create table with same charset as the charset we selected for our connectio...
authorMatthew Wild <mwild1@gmail.com>
Wed, 8 Jul 2015 14:04:23 +0000 (15:04 +0100)
committerMatthew Wild <mwild1@gmail.com>
Wed, 8 Jul 2015 14:04:23 +0000 (15:04 +0100)
util/sql.lua

index dedef435c3534364ec1cb80e746cfc8651965a34..562ac70999868558a136ab16dcf43015dd2ae153 100644 (file)
@@ -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