aboutsummaryrefslogtreecommitdiffstats
path: root/util/sql.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-04-12 17:26:44 +0200
committerKim Alvefur <zash@zash.se>2017-04-12 17:26:44 +0200
commit3604a84b9eca4e5790310552a6c78692a892ec1f (patch)
treeb5eb282a16f904d347e6e10fb3ffc3cc9389f2d4 /util/sql.lua
parent2d381d6b3842299131484688dce5e6b1b1abbbeb (diff)
downloadprosody-3604a84b9eca4e5790310552a6c78692a892ec1f.tar.gz
prosody-3604a84b9eca4e5790310552a6c78692a892ec1f.zip
util.sql: Apply quote transform in engine:execute so it is applied to eg encoding checks in mod_storage_sql (thanks Martin)
Diffstat (limited to 'util/sql.lua')
-rw-r--r--util/sql.lua3
1 files changed, 1 insertions, 2 deletions
diff --git a/util/sql.lua b/util/sql.lua
index a859ddc9..c7a79278 100644
--- a/util/sql.lua
+++ b/util/sql.lua
@@ -139,6 +139,7 @@ function engine:execute(sql, ...)
if not success then return success, err; end
local prepared = self.prepared;
+ sql = self:prepquery(sql);
local stmt = prepared[sql];
if not stmt then
local err;
@@ -254,7 +255,6 @@ function engine:_create_index(index)
if index.unique then
sql = sql:gsub("^CREATE", "CREATE UNIQUE");
end
- sql = self:prepquery(sql);
if self._debug then
debugquery("create", sql);
end
@@ -286,7 +286,6 @@ function engine:_create_table(table)
if self.params.driver == "MySQL" then
sql = sql:gsub(";$", (" CHARACTER SET '%s' COLLATE '%s_bin';"):format(self.charset, self.charset));
end
- sql = self:prepquery(sql);
if self._debug then
debugquery("create", sql);
end