From bfe866f2e1c37af23dd27335570a7143b902bf30 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Mon, 22 Jun 2026 11:08:24 +0200 Subject: [PATCH] test(uniqueness): assert pool_stat is unique per (pool_hash_id, epoch_no) pool_stat should hold at most one row per pool per epoch. Add a check_unique assertion in the POOLS section of test-uniqueness.sql so duplicate (pool_hash_id, epoch_no) rows are caught. Covers #1986, #1901, #1987. --- scripts/test-uniqueness.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/test-uniqueness.sql b/scripts/test-uniqueness.sql index 8091037a6..9743b70f4 100644 --- a/scripts/test-uniqueness.sql +++ b/scripts/test-uniqueness.sql @@ -78,6 +78,7 @@ BEGIN _total := _total + 1; _passed := _passed + check_unique('pool_retire', 'announced_tx_id', 'cert_index'); _total := _total + 1; _passed := _passed + check_unique('pool_relay', 'update_id', 'ipv4', 'ipv6', 'dns_name'); _total := _total + 1; _passed := _passed + check_unique('pool_owner', 'addr_id', 'pool_update_id'); + _total := _total + 1; _passed := _passed + check_unique('pool_stat', 'pool_hash_id', 'epoch_no'); -- ===================================================== -- EPOCH / PROTOCOL PARAMS (dropped in migration-2-0021)