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

Commit1e35951

Browse files
committed
Turn a few 'validnsps' static variables into locals
There was no need for these to be static buffers, local variables workjust as well. I think they were marked as 'static' to imply that theyare read-only, but 'const' is more appropriate for that, so changethem to const.To make it possible to mark the variables as 'const', also add 'const'decorations to the transformRelOptions() signature.Reviewed-by: Andres FreundDiscussion:https://www.postgresql.org/message-id/54c29fb0-edf2-48ea-9814-44e918bbd6e8@iki.fi
1 parenta890ad2 commit1e35951

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

‎src/backend/access/common/reloptions.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,7 @@ add_local_string_reloption(local_relopts *relopts, const char *name,
11541154
*/
11551155
Datum
11561156
transformRelOptions(DatumoldOptions,List*defList,constchar*namspace,
1157-
char*validnsps[],boolacceptOidsOff,boolisReset)
1157+
constchar*constvalidnsps[],boolacceptOidsOff,boolisReset)
11581158
{
11591159
Datumresult;
11601160
ArrayBuildState*astate;

‎src/backend/commands/createas.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ create_ctas_internal(List *attrList, IntoClause *into)
8383
boolis_matview;
8484
charrelkind;
8585
Datumtoast_options;
86-
staticchar*validnsps[]=HEAP_RELOPT_NAMESPACES;
86+
constchar*constvalidnsps[]=HEAP_RELOPT_NAMESPACES;
8787
ObjectAddressintoRelationAddr;
8888

8989
/* This code supports both CREATE TABLE AS and CREATE MATERIALIZED VIEW */

‎src/backend/commands/tablecmds.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId,
700700
ListCell *listptr;
701701
AttrNumberattnum;
702702
boolpartitioned;
703-
static char *validnsps[] = HEAP_RELOPT_NAMESPACES;
703+
const char *constvalidnsps[] = HEAP_RELOPT_NAMESPACES;
704704
OidofTypeId;
705705
ObjectAddress address;
706706
LOCKMODEparentLockmode;
@@ -14897,7 +14897,7 @@ ATExecSetRelOptions(Relation rel, List *defList, AlterTableType operation,
1489714897
Datumrepl_val[Natts_pg_class];
1489814898
boolrepl_null[Natts_pg_class];
1489914899
boolrepl_repl[Natts_pg_class];
14900-
static char *validnsps[] = HEAP_RELOPT_NAMESPACES;
14900+
const char *constvalidnsps[] = HEAP_RELOPT_NAMESPACES;
1490114901

1490214902
if (defList == NIL && operation != AT_ReplaceRelOptions)
1490314903
return;/* nothing to do */

‎src/backend/tcop/utility.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1155,7 +1155,7 @@ ProcessUtilitySlow(ParseState *pstate,
11551155
{
11561156
CreateStmt*cstmt= (CreateStmt*)stmt;
11571157
Datumtoast_options;
1158-
staticchar*validnsps[]=HEAP_RELOPT_NAMESPACES;
1158+
constchar*constvalidnsps[]=HEAP_RELOPT_NAMESPACES;
11591159

11601160
/* Remember transformed RangeVar for LIKE */
11611161
table_rv=cstmt->relation;

‎src/include/access/reloptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ extern void add_local_string_reloption(local_relopts *relopts, const char *name,
220220
fill_string_reloptfiller,intoffset);
221221

222222
externDatumtransformRelOptions(DatumoldOptions,List*defList,
223-
constchar*namspace,char*validnsps[],
223+
constchar*namspace,constchar*constvalidnsps[],
224224
boolacceptOidsOff,boolisReset);
225225
externList*untransformRelOptions(Datumoptions);
226226
externbytea*extractRelOptions(HeapTupletuple,TupleDesctupdesc,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp