Skip to content

Commit 6cffe54

Browse files
committed
Fix pointer confusion
get_object_address_publication_rel() needed to check *relation, not relation. Rename the variables to match style used nearby to avoid the confusion.
1 parent 16a6188 commit 6cffe54

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/backend/catalog/objectaddress.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ static ObjectAddress get_object_address_opf_member(ObjectType objtype,
729729
static ObjectAddress get_object_address_usermapping(List *objname,
730730
List *objargs, bool missing_ok);
731731
static ObjectAddress get_object_address_publication_rel(List *objname,
732-
List *objargs, Relation *relation,
732+
List *objargs, Relation *relp,
733733
bool missing_ok);
734734
static ObjectAddress get_object_address_defacl(List *objname, List *objargs,
735735
bool missing_ok);
@@ -1815,15 +1815,16 @@ get_object_address_usermapping(List *objname, List *objargs, bool missing_ok)
18151815
*/
18161816
static ObjectAddress
18171817
get_object_address_publication_rel(List *objname, List *objargs,
1818-
Relation *relation, bool missing_ok)
1818+
Relation *relp, bool missing_ok)
18191819
{
18201820
ObjectAddress address;
1821+
Relation relation;
18211822
char *pubname;
18221823
Publication *pub;
18231824

18241825
ObjectAddressSet(address, PublicationRelRelationId, InvalidOid);
18251826

1826-
*relation = relation_openrv_extended(makeRangeVarFromNameList(objname),
1827+
relation = relation_openrv_extended(makeRangeVarFromNameList(objname),
18271828
AccessShareLock, missing_ok);
18281829
if (!relation)
18291830
return address;
@@ -1839,18 +1840,19 @@ get_object_address_publication_rel(List *objname, List *objargs,
18391840
/* Find the publication relation mapping in syscache. */
18401841
address.objectId =
18411842
GetSysCacheOid2(PUBLICATIONRELMAP,
1842-
ObjectIdGetDatum(RelationGetRelid(*relation)),
1843+
ObjectIdGetDatum(RelationGetRelid(relation)),
18431844
ObjectIdGetDatum(pub->oid));
18441845
if (!OidIsValid(address.objectId))
18451846
{
18461847
if (!missing_ok)
18471848
ereport(ERROR,
18481849
(errcode(ERRCODE_UNDEFINED_OBJECT),
18491850
errmsg("publication relation \"%s\" in publication \"%s\" does not exist",
1850-
RelationGetRelationName(*relation), pubname)));
1851+
RelationGetRelationName(relation), pubname)));
18511852
return address;
18521853
}
18531854

1855+
*relp = relation;
18541856
return address;
18551857
}
18561858

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