commit 76b863e: [Fix] Clickhouse: Fix retention query quoting

Vsevolod Stakhov vsevolod at highsecure.ru
Sun Sep 8 13:14:03 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-09-08 14:10:35 +0100
URL: https://github.com/rspamd/rspamd/commit/76b863e79e39ec5e1c99cee6e4263abe02f6f8d0 (HEAD -> master)

[Fix] Clickhouse: Fix retention query quoting
Reported by: Javier Angulo

---
 src/plugins/lua/clickhouse.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/plugins/lua/clickhouse.lua b/src/plugins/lua/clickhouse.lua
index 5c8eb5d4d..1505b51aa 100644
--- a/src/plugins/lua/clickhouse.lua
+++ b/src/plugins/lua/clickhouse.lua
@@ -841,7 +841,7 @@ end
 local function do_remove_partition(ev_base, cfg, table_name, partition_id)
   lua_util.debugm(N, rspamd_config, "removing partition %s.%s", table_name, partition_id)
   local upstream = settings.upstream:get_upstream_round_robin()
-  local remove_partition_sql = "ALTER TABLE ${table_name} ${remove_method} PARTITION ${partition_id}"
+  local remove_partition_sql = "ALTER TABLE ${table_name} ${remove_method} PARTITION '${partition_id}'"
   local remove_method = (settings.retention.method == 'drop') and 'DROP' or 'DETACH'
   local sql_params = {
     ['table_name']     = table_name,


More information about the Commits mailing list