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

Commitc7fc880

Browse files
committed
ATExecSetRelOptions: Reduce scope of 'isnull' variable
Author: Nikolay Shaplov <dhyan@nataraj.su>Reviewed-by: Timur Magomedov <t.magomedov@postgrespro.ru>Discussion:https://postgr.es/m/1913854.tdWV9SEqCh@thinkpad-pgpro
1 parentda0f058 commitc7fc880

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

‎src/backend/commands/tablecmds.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15919,7 +15919,6 @@ ATExecSetRelOptions(Relation rel, List *defList, AlterTableType operation,
1591915919
HeapTupletuple;
1592015920
HeapTuplenewtuple;
1592115921
Datumdatum;
15922-
boolisnull;
1592315922
DatumnewOptions;
1592415923
Datumrepl_val[Natts_pg_class];
1592515924
boolrepl_null[Natts_pg_class];
@@ -15944,18 +15943,20 @@ ATExecSetRelOptions(Relation rel, List *defList, AlterTableType operation,
1594415943
* there were none before.
1594515944
*/
1594615945
datum = (Datum) 0;
15947-
isnull = true;
1594815946
}
1594915947
else
1595015948
{
15949+
boolisnull;
15950+
1595115951
/* Get the old reloptions */
1595215952
datum = SysCacheGetAttr(RELOID, tuple, Anum_pg_class_reloptions,
1595315953
&isnull);
15954+
if (isnull)
15955+
datum = (Datum) 0;
1595415956
}
1595515957

1595615958
/* Generate new proposed reloptions (text array) */
15957-
newOptions = transformRelOptions(isnull ? (Datum) 0 : datum,
15958-
defList, NULL, validnsps, false,
15959+
newOptions = transformRelOptions(datum, defList, NULL, validnsps, false,
1595915960
operation == AT_ResetRelOptions);
1596015961

1596115962
/* Validate */
@@ -16065,18 +16066,20 @@ ATExecSetRelOptions(Relation rel, List *defList, AlterTableType operation,
1606516066
* pretend there were none before.
1606616067
*/
1606716068
datum = (Datum) 0;
16068-
isnull = true;
1606916069
}
1607016070
else
1607116071
{
16072+
boolisnull;
16073+
1607216074
/* Get the old reloptions */
1607316075
datum = SysCacheGetAttr(RELOID, tuple, Anum_pg_class_reloptions,
1607416076
&isnull);
16077+
if (isnull)
16078+
datum = (Datum) 0;
1607516079
}
1607616080

16077-
newOptions = transformRelOptions(isnull ? (Datum) 0 : datum,
16078-
defList, "toast", validnsps, false,
16079-
operation == AT_ResetRelOptions);
16081+
newOptions = transformRelOptions(datum, defList, "toast", validnsps,
16082+
false, operation == AT_ResetRelOptions);
1608016083

1608116084
(void) heap_reloptions(RELKIND_TOASTVALUE, newOptions, true);
1608216085

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp