Skip to content

Commit

Permalink
Cast fix in RelationGetHypercoreInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
erimatnor committed Oct 20, 2024
1 parent 23b736e commit 07ed8a7
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions tsl/src/hypercore/hypercore_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,14 +279,19 @@ lazy_build_hypercore_info_cache(Relation rel, bool create_chunk_constraints,
HypercoreInfo *
RelationGetHypercoreInfo(Relation rel)
{
if (NULL == rel->rd_amcache)
rel->rd_amcache = lazy_build_hypercore_info_cache(rel,
true /* create constraints */,
NULL /* compressed rel created */);
HypercoreInfo *hinfo = (HypercoreInfo *) rel->rd_amcache;

Assert(rel->rd_amcache && OidIsValid(((HypercoreInfo *) rel->rd_amcache)->compressed_relid));
if (NULL == hinfo)
{
hinfo = lazy_build_hypercore_info_cache(rel,
true /* create constraints */,
NULL /* compressed rel created */);
rel->rd_amcache = hinfo;
}

Assert(hinfo && OidIsValid(hinfo->compressed_relid));

return rel->rd_amcache;
return hinfo;
}

static void
Expand Down

0 comments on commit 07ed8a7

Please sign in to comment.