mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Removes hardcoded ClickHouse database name in delete queries
Addresses #6030
This commit is contained in:
parent
0c919c9d05
commit
cf256c8a18
1 changed files with 1 additions and 1 deletions
|
|
@ -783,7 +783,7 @@ function db_utils.clickhouseDeleteOldPartitions(mysql_retention)
|
|||
-- Query the partitions that need to be deleted. Convert YYYYMMDD strings into integers so that
|
||||
-- only relevant partitions can be queried and deleted
|
||||
-- The last condition > 999999 prevents old partitions created as YYYMM to be deleted
|
||||
local partitions_q = string.format("SELECT DISTINCT database, table, toUInt32(partition) drop_part FROM system.parts WHERE active AND database='ntopng' AND drop_part <= %u AND drop_part > 999999", retention_yyyymmdd)
|
||||
local partitions_q = string.format("SELECT DISTINCT database, table, toUInt32(partition) drop_part FROM system.parts WHERE active AND database='%s' AND drop_part <= %u AND drop_part > 999999", ntop.getPrefs().mysql_dbname or 'ntopng', retention_yyyymmdd)
|
||||
local partitions_res = interface.execSQLQuery(partitions_q)
|
||||
|
||||
-- Iterate queried partitions and delete them
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue