amcheck: Report an error when the next page to a leaf is not a leaf
authorAlexander Korotkov <akorotkov@postgresql.org>
Wed, 22 May 2024 23:13:43 +0000 (02:13 +0300)
committerAlexander Korotkov <akorotkov@postgresql.org>
Wed, 22 May 2024 23:13:43 +0000 (02:13 +0300)
commit97e5b0026fc276ab1bcde58ae98ae1fcd9c3acc3
tree1c2ec4796a1db2290af5f5029e9c4531df08b2d3
parent0b5c161248110b164a3333006004c78f9529a109
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
contrib/amcheck/verify_nbtree.c