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

Commitf68d05d

Browse files
committed
Limit NBuffers and some related values to INT_MAX / BLCKSZ, to prevent
arithmetic overflow during initial sizing calculations. This is notwater-tight but it should avoid the grossest sorts of failures.
1 parentfdd13f1 commitf68d05d

File tree

1 file changed

+10
-12
lines changed
  • src/backend/utils/misc

1 file changed

+10
-12
lines changed

‎src/backend/utils/misc/guc.c

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Written by Peter Eisentraut <peter_e@gmx.net>.
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.243 2004/10/12 21:54:42 petere Exp $
13+
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.244 2004/10/16 19:08:38 tgl Exp $
1414
*
1515
*--------------------------------------------------------------------
1616
*/
@@ -949,7 +949,7 @@ static struct config_int ConfigureNamesInt[] =
949949
NULL
950950
},
951951
&MaxBackends,
952-
100,1,INT_MAX,NULL,NULL
952+
100,1,INT_MAX /BLCKSZ,NULL,NULL
953953
},
954954

955955
{
@@ -958,7 +958,7 @@ static struct config_int ConfigureNamesInt[] =
958958
NULL
959959
},
960960
&ReservedBackends,
961-
2,0,INT_MAX,NULL,NULL
961+
2,0,INT_MAX /BLCKSZ,NULL,NULL
962962
},
963963

964964
{
@@ -967,7 +967,7 @@ static struct config_int ConfigureNamesInt[] =
967967
NULL
968968
},
969969
&NBuffers,
970-
1000,16,INT_MAX,NULL,NULL
970+
1000,16,INT_MAX /BLCKSZ,NULL,NULL
971971
},
972972

973973
{
@@ -1107,17 +1107,15 @@ static struct config_int ConfigureNamesInt[] =
11071107

11081108
{
11091109
{"max_fsm_relations",PGC_POSTMASTER,RESOURCES_FSM,
1110-
gettext_noop("Sets the maximum number of tables and indexes for which free space is "
1111-
"tracked."),
1110+
gettext_noop("Sets the maximum number of tables and indexes for which free space is tracked."),
11121111
NULL
11131112
},
11141113
&MaxFSMRelations,
11151114
1000,100,INT_MAX,NULL,NULL
11161115
},
11171116
{
11181117
{"max_fsm_pages",PGC_POSTMASTER,RESOURCES_FSM,
1119-
gettext_noop("Sets the maximum number of disk pages for which free space is "
1120-
"tracked."),
1118+
gettext_noop("Sets the maximum number of disk pages for which free space is tracked."),
11211119
NULL
11221120
},
11231121
&MaxFSMPages,
@@ -1129,7 +1127,7 @@ static struct config_int ConfigureNamesInt[] =
11291127
gettext_noop("Sets the maximum number of locks per transaction."),
11301128
gettext_noop("The shared lock table is sized on the assumption that "
11311129
"at most max_locks_per_transaction * max_connections distinct "
1132-
"objects will need to be locked at any one time.")
1130+
"objects will need to be locked at any one time.")
11331131
},
11341132
&max_locks_per_xact,
11351133
64,10,INT_MAX,NULL,NULL
@@ -1191,7 +1189,7 @@ static struct config_int ConfigureNamesInt[] =
11911189
NULL
11921190
},
11931191
&XLOGbuffers,
1194-
8,4,INT_MAX,NULL,NULL
1192+
8,4,INT_MAX /BLCKSZ,NULL,NULL
11951193
},
11961194

11971195
{
@@ -1277,7 +1275,7 @@ static struct config_int ConfigureNamesInt[] =
12771275
NULL
12781276
},
12791277
&Log_RotationAge,
1280-
24*60,0,INT_MAX,NULL,NULL
1278+
24*60,0,INT_MAX /60,NULL,NULL
12811279
},
12821280

12831281
{
@@ -1286,7 +1284,7 @@ static struct config_int ConfigureNamesInt[] =
12861284
NULL
12871285
},
12881286
&Log_RotationSize,
1289-
10*1024,0,INT_MAX,NULL,NULL
1287+
10*1024,0,INT_MAX /1024,NULL,NULL
12901288
},
12911289

12921290
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp