diff options
author | Kim Alvefur <zash@zash.se> | 2017-11-08 10:45:58 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2017-11-08 10:45:58 +0100 |
commit | bd1b01460ca28af273574911501f4f880593ca82 (patch) | |
tree | d95f5b6777b2a69c750f9af45584818827863d2a /util/sql.lua | |
parent | b65f1ed9c128529d27ebe05912cfd9a95ad25fc8 (diff) | |
download | prosody-bd1b01460ca28af273574911501f4f880593ca82.tar.gz prosody-bd1b01460ca28af273574911501f4f880593ca82.zip |
util.sql: Discard useless substitution count from string.gsub in SQL debug logs
Diffstat (limited to 'util/sql.lua')
-rw-r--r-- | util/sql.lua | 4 |
1 files 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, ...) |