# HG changeset patch # User Kim Alvefur # Date 1492023558 -7200 # Node ID 60207251863c1db63ad31f96c8c6ce539d76023c # Parent 4b403f88117671ceffcc793817cf306e721bd9e6# Parent 29b3957db21230f7844ac458e173afbd61189b03 Merge 0.10->trunk diff -r 4b403f881176 -r 60207251863c plugins/mod_storage_sql.lua --- a/plugins/mod_storage_sql.lua Mon Apr 10 23:16:13 2017 +0200 +++ b/plugins/mod_storage_sql.lua Wed Apr 12 20:59:18 2017 +0200 @@ -489,7 +489,7 @@ check_encoding_query = check_encoding_query:format(engine.charset, engine.charset); -- FIXME Is it ok to ignore the return values from this? engine:transaction(function() - local result = engine:execute(check_encoding_query); + local result = assert(engine:execute(check_encoding_query)); local n_bad_columns = result:rowcount(); if n_bad_columns > 0 then changes = true; diff -r 4b403f881176 -r 60207251863c util/sql.lua --- a/util/sql.lua Mon Apr 10 23:16:13 2017 +0200 +++ b/util/sql.lua Wed Apr 12 20:59:18 2017 +0200 @@ -139,6 +139,7 @@ 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; @@ -159,6 +160,7 @@ local function debugquery(where, sql, ...) local i = 0; local a = {...} + sql = sql:gsub("\n?\t+", " "); log("debug", "[%s] %s", where, sql:gsub("%?", function () i = i + 1; local v = a[i]; if type(v) == "string" then v = ("%q"):format(v); end return tostring(v); end)); end @@ -254,7 +256,6 @@ 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 +287,6 @@ 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