commit c68ef64: [Fix] Clickhouse: Fix database usage

Vsevolod Stakhov vsevolod at highsecure.ru
Mon Feb 18 10:00:04 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-02-18 09:55:36 +0000
URL: https://github.com/rspamd/rspamd/commit/c68ef64bb810ff50d82d39dca342ba5294a50274 (HEAD -> master)

[Fix] Clickhouse: Fix database usage
Issue: #2759
Closes: #2759

---
 lualib/lua_clickhouse.lua | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lualib/lua_clickhouse.lua b/lualib/lua_clickhouse.lua
index dbb74e283..96ea59f02 100644
--- a/lualib/lua_clickhouse.lua
+++ b/lualib/lua_clickhouse.lua
@@ -227,7 +227,7 @@ exports.select = function (upstream, settings, params, query, ok_cb, fail_cb)
       connect_prefix = 'https://'
     end
     local ip_addr = upstream:get_addr():to_string(true)
-    local database = params.database or 'default'
+    local database = settings.database or 'default'
     http_params.url = string.format('%s%s/?database=%s&default_format=JSONEachRow',
         connect_prefix, ip_addr, escape_spaces(database))
   end
@@ -278,7 +278,7 @@ exports.select_sync = function (upstream, settings, params, query, ok_cb, fail_c
       connect_prefix = 'https://'
     end
     local ip_addr = upstream:get_addr():to_string(true)
-    local database = params.database or 'default'
+    local database = settings.database or 'default'
     http_params.url = string.format('%s%s/?database=%s&default_format=JSONEachRow',
         connect_prefix, ip_addr, escape_spaces(database))
   end
@@ -342,7 +342,7 @@ exports.insert = function (upstream, settings, params, query, rows,
       connect_prefix = 'https://'
     end
     local ip_addr = upstream:get_addr():to_string(true)
-    local database = params.database or 'default'
+    local database = settings.database or 'default'
     http_params.url = string.format('%s%s/?database=%s&query=%s%%20FORMAT%%20TabSeparated',
         connect_prefix,
         ip_addr,
@@ -394,7 +394,7 @@ exports.generic = function (upstream, settings, params, query,
       connect_prefix = 'https://'
     end
     local ip_addr = upstream:get_addr():to_string(true)
-    local database = params.database or 'default'
+    local database = settings.database or 'default'
     http_params.url = string.format('%s%s/?database=%s&default_format=JSONEachRow',
         connect_prefix, ip_addr, escape_spaces(database))
   end
@@ -439,7 +439,7 @@ exports.generic_sync = function (upstream, settings, params, query)
       connect_prefix = 'https://'
     end
     local ip_addr = upstream:get_addr():to_string(true)
-    local database = params.database or 'default'
+    local database = settings.database or 'default'
     http_params.url = string.format('%s%s/?database=%s&default_format=JSONEachRow',
         connect_prefix, ip_addr, escape_spaces(database))
   end


More information about the Commits mailing list