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

Commit6bd8448

Browse files
peterepull[bot]
authored andcommitted
Rename some function arguments for better clarity
Especially make sure that array arguments have plural names.Discussion:https://www.postgresql.org/message-id/flat/5ed89c69-f4e6-5dab-4003-63bde7460e5e%40eisentraut.org
1 parent7c429ef commit6bd8448

File tree

5 files changed

+95
-95
lines changed

5 files changed

+95
-95
lines changed

‎src/backend/catalog/index.c

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,17 @@ static bool relationHasPrimaryKey(Relation rel);
108108
staticTupleDescConstructTupleDescriptor(RelationheapRelation,
109109
constIndexInfo*indexInfo,
110110
constList*indexColNames,
111-
OidaccessMethodObjectId,
112-
constOid*collationObjectId,
113-
constOid*classObjectId);
111+
OidaccessMethodId,
112+
constOid*collationIds,
113+
constOid*opclassIds);
114114
staticvoidInitializeAttributeOids(RelationindexRelation,
115115
intnumatts,Oidindexoid);
116116
staticvoidAppendAttributeTuples(RelationindexRelation,constDatum*attopts);
117117
staticvoidUpdateIndexRelation(Oidindexoid,Oidheapoid,
118118
OidparentIndexId,
119119
constIndexInfo*indexInfo,
120120
constOid*collationOids,
121-
constOid*classOids,
121+
constOid*opclassOids,
122122
constint16*coloptions,
123123
boolprimary,
124124
boolisexclusion,
@@ -286,9 +286,9 @@ static TupleDesc
286286
ConstructTupleDescriptor(RelationheapRelation,
287287
constIndexInfo*indexInfo,
288288
constList*indexColNames,
289-
OidaccessMethodObjectId,
290-
constOid*collationObjectId,
291-
constOid*classObjectId)
289+
OidaccessMethodId,
290+
constOid*collationIds,
291+
constOid*opclassIds)
292292
{
293293
intnumatts=indexInfo->ii_NumIndexAttrs;
294294
intnumkeyatts=indexInfo->ii_NumIndexKeyAttrs;
@@ -301,7 +301,7 @@ ConstructTupleDescriptor(Relation heapRelation,
301301
inti;
302302

303303
/* We need access to the index AM's API struct */
304-
amroutine=GetIndexAmRoutineByAmId(accessMethodObjectId, false);
304+
amroutine=GetIndexAmRoutineByAmId(accessMethodId, false);
305305

306306
/* ... and to the table's tuple descriptor */
307307
heapTupDesc=RelationGetDescr(heapRelation);
@@ -330,7 +330,7 @@ ConstructTupleDescriptor(Relation heapRelation,
330330
to->attcacheoff=-1;
331331
to->attislocal= true;
332332
to->attcollation= (i<numkeyatts) ?
333-
collationObjectId[i] :InvalidOid;
333+
collationIds[i] :InvalidOid;
334334

335335
/*
336336
* Set the attribute name as specified by caller.
@@ -436,10 +436,10 @@ ConstructTupleDescriptor(Relation heapRelation,
436436

437437
if (i<indexInfo->ii_NumIndexKeyAttrs)
438438
{
439-
tuple=SearchSysCache1(CLAOID,ObjectIdGetDatum(classObjectId[i]));
439+
tuple=SearchSysCache1(CLAOID,ObjectIdGetDatum(opclassIds[i]));
440440
if (!HeapTupleIsValid(tuple))
441441
elog(ERROR,"cache lookup failed for opclass %u",
442-
classObjectId[i]);
442+
opclassIds[i]);
443443
opclassTup= (Form_pg_opclass)GETSTRUCT(tuple);
444444
if (OidIsValid(opclassTup->opckeytype))
445445
keyType=opclassTup->opckeytype;
@@ -553,7 +553,7 @@ UpdateIndexRelation(Oid indexoid,
553553
OidparentIndexId,
554554
constIndexInfo*indexInfo,
555555
constOid*collationOids,
556-
constOid*classOids,
556+
constOid*opclassOids,
557557
constint16*coloptions,
558558
boolprimary,
559559
boolisexclusion,
@@ -581,7 +581,7 @@ UpdateIndexRelation(Oid indexoid,
581581
for (i=0;i<indexInfo->ii_NumIndexAttrs;i++)
582582
indkey->values[i]=indexInfo->ii_IndexAttrNumbers[i];
583583
indcollation=buildoidvector(collationOids,indexInfo->ii_NumIndexKeyAttrs);
584-
indclass=buildoidvector(classOids,indexInfo->ii_NumIndexKeyAttrs);
584+
indclass=buildoidvector(opclassOids,indexInfo->ii_NumIndexKeyAttrs);
585585
indoption=buildint2vector(coloptions,indexInfo->ii_NumIndexKeyAttrs);
586586

587587
/*
@@ -679,10 +679,10 @@ UpdateIndexRelation(Oid indexoid,
679679
*May be nonzero to attach an existing valid build.
680680
* indexInfo: same info executor uses to insert into the index
681681
* indexColNames: column names to use for index (List of char *)
682-
*accessMethodObjectId: OID of index AM to use
682+
*accessMethodId: OID of index AM to use
683683
* tableSpaceId: OID of tablespace to use
684-
*collationObjectId: array of collation OIDs, one per index column
685-
*classObjectId: array of index opclass OIDs, one per index column
684+
*collationIds: array of collation OIDs, one per index column
685+
*opclassIds: array of index opclass OIDs, one per index column
686686
* coloptions: array of per-index-column indoption settings
687687
* reloptions: AM-specific options
688688
* flags: bitmask that can include any combination of these bits:
@@ -719,10 +719,10 @@ index_create(Relation heapRelation,
719719
RelFileNumberrelFileNumber,
720720
IndexInfo*indexInfo,
721721
constList*indexColNames,
722-
OidaccessMethodObjectId,
722+
OidaccessMethodId,
723723
OidtableSpaceId,
724-
constOid*collationObjectId,
725-
constOid*classObjectId,
724+
constOid*collationIds,
725+
constOid*opclassIds,
726726
constint16*coloptions,
727727
Datumreloptions,
728728
bits16flags,
@@ -806,8 +806,8 @@ index_create(Relation heapRelation,
806806
*/
807807
for (i=0;i<indexInfo->ii_NumIndexKeyAttrs;i++)
808808
{
809-
Oidcollation=collationObjectId[i];
810-
Oidopclass=classObjectId[i];
809+
Oidcollation=collationIds[i];
810+
Oidopclass=opclassIds[i];
811811

812812
if (collation)
813813
{
@@ -908,9 +908,9 @@ index_create(Relation heapRelation,
908908
indexTupDesc=ConstructTupleDescriptor(heapRelation,
909909
indexInfo,
910910
indexColNames,
911-
accessMethodObjectId,
912-
collationObjectId,
913-
classObjectId);
911+
accessMethodId,
912+
collationIds,
913+
opclassIds);
914914

915915
/*
916916
* Allocate an OID for the index, unless we were told what to use.
@@ -964,7 +964,7 @@ index_create(Relation heapRelation,
964964
tableSpaceId,
965965
indexRelationId,
966966
relFileNumber,
967-
accessMethodObjectId,
967+
accessMethodId,
968968
indexTupDesc,
969969
relkind,
970970
relpersistence,
@@ -993,7 +993,7 @@ index_create(Relation heapRelation,
993993
* XXX should have a cleaner way to create cataloged indexes
994994
*/
995995
indexRelation->rd_rel->relowner=heapRelation->rd_rel->relowner;
996-
indexRelation->rd_rel->relam=accessMethodObjectId;
996+
indexRelation->rd_rel->relam=accessMethodId;
997997
indexRelation->rd_rel->relispartition=OidIsValid(parentIndexRelid);
998998

999999
/*
@@ -1030,7 +1030,7 @@ index_create(Relation heapRelation,
10301030
*/
10311031
UpdateIndexRelation(indexRelationId,heapRelationId,parentIndexRelid,
10321032
indexInfo,
1033-
collationObjectId,classObjectId,coloptions,
1033+
collationIds,opclassIds,coloptions,
10341034
isprimary,is_exclusion,
10351035
(constr_flags&INDEX_CONSTR_CREATE_DEFERRABLE)==0,
10361036
!concurrent&& !invalid,
@@ -1159,19 +1159,19 @@ index_create(Relation heapRelation,
11591159
/* The default collation is pinned, so don't bother recording it */
11601160
for (i=0;i<indexInfo->ii_NumIndexKeyAttrs;i++)
11611161
{
1162-
if (OidIsValid(collationObjectId[i])&&
1163-
collationObjectId[i]!=DEFAULT_COLLATION_OID)
1162+
if (OidIsValid(collationIds[i])&&
1163+
collationIds[i]!=DEFAULT_COLLATION_OID)
11641164
{
11651165
ObjectAddressSet(referenced,CollationRelationId,
1166-
collationObjectId[i]);
1166+
collationIds[i]);
11671167
add_exact_object_address(&referenced,addrs);
11681168
}
11691169
}
11701170

11711171
/* Store dependency on operator classes */
11721172
for (i=0;i<indexInfo->ii_NumIndexKeyAttrs;i++)
11731173
{
1174-
ObjectAddressSet(referenced,OperatorClassRelationId,classObjectId[i]);
1174+
ObjectAddressSet(referenced,OperatorClassRelationId,opclassIds[i]);
11751175
add_exact_object_address(&referenced,addrs);
11761176
}
11771177

‎src/backend/catalog/toasting.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
142142
chartoast_relname[NAMEDATALEN];
143143
chartoast_idxname[NAMEDATALEN];
144144
IndexInfo*indexInfo;
145-
OidcollationObjectId[2];
146-
OidclassObjectId[2];
145+
OidcollationIds[2];
146+
OidopclassIds[2];
147147
int16coloptions[2];
148148
ObjectAddressbaseobject,
149149
toastobject;
@@ -312,11 +312,11 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
312312
indexInfo->ii_AmCache=NULL;
313313
indexInfo->ii_Context=CurrentMemoryContext;
314314

315-
collationObjectId[0]=InvalidOid;
316-
collationObjectId[1]=InvalidOid;
315+
collationIds[0]=InvalidOid;
316+
collationIds[1]=InvalidOid;
317317

318-
classObjectId[0]=OID_BTREE_OPS_OID;
319-
classObjectId[1]=INT4_BTREE_OPS_OID;
318+
opclassIds[0]=OID_BTREE_OPS_OID;
319+
opclassIds[1]=INT4_BTREE_OPS_OID;
320320

321321
coloptions[0]=0;
322322
coloptions[1]=0;
@@ -327,7 +327,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
327327
list_make2("chunk_id","chunk_seq"),
328328
BTREE_AM_OID,
329329
rel->rd_rel->reltablespace,
330-
collationObjectId,classObjectId,coloptions, (Datum)0,
330+
collationIds,opclassIds,coloptions, (Datum)0,
331331
INDEX_CREATE_IS_PRIMARY,0, true, true,NULL);
332332

333333
table_close(toast_rel,NoLock);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp