mirror of
https://github.com/postgres/postgres.git
synced 2025-07-29 12:12:46 +00:00

This tightens a couple checks in checking GIN indexes, which might have resulted in incorrect results (false positives/negatives). * The code skipped ordering checks if the entries were for different attributes (for multi-column GIN indexes), possibly missing some cases of data corruption. But the attribute number is part of the ordering, so we can check that. * The root page was skipped when checking entry order, but that is unnecessary. The root page is subject to the same ordering rules, we can process it just like any other page. * The high key on the right-most page was not checked, but that is needed only for inner pages (we don't store the high key for those). For leaf pages we can check the high key just fine. * Correct the detection of split pages. If the page gets split, the cached parent key is greater than the current child key (not less, as the code incorrectly expected). Issues reported by Arseniy Mukhin, along with a proposed patch. Review by Andrey M. Borodin, cleanup and improvements by me. Author: Arseniy Mukhin <arseniy.mukhin.dev@gmail.com> Reviewed-by: Andrey M. Borodin <x4mmm@yandex-team.ru> Discussion: https://postgr.es/m/CAE7r3MJ611B9TE=YqBBncewp7-k64VWs+sjk7XF6fJUX77uFBA@mail.gmail.com
56 lines
1.1 KiB
Meson
56 lines
1.1 KiB
Meson
# Copyright (c) 2022-2025, PostgreSQL Global Development Group
|
|
|
|
amcheck_sources = files(
|
|
'verify_common.c',
|
|
'verify_gin.c',
|
|
'verify_heapam.c',
|
|
'verify_nbtree.c',
|
|
)
|
|
|
|
if host_system == 'windows'
|
|
amcheck_sources += rc_lib_gen.process(win32ver_rc, extra_args: [
|
|
'--NAME', 'amcheck',
|
|
'--FILEDESC', 'amcheck - function for verifying relation integrity',])
|
|
endif
|
|
|
|
amcheck = shared_module('amcheck',
|
|
amcheck_sources,
|
|
kwargs: contrib_mod_args,
|
|
)
|
|
contrib_targets += amcheck
|
|
|
|
install_data(
|
|
'amcheck.control',
|
|
'amcheck--1.0.sql',
|
|
'amcheck--1.0--1.1.sql',
|
|
'amcheck--1.1--1.2.sql',
|
|
'amcheck--1.2--1.3.sql',
|
|
'amcheck--1.3--1.4.sql',
|
|
'amcheck--1.4--1.5.sql',
|
|
kwargs: contrib_data_args,
|
|
)
|
|
|
|
tests += {
|
|
'name': 'amcheck',
|
|
'sd': meson.current_source_dir(),
|
|
'bd': meson.current_build_dir(),
|
|
'regress': {
|
|
'sql': [
|
|
'check',
|
|
'check_btree',
|
|
'check_gin',
|
|
'check_heap',
|
|
],
|
|
},
|
|
'tap': {
|
|
'tests': [
|
|
't/001_verify_heapam.pl',
|
|
't/002_cic.pl',
|
|
't/003_cic_2pc.pl',
|
|
't/004_verify_nbtree_unique.pl',
|
|
't/005_pitr.pl',
|
|
't/006_verify_gin.pl',
|
|
],
|
|
},
|
|
}
|