aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeProjectSet.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-04-14 17:04:25 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2017-04-14 17:04:25 -0400
commit2040bb4a0b50ef0434a1a723f00d040ab4f1c06f (patch)
treecc6feca5b13b82793004108cedc54972891b40ea /src/backend/executor/nodeProjectSet.c
parent1dffabed49054a81b6005a363ab2da4aee0aab9e (diff)
downloadpostgresql-2040bb4a0b50ef0434a1a723f00d040ab4f1c06f.tar.gz
postgresql-2040bb4a0b50ef0434a1a723f00d040ab4f1c06f.zip
Clean up manipulations of hash indexes' hasho_flag field.
Standardize on testing a hash index page's type by doing (opaque->hasho_flag & LH_PAGE_TYPE) == LH_xxx_PAGE Various places were taking shortcuts like opaque->hasho_flag & LH_BUCKET_PAGE which while not actually wrong, is still bad practice because it encourages use of opaque->hasho_flag & LH_UNUSED_PAGE which *is* wrong (LH_UNUSED_PAGE == 0, so the above is constant false). hash_xlog.c's hash_mask() contained such an incorrect test. This also ensures that we mask out the additional flag bits that hasho_flag has accreted since 9.6. pgstattuple's pgstat_hash_page(), for one, was failing to do that and was thus actively broken. Also fix assorted comments that hadn't been updated to reflect the extended usage of hasho_flag, and fix some macros that were testing just "(hasho_flag & bit)" to use the less dangerous, project-approved form "((hasho_flag & bit) != 0)". Coverity found the bug in hash_mask(); I noted the one in pgstat_hash_page() through code reading.
Diffstat (limited to 'src/backend/executor/nodeProjectSet.c')
0 files changed, 0 insertions, 0 deletions