Content-Length: 259958 | pFad | http://github.com/postgrespro/postgres/commit/a36aa223ec447276bf7050ab9ec6d974cafdf6c4

3A Fix attach of a previously-detached injection point. · postgrespro/postgres@a36aa22 · GitHub
Skip to content

Commit a36aa22

Browse files
committed
Fix attach of a previously-detached injection point.
It's normal for the name in a free slot to match the new name. The max_inuse mechanism kept simple cases from reaching the problem. The problem could appear when index 0 was the previously-detached entry and index 1 is in use. Back-patch to v17, where this code first appeared.
1 parent 04158e7 commit a36aa22

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/backend/utils/misc/injection_point.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,7 @@ InjectionPointAttach(const char *name,
315315
if (free_idx == -1)
316316
free_idx = idx;
317317
}
318-
319-
if (strcmp(entry->name, name) == 0)
318+
else if (strcmp(entry->name, name) == 0)
320319
elog(ERROR, "injection point \"%s\" already defined", name);
321320
}
322321
if (free_idx == -1)

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/a36aa223ec447276bf7050ab9ec6d974cafdf6c4

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy