util.sql: Apply quote transform in engine:execute so it is applied to eg encoding checks in mod_storage_sql (thanks Martin)

This commit is contained in:
Kim Alvefur 2017-04-12 17:26:44 +02:00
parent c49d0d5b77
commit f2c30c688f

View file

@ -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