amcheck: Report an error when the next page to a leaf is not a leaf

Alexander Korotkov <akorotkov@postgresql.org>

Commit: 97e5b0026fc276ab1bcde58ae98ae1fcd9c3acc3
Author: Alexander Korotkov <akorotkov@postgresql.org>
Date: 2024-05-22T23:13:43Z
Releases: 17.0
amcheck: Report an error when the next page to a leaf is not a leaf

This is a very unlikely condition during checking a B-tree unique constraint,
meaning that the index structure is violated badly, and we shouldn't continue
checking to avoid endless loops, etc.  So it's worth immediately throwing an
error.

Reported-by: Peter Geoghegan
Discussion: https://postgr.es/m/CAH2-Wzk%2B2116uOXdOViA27SHcr31WKPgmjsxXLBs_aTxAeThzg%40mail.gmail.com
Author: Pavel Borisov

Files

PathChange+/−
contrib/amcheck/verify_nbtree.c modified +16 −6

Discussion