aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_clickhouse.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-02-18 09:55:36 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-02-18 09:55:36 +0000
commitc68ef64bb810ff50d82d39dca342ba5294a50274 (patch)
tree75b1755963d800ba43637194f9f4fcad01cae393 /lualib/lua_clickhouse.lua
parentba63e160b52fa55478968c97053b9651f7d571c8 (diff)
downloadrspamd-c68ef64bb810ff50d82d39dca342ba5294a50274.tar.gz
rspamd-c68ef64bb810ff50d82d39dca342ba5294a50274.zip
[Fix] Clickhouse: Fix database usage
Issue: #2759 Closes: #2759
Diffstat (limited to 'lualib/lua_clickhouse.lua')
-rw-r--r--lualib/lua_clickhouse.lua10
1 files 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