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

Commit3e5ea47

Browse files
committed
Stop reading uninitialized memory in heap_inplace_lock().
Stop computing a never-used value. This removes the read; the read hadno functional implications. Back-patch to v12, like commita07e03f.Reported by Alexander Lakhin.Discussion:https://postgr.es/m/6c92f59b-f5bc-e58c-9bdd-d1f21c17c786@gmail.com
1 parent884c1a4 commit3e5ea47

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

‎src/backend/access/heap/heapam.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6038,10 +6038,9 @@ heap_inplace_lock(Relation relation,
60386038
LockTupleModelockmode=LockTupleNoKeyExclusive;
60396039
MultiXactStatusmxact_status=MultiXactStatusNoKeyUpdate;
60406040
intremain;
6041-
boolcurrent_is_member;
60426041

60436042
if (DoesMultiXactIdConflict((MultiXactId)xwait,infomask,
6044-
lockmode,&current_is_member))
6043+
lockmode,NULL))
60456044
{
60466045
LockBuffer(buffer,BUFFER_LOCK_UNLOCK);
60476046
ret= false;

‎src/test/isolation/expected/intra-grant-inplace.out

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,30 @@ step addk2: ALTER TABLE intra_grant_inplace ADD PRIMARY KEY (c); <waiting ...>
6363
step r3: ROLLBACK;
6464
step addk2: <... completed>
6565

66+
starting permutation: b3 sfnku3 keyshr5 addk2 r3
67+
step b3: BEGIN ISOLATION LEVEL READ COMMITTED;
68+
step sfnku3:
69+
SELECT relhasindex FROM pg_class
70+
WHERE oid = 'intra_grant_inplace'::regclass FOR NO KEY UPDATE;
71+
72+
relhasindex
73+
-----------
74+
f
75+
(1 row)
76+
77+
step keyshr5:
78+
SELECT relhasindex FROM pg_class
79+
WHERE oid = 'intra_grant_inplace'::regclass FOR KEY SHARE;
80+
81+
relhasindex
82+
-----------
83+
f
84+
(1 row)
85+
86+
step addk2: ALTER TABLE intra_grant_inplace ADD PRIMARY KEY (c); <waiting ...>
87+
step r3: ROLLBACK;
88+
step addk2: <... completed>
89+
6690
starting permutation: b2 sfnku2 addk2 c2
6791
step b2: BEGIN;
6892
step sfnku2:

‎src/test/isolation/specs/intra-grant-inplace.spec

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,14 @@ permutation
9696
addk2(r3)
9797
r3
9898

99+
# reproduce bug in DoesMultiXactIdConflict() call
100+
permutation
101+
b3
102+
sfnku3
103+
keyshr5
104+
addk2(r3)
105+
r3
106+
99107
# same-xact rowmark
100108
permutation
101109
b2

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp