From bd1b01460ca28af273574911501f4f880593ca82 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 8 Nov 2017 10:45:58 +0100 Subject: util.sql: Discard useless substitution count from string.gsub in SQL debug logs --- util/sql.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/sql.lua b/util/sql.lua index d964025e..13f25f7b 100644 --- a/util/sql.lua +++ b/util/sql.lua @@ -161,14 +161,14 @@ local result_mt = { __index = { local function debugquery(where, sql, ...) local i = 0; local a = {...} sql = sql:gsub("\n?\t+", " "); - log("debug", "[%s] %s", where, sql:gsub("%?", function () + log("debug", "[%s] %s", where, (sql:gsub("%?", function () i = i + 1; local v = a[i]; if type(v) == "string" then v = ("'%s'"):format(v:gsub("'", "''")); end return tostring(v); - end)); + end))); end function engine:execute_query(sql, ...) -- cgit v1.2.3