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

Commit43b55ec

Browse files
committed
Fix uninitialized memory bug
Have interested callers of find_inheritance_children set thedetached_exist value to false prior to calling it, so that that routineonly has to set it true in the rare cases where it is necessary. Don'ttouch it otherwise.Per buildfarm member thorntail (which reported a UBSan failure here).
1 parent84f15cc commit43b55ec

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

‎src/backend/catalog/pg_inherits.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ typedef struct SeenRelsEntry
5353
* against possible DROPs of child relations.
5454
*
5555
* If a partition's pg_inherits row is marked "detach pending",
56-
* *detached_exist (if not null) is set true, otherwise it is set false.
56+
* *detached_exist (if not null) is set true.
5757
*
5858
* If omit_detached is true and there is an active snapshot (not the same as
5959
* the catalog snapshot used to scan pg_inherits!) and a pg_inherits tuple
@@ -84,9 +84,6 @@ find_inheritance_children(Oid parentrelId, bool omit_detached,
8484
if (!has_subclass(parentrelId))
8585
returnNIL;
8686

87-
if (detached_exist)
88-
*detached_exist= false;
89-
9087
/*
9188
* Scan pg_inherits and build a working array of subclass OIDs.
9289
*/

‎src/backend/partitioning/partdesc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ RelationBuildPartitionDesc(Relation rel, bool omit_detached)
131131
* concurrently, whatever this function returns will be accurate as of
132132
* some well-defined point in time.
133133
*/
134+
detached_exist= false;
134135
inhoids=find_inheritance_children(RelationGetRelid(rel),omit_detached,
135136
NoLock,&detached_exist);
136137
nparts=list_length(inhoids);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp