aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorMikhail Galanin <mgalanin@mimecast.com>2018-08-02 15:12:48 +0100
committerMikhail Galanin <mgalanin@mimecast.com>2018-08-02 15:12:48 +0100
commit2888cc8a35d24884863010e2e03981a94934b2c4 (patch)
treeb69653e588898da6cac79aff91cb45c37888b64d /src/plugins
parent5af7a56bb6853c0a7da949d7126940c03966804e (diff)
downloadrspamd-2888cc8a35d24884863010e2e03981a94934b2c4.tar.gz
rspamd-2888cc8a35d24884863010e2e03981a94934b2c4.zip
[Fix] partition_id is not available in old versions of CH
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/lua/clickhouse.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/lua/clickhouse.lua b/src/plugins/lua/clickhouse.lua
index 7b7312136..50095d040 100644
--- a/src/plugins/lua/clickhouse.lua
+++ b/src/plugins/lua/clickhouse.lua
@@ -832,7 +832,7 @@ local function parse_clickhouse_response(ev_base, cfg, data)
for _, plain_row in pairs(ch_rows) do
if plain_row and plain_row:len() > 1 then
local parsed_row = parse_string(plain_row)
- do_remove_partition(rspamd_config, cfg, parsed_row.table, parsed_row.partition_id)
+ do_remove_partition(rspamd_config, cfg, parsed_row.table, parsed_row.partition)
end
end
end
@@ -890,7 +890,7 @@ local function clickhouse_remove_old_partitions(cfg, ev_base)
local upstream = settings.upstream:get_upstream_round_robin()
local ip_addr = upstream:get_addr():to_string(true)
- local partition_to_remove_sql = "SELECT distinct partition_id, table FROM system.parts WHERE table in ('${tables}') and max_date < toDate(now() - interval ${month} month);"
+ local partition_to_remove_sql = "SELECT distinct partition, table FROM system.parts WHERE table in ('${tables}') and max_date <= toDate(now() - interval ${month} month);"
local table_names = {}
for table_name,_ in pairs(clickhouse_schema) do