Closed roadscape closed 6 years ago
These should always return 0:
SELECT count(*)
FROM hive_posts hp
JOIN hive_posts_cache hpc ON post_id = id
WHERE hp.author != hpc.author
SELECT count(*)
FROM hive_posts hp
JOIN hive_posts_cache hpc ON post_id = id
WHERE hp.permlink != hpc.permlink
Changes:
Most likely the cause was a bug during rewrites/testing late last week. The extra assertions haven't been tripped so whatever the issue was seems to have been a temporary one. Leaving them in place for the time being.
Somehow hive_posts_cache ended up with a large number of rows where id's did not match proper records. hive_posts has strict constraints so fortunately this is easy to detect; however it should never ever happen.