postgresql/contrib/pgstattuple
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
..
expected Fix pgstattuple's handling of unused hash pages. 2017-04-12 11:53:00 -04:00
sql pgstattuple: Fix typo partitiond -> partitioned 2017-03-09 20:06:11 -05:00
.gitignore
Makefile Remove superuser checks in pgstattuple 2016-09-29 22:13:38 -04:00
pgstatapprox.c Refactor GetOldestXmin() to use flags 2017-03-22 16:51:01 +00:00
pgstatindex.c Fix pgstattuple's handling of unused hash pages. 2017-04-12 11:53:00 -04:00
pgstattuple--1.0--1.1.sql
pgstattuple--1.1--1.2.sql
pgstattuple--1.2--1.3.sql
pgstattuple--1.3--1.4.sql Update pgstattuple extension for parallel query. 2016-06-10 10:42:03 -04:00
pgstattuple--1.4--1.5.sql Fix pgstattuple's handling of unused hash pages. 2017-04-12 11:53:00 -04:00
pgstattuple--1.4.sql Minor fixes in contrib installation scripts. 2016-06-14 10:47:06 -04:00
pgstattuple--unpackaged--1.0.sql
pgstattuple.c Clean up manipulations of hash indexes' hasho_flag field. 2017-04-14 17:04:25 -04:00
pgstattuple.control Remove superuser checks in pgstattuple 2016-09-29 22:13:38 -04:00