Skip to content
Snippets Groups Projects
Commit 253e6dae authored by Michal Zander's avatar Michal Zander
Browse files

Fix issue when pow operation was in the same batch of blocks with account update operation

parent d729daa2
No related branches found
No related tags found
6 merge requests!627merge in fix for get_current_block_age,!626Fix get_current_block_age function to avoid healthcheck fails,!622merge develop to master,!599merge ( with merge commit) develop to master,!597Merge develop to master for release,!569Add missing parameters to keyauth test
...@@ -482,19 +482,13 @@ BEGIN ...@@ -482,19 +482,13 @@ BEGIN
WHERE LEAST(pow_min_block_num, min_block_num, min_block_num_from_stored_table) = block_num OR key_kind = 'ACTIVE' WHERE LEAST(pow_min_block_num, min_block_num, min_block_num_from_stored_table) = block_num OR key_kind = 'ACTIVE'
), ),
--Collect all paths (pow, genesis, hf9, rest) --Collect all paths (pow, genesis, hf9, rest)
extended_auth_records as materialized extended_auth_records_without_pow as materialized
( (
SELECT (select a.id FROM %2$s.accounts_view a SELECT (select a.id FROM %2$s.accounts_view a
where a.name = r.account_name) as account_id, where a.name = r.account_name) as account_id,
r.* r.*
FROM raw_auth_records r FROM raw_auth_records r
UNION ALL
SELECT
*
FROM
pow_extended_auth_records_filtered
UNION ALL UNION ALL
SELECT SELECT
account_id, account_id,
...@@ -548,6 +542,23 @@ BEGIN ...@@ -548,6 +542,23 @@ BEGIN
FROM FROM
genesis_auth_records genesis_auth_records
), ),
extended_auth_records AS MATERIALIZED
(
SELECT
*
FROM extended_auth_records_without_pow
UNION ALL
SELECT
*
FROM
pow_extended_auth_records_filtered
WHERE NOT EXISTS (
SELECT 1
FROM extended_auth_records_without_pow e
WHERE e.account_id = pow_extended_auth_records_filtered.account_id
AND e.key_kind = pow_extended_auth_records_filtered.key_kind
)
),
effective_key_or_account_auth_records as materialized effective_key_or_account_auth_records as materialized
( (
WITH effective_tuple_ids as materialized WITH effective_tuple_ids as materialized
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment