Skip to content

Commit 24541ff

Browse files
committed
... and the very same bug in publicationListToArray().
Sigh.
1 parent 7376390 commit 24541ff

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/backend/commands/subscriptioncmds.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ parse_subscription_options(List *options, bool *connect, bool *enabled_given,
244244
}
245245

246246
/*
247-
* Auxiliary function to return a text array out of a list of String nodes.
247+
* Auxiliary function to build a text array out of a list of String nodes.
248248
*/
249249
static Datum
250250
publicationListToArray(List *publist)
@@ -264,7 +264,8 @@ publicationListToArray(List *publist)
264264
ALLOCSET_DEFAULT_MAXSIZE);
265265
oldcxt = MemoryContextSwitchTo(memcxt);
266266

267-
datums = palloc(sizeof(text *) * list_length(publist));
267+
datums = (Datum *) palloc(sizeof(Datum) * list_length(publist));
268+
268269
foreach(cell, publist)
269270
{
270271
char *name = strVal(lfirst(cell));
@@ -275,7 +276,7 @@ publicationListToArray(List *publist)
275276
{
276277
char *pname = strVal(lfirst(pcell));
277278

278-
if (name == pname)
279+
if (pcell == cell)
279280
break;
280281

281282
if (strcmp(name, pname) == 0)
@@ -292,6 +293,7 @@ publicationListToArray(List *publist)
292293

293294
arr = construct_array(datums, list_length(publist),
294295
TEXTOID, -1, false, 'i');
296+
295297
MemoryContextDelete(memcxt);
296298

297299
return PointerGetDatum(arr);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy