Changeset

8380:a597ff326758

util.sql: Discard useless substitution count from string.gsub in SQL debug logs
author Kim Alvefur <zash@zash.se>
date Wed, 08 Nov 2017 10:45:58 +0100
parents 8379:2a0915aa6131
children 8381:7f6184474149
files util/sql.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/util/sql.lua	Tue Nov 07 09:29:04 2017 +0100
+++ b/util/sql.lua	Wed Nov 08 10:45:58 2017 +0100
@@ -161,14 +161,14 @@
 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, ...)