postgresql/src/backend/access
Tom Lane 2040bb4a0b 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.
2017-04-14 17:04:25 -04:00
..
brin Reduce the number of pallocs() in BRIN 2017-04-07 19:08:43 -03:00
common Clean up after insufficiently-researched optimization of tuple conversions. 2017-04-06 21:10:20 -04:00
gin Fix mixup of bool and ternary value 2017-04-06 13:09:42 -04:00
gist Put back <float.h> in a few files that need it for _isnan(). 2017-03-08 15:38:34 -05:00
hash Clean up manipulations of hash indexes' hasho_flag field. 2017-04-14 17:04:25 -04:00
heap Simplify check of modified attributes in heap_update 2017-03-29 14:01:14 -03:00
index Improve error reporting for tuple-routing failures. 2017-03-03 09:09:52 +05:30
nbtree Add optimizer and executor support for parallel index scans. 2017-02-15 13:53:24 -05:00
rmgrdesc BRIN de-summarization 2017-04-01 16:10:04 -03:00
spgist Use wrappers of PG_DETOAST_DATUM_PACKED() more. 2017-03-12 19:35:34 -04:00
tablesample Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
transam Always SnapshotResetXmin() during ClearTransaction() 2017-04-06 10:30:22 -04:00
Makefile TABLESAMPLE, SQL Standard and extensible 2015-05-15 14:37:10 -04:00