Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbe9bdab

Browse files
amcheck: Sanitize metapage's allequalimage field.
This will be helpful if it ever proves necessary to revoke an opclass'ssupport for deduplication.Backpatch: 13-, where nbtree deduplication was introduced.
1 parent05dfb81 commitbe9bdab

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

‎contrib/amcheck/verify_nbtree.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,20 @@ bt_index_check_internal(Oid indrelid, bool parentcheck, bool heapallindexed,
305305
errmsg("index \"%s\" lacks a main relation fork",
306306
RelationGetRelationName(indrel))));
307307

308-
/*Check index, possibly against tableitis an index on */
308+
/*Extract metadata from metapage, and sanitizeitin passing */
309309
_bt_metaversion(indrel,&heapkeyspace,&allequalimage);
310+
if (allequalimage&& !heapkeyspace)
311+
ereport(ERROR,
312+
(errcode(ERRCODE_INDEX_CORRUPTED),
313+
errmsg("index \"%s\" metapage has equalimage field set on unsupported nbtree version",
314+
RelationGetRelationName(indrel))));
315+
if (allequalimage&& !_bt_allequalimage(indrel, false))
316+
ereport(ERROR,
317+
(errcode(ERRCODE_INDEX_CORRUPTED),
318+
errmsg("index \"%s\" metapage incorrectly indicates that deduplication is safe",
319+
RelationGetRelationName(indrel))));
320+
321+
/* Check index, possibly against table it is an index on */
310322
bt_check_every_level(indrel,heaprel,heapkeyspace,parentcheck,
311323
heapallindexed,rootdescend);
312324
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp