Diff

util/sql.lua @ 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
parent 8378:6a098961bc00
child 8382:e5d00bf4a4d5
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, ...)