diff options
Diffstat (limited to 'src/backend/utils/cache')
-rw-r--r-- | src/backend/utils/cache/catcache.c | 51 | ||||
-rw-r--r-- | src/backend/utils/cache/relfilenodemap.c | 1 |
2 files changed, 24 insertions, 28 deletions
diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c index 954b435bffa..4dd6753c82f 100644 --- a/src/backend/utils/cache/catcache.c +++ b/src/backend/utils/cache/catcache.c @@ -553,41 +553,38 @@ void AtEOXact_CatCache(bool isCommit) { #ifdef USE_ASSERT_CHECKING - if (assert_enabled) + slist_iter cache_iter; + + slist_foreach(cache_iter, &CacheHdr->ch_caches) { - slist_iter cache_iter; + CatCache *ccp = slist_container(CatCache, cc_next, cache_iter.cur); + dlist_iter iter; + int i; - slist_foreach(cache_iter, &CacheHdr->ch_caches) + /* Check CatCLists */ + dlist_foreach(iter, &ccp->cc_lists) { - CatCache *ccp = slist_container(CatCache, cc_next, cache_iter.cur); - dlist_iter iter; - int i; + CatCList *cl; - /* Check CatCLists */ - dlist_foreach(iter, &ccp->cc_lists) - { - CatCList *cl; + cl = dlist_container(CatCList, cache_elem, iter.cur); + Assert(cl->cl_magic == CL_MAGIC); + Assert(cl->refcount == 0); + Assert(!cl->dead); + } - cl = dlist_container(CatCList, cache_elem, iter.cur); - Assert(cl->cl_magic == CL_MAGIC); - Assert(cl->refcount == 0); - Assert(!cl->dead); - } + /* Check individual tuples */ + for (i = 0; i < ccp->cc_nbuckets; i++) + { + dlist_head *bucket = &ccp->cc_bucket[i]; - /* Check individual tuples */ - for (i = 0; i < ccp->cc_nbuckets; i++) + dlist_foreach(iter, bucket) { - dlist_head *bucket = &ccp->cc_bucket[i]; - - dlist_foreach(iter, bucket) - { - CatCTup *ct; + CatCTup *ct; - ct = dlist_container(CatCTup, cache_elem, iter.cur); - Assert(ct->ct_magic == CT_MAGIC); - Assert(ct->refcount == 0); - Assert(!ct->dead); - } + ct = dlist_container(CatCTup, cache_elem, iter.cur); + Assert(ct->ct_magic == CT_MAGIC); + Assert(ct->refcount == 0); + Assert(!ct->dead); } } } diff --git a/src/backend/utils/cache/relfilenodemap.c b/src/backend/utils/cache/relfilenodemap.c index 557ff6148d0..1e8429c64c3 100644 --- a/src/backend/utils/cache/relfilenodemap.c +++ b/src/backend/utils/cache/relfilenodemap.c @@ -220,7 +220,6 @@ RelidByRelfilenode(Oid reltablespace, Oid relfilenode) found = true; #ifdef USE_ASSERT_CHECKING - if (assert_enabled) { bool isnull; Oid check; |