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

Commit6b797c8

Browse files
committed
Fix recovery.conf boolean variables to take the same range of string
values as postgresql.conf.
1 parent5ce521f commit6b797c8

File tree

3 files changed

+13
-18
lines changed

3 files changed

+13
-18
lines changed

‎src/backend/access/transam/xlog.c

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.314 2008/06/12 09:12:30 heikki Exp $
10+
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.315 2008/06/30 22:10:43 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -4523,13 +4523,10 @@ readRecoveryCommandFile(void)
45234523
/*
45244524
* does nothing if a recovery_target is not also set
45254525
*/
4526-
if (strcmp(tok2,"true")==0)
4527-
recoveryTargetInclusive= true;
4528-
else
4529-
{
4530-
recoveryTargetInclusive= false;
4531-
tok2="false";
4532-
}
4526+
if (!parse_bool(tok2,&recoveryTargetInclusive))
4527+
ereport(ERROR,
4528+
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
4529+
errmsg("parameter \"recovery_target_inclusive\" requires a Boolean value")));
45334530
ereport(LOG,
45344531
(errmsg("recovery_target_inclusive = %s",tok2)));
45354532
}
@@ -4538,13 +4535,10 @@ readRecoveryCommandFile(void)
45384535
/*
45394536
* does nothing if a recovery_target is not also set
45404537
*/
4541-
if (strcmp(tok2,"true")==0)
4542-
recoveryLogRestartpoints= true;
4543-
else
4544-
{
4545-
recoveryLogRestartpoints= false;
4546-
tok2="false";
4547-
}
4538+
if (!parse_bool(tok2,&recoveryLogRestartpoints))
4539+
ereport(ERROR,
4540+
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
4541+
errmsg("parameter \"log_restartpoints\" requires a Boolean value")));
45484542
ereport(LOG,
45494543
(errmsg("log_restartpoints = %s",tok2)));
45504544
}

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

Lines changed: 2 additions & 2 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.457 2008/06/30 10:58:47 heikki Exp $
13+
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.458 2008/06/3022:10:43 momjian Exp $
1414
*
1515
*--------------------------------------------------------------------
1616
*/
@@ -3991,7 +3991,7 @@ ReportGUCOption(struct config_generic * record)
39913991
* If the string parses okay, return true, else false.
39923992
* If okay and result is not NULL, return the value in *result.
39933993
*/
3994-
staticbool
3994+
bool
39953995
parse_bool(constchar*value,bool*result)
39963996
{
39973997
size_tlen=strlen(value);

‎src/include/utils/guc.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Copyright (c) 2000-2008, PostgreSQL Global Development Group
88
* Written by Peter Eisentraut <peter_e@gmx.net>.
99
*
10-
* $PostgreSQL: pgsql/src/include/utils/guc.h,v 1.96 2008/05/28 09:04:06 mha Exp $
10+
* $PostgreSQL: pgsql/src/include/utils/guc.h,v 1.97 2008/06/30 22:10:43 momjian Exp $
1111
*--------------------------------------------------------------------
1212
*/
1313
#ifndefGUC_H
@@ -223,6 +223,7 @@ extern intNewGUCNestLevel(void);
223223
externvoidAtEOXact_GUC(boolisCommit,intnestLevel);
224224
externvoidBeginReportingGUCOptions(void);
225225
externvoidParseLongOption(constchar*string,char**name,char**value);
226+
externboolparse_bool(constchar*value,bool*result);
226227
externboolset_config_option(constchar*name,constchar*value,
227228
GucContextcontext,GucSourcesource,
228229
GucActionaction,boolchangeVal);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp