]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Clickhouse: Fix escaping
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 17 Jun 2019 16:45:00 +0000 (17:45 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 17 Jun 2019 16:45:00 +0000 (17:45 +0100)
lualib/lua_clickhouse.lua

index 1aca0f7199aad44be312fb7cb407bc4bfbddf673..ad5b51dce06774c28ae2b147723b7773377bee25 100644 (file)
@@ -45,10 +45,10 @@ end
 local function clickhouse_quote(str)
   if str then
     return str:gsub('[\'\\\n\t]', {
-      ['\''] = '\\\'',
-      ['\\'] = '\\',
-      ['\n'] = '\\n',
-      ['\t'] = '\\t'
+      ['\''] = [[\']],
+      ['\\'] = [[\\]],
+      ['\n'] = [[\n]],
+      ['\t'] = [[\t]],
     }):lower()
   end