Skip to content

Commit

Permalink
Add StaticAssert to check the size of LONG_MIN, LONG_MAX and Datum.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyue-hashdata committed Jan 16, 2025
1 parent 0ac2ca1 commit 15feff6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/backend/executor/nodeHashjoin.c
Original file line number Diff line number Diff line change
Expand Up @@ -2457,9 +2457,13 @@ CreateAttrFilter(PlanState *target, AttrNumber lattno, AttrNumber rattno,

attr_filter->lattno = lattno;
attr_filter->rattno = rattno;
attr_filter->blm_filter = bloom_create_aggresive(plan_rows, work_mem, random());
attr_filter->min = LLONG_MAX;
attr_filter->max = LLONG_MIN;

attr_filter->blm_filter = bloom_create_aggresive(plan_rows, work_mem, random());

StaticAssertDecl(sizeof(LONG_MAX) == sizeof(Datum), "sizeof(LONG_MAX) should be equal to sizeof(Datum)");
StaticAssertDecl(sizeof(LONG_MIN) == sizeof(Datum), "sizeof(LONG_MIN) should be equal to sizeof(Datum)");
attr_filter->min = LONG_MAX;
attr_filter->max = LONG_MIN;

return attr_filter;
}

0 comments on commit 15feff6

Please sign in to comment.