From 72140f4dd6bc76ea3970582e513bea1a9dde07a1 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 12 Nov 2013 11:13:45 +0100 Subject: util.sql: Get character set info from the correct database. --- util/sql.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util/sql.lua') diff --git a/util/sql.lua b/util/sql.lua index a7f46421..5e441c10 100644 --- a/util/sql.lua +++ b/util/sql.lua @@ -308,7 +308,7 @@ function engine:set_encoding() -- to UTF-8 if driver == "MySQL" then set_names_query = set_names_query:gsub(";$", " COLLATE 'utf8_bin';"); local ok, charsets = self:transaction(function() - return self:select"SELECT `CHARACTER_SET_NAME` FROM `CHARACTER_SETS` WHERE `CHARACTER_SET_NAME` LIKE 'utf8%' ORDER BY MAXLEN DESC LIMIT 1;"; + return self:select"SELECT `CHARACTER_SET_NAME` FROM `CHARACTER_SETS` WHERE `information_schema`.`CHARACTER_SET_NAME` LIKE 'utf8%' ORDER BY MAXLEN DESC LIMIT 1;"; end); local row = ok and charsets(); charset = row and row[1] or charset; -- cgit v1.2.3 From f454faa15bdbccc23b805dcb110e985cb0ff0295 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 12 Nov 2013 11:38:52 +0100 Subject: util.sql: Fix previous commit --- util/sql.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util/sql.lua') diff --git a/util/sql.lua b/util/sql.lua index 5e441c10..5a1dda5d 100644 --- a/util/sql.lua +++ b/util/sql.lua @@ -308,7 +308,7 @@ function engine:set_encoding() -- to UTF-8 if driver == "MySQL" then set_names_query = set_names_query:gsub(";$", " COLLATE 'utf8_bin';"); local ok, charsets = self:transaction(function() - return self:select"SELECT `CHARACTER_SET_NAME` FROM `CHARACTER_SETS` WHERE `information_schema`.`CHARACTER_SET_NAME` LIKE 'utf8%' ORDER BY MAXLEN DESC LIMIT 1;"; + return self:select"SELECT `CHARACTER_SET_NAME` FROM `information_schema`.`CHARACTER_SETS` WHERE `CHARACTER_SET_NAME` LIKE 'utf8%' ORDER BY MAXLEN DESC LIMIT 1;"; end); local row = ok and charsets(); charset = row and row[1] or charset; -- cgit v1.2.3