postgresql/contrib/pageinspect
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 pageinspect: Add bt_page_items function with bytea argument 2017-04-04 23:52:55 -04:00
sql pageinspect: Add bt_page_items function with bytea argument 2017-04-04 23:52:55 -04:00
.gitignore pageinspect: Add tests 2016-11-01 14:02:16 -04:00
Makefile pageinspect: Support hash indexes. 2017-02-02 14:19:32 -05:00
brinfuncs.c Reduce the number of pallocs() in BRIN 2017-04-07 19:08:43 -03:00
btreefuncs.c pageinspect: Add bt_page_items function with bytea argument 2017-04-04 23:52:55 -04:00
fsmfuncs.c In pageinspect/hashfuncs.c, avoid crashes on alignment-picky machines. 2017-02-03 11:34:47 -05:00
ginfuncs.c In pageinspect/hashfuncs.c, avoid crashes on alignment-picky machines. 2017-02-03 11:34:47 -05:00
hashfuncs.c Clean up manipulations of hash indexes' hasho_flag field. 2017-04-14 17:04:25 -04:00
heapfuncs.c In pageinspect/hashfuncs.c, avoid crashes on alignment-picky machines. 2017-02-03 11:34:47 -05:00
pageinspect--1.0--1.1.sql Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:37 +02:00
pageinspect--1.1--1.2.sql Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:37 +02:00
pageinspect--1.2--1.3.sql pageinspect/BRIN: minor tweaks 2014-12-02 12:20:50 -03:00
pageinspect--1.3--1.4.sql Add forgotten file in commit d6061f83a1 2015-11-25 16:59:07 +03:00
pageinspect--1.4--1.5.sql Update pageinspect extension for parallel query. 2016-06-09 17:18:09 -04:00
pageinspect--1.5--1.6.sql pageinspect: Add bt_page_items function with bytea argument 2017-04-04 23:52:55 -04:00
pageinspect--1.5.sql Update pageinspect extension for parallel query. 2016-06-09 17:18:09 -04:00
pageinspect--unpackaged--1.0.sql Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:37 +02:00
pageinspect.control pageinspect: Support hash indexes. 2017-02-02 14:19:32 -05:00
pageinspect.h In pageinspect/hashfuncs.c, avoid crashes on alignment-picky machines. 2017-02-03 11:34:47 -05:00
rawpage.c pageinspect: Add page_checksum function 2017-03-17 10:55:17 -04:00