Changeset

5739:2e9ad9cb206f

util.sql: Set charset and collation for MySQL when creating tables
author Kim Alvefur <zash@zash.se>
date Thu, 11 Jul 2013 22:07:55 +0200
parents 5738:2fb4f2ea27f4
children 5740:6fce00f61acf
files util/sql.lua
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/util/sql.lua	Thu Jul 11 15:13:45 2013 +0100
+++ b/util/sql.lua	Thu Jul 11 22:07:55 2013 +0200
@@ -264,6 +264,8 @@
 	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