Commit 11c2f190 authored by Bruce Momjian's avatar Bruce Momjian

Rename DoIt to changeVar, for clarity.

parent defc7a97
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>. * Written by Peter Eisentraut <peter_e@gmx.net>.
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.151 2003/08/26 15:38:25 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.152 2003/09/01 04:15:50 momjian Exp $
* *
*-------------------------------------------------------------------- *--------------------------------------------------------------------
*/ */
...@@ -2373,7 +2373,7 @@ parse_real(const char *value, double *result) ...@@ -2373,7 +2373,7 @@ parse_real(const char *value, double *result)
* properly. * properly.
* *
* If value is NULL, set the option to its default value. If the * If value is NULL, set the option to its default value. If the
* parameter DoIt is false then don't really set the option but do all * parameter changeVal is false then don't really set the option but do all
* the checks to see if it would work. * the checks to see if it would work.
* *
* If there is an error (non-existing option, invalid value) then an * If there is an error (non-existing option, invalid value) then an
...@@ -2390,13 +2390,13 @@ parse_real(const char *value, double *result) ...@@ -2390,13 +2390,13 @@ parse_real(const char *value, double *result)
bool bool
set_config_option(const char *name, const char *value, set_config_option(const char *name, const char *value,
GucContext context, GucSource source, GucContext context, GucSource source,
bool isLocal, bool DoIt) bool isLocal, bool changeVal)
{ {
struct config_generic *record; struct config_generic *record;
int elevel; int elevel;
bool interactive; bool interactive;
bool makeDefault; bool makeDefault;
bool DoIt_orig; bool changeVal_orig;
if (context == PGC_SIGHUP || source == PGC_S_DEFAULT) if (context == PGC_SIGHUP || source == PGC_S_DEFAULT)
elevel = DEBUG2; elevel = DEBUG2;
...@@ -2511,26 +2511,26 @@ set_config_option(const char *name, const char *value, ...@@ -2511,26 +2511,26 @@ set_config_option(const char *name, const char *value,
* Should we set reset/session values? (If so, the behavior is not * Should we set reset/session values? (If so, the behavior is not
* transactional.) * transactional.)
*/ */
makeDefault = DoIt && (source <= PGC_S_OVERRIDE) && (value != NULL); makeDefault = changeVal && (source <= PGC_S_OVERRIDE) && (value != NULL);
/* /*
* Ignore attempted set if overridden by previously processed setting. * Ignore attempted set if overridden by previously processed setting.
* However, if DoIt is false then plow ahead anyway since we are * However, if changeVal is false then plow ahead anyway since we are
* trying to find out if the value is potentially good, not actually * trying to find out if the value is potentially good, not actually
* use it. Also keep going if makeDefault is true, since we may want * use it. Also keep going if makeDefault is true, since we may want
* to set the reset/session values even if we can't set the variable * to set the reset/session values even if we can't set the variable
* itself. * itself.
*/ */
DoIt_orig = DoIt; /* we might have to reverse this later */ changeVal_orig = changeVal; /* we might have to reverse this later */
if (record->source > source) if (record->source > source)
{ {
if (DoIt && !makeDefault) if (changeVal && !makeDefault)
{ {
elog(DEBUG3, "\"%s\": setting ignored because previous source is higher priority", elog(DEBUG3, "\"%s\": setting ignored because previous source is higher priority",
name); name);
return true; return true;
} }
DoIt = false; /* we won't change the variable itself */ changeVal = false; /* we won't change the variable itself */
} }
/* /*
...@@ -2572,7 +2572,7 @@ set_config_option(const char *name, const char *value, ...@@ -2572,7 +2572,7 @@ set_config_option(const char *name, const char *value,
record->session_source > PGC_S_UNPRIVILEGED && record->session_source > PGC_S_UNPRIVILEGED &&
newval > conf->session_val && newval > conf->session_val &&
!superuser()) !superuser())
DoIt = DoIt_orig; changeVal = changeVal_orig;
} }
else else
{ {
...@@ -2581,7 +2581,7 @@ set_config_option(const char *name, const char *value, ...@@ -2581,7 +2581,7 @@ set_config_option(const char *name, const char *value,
} }
if (conf->assign_hook) if (conf->assign_hook)
if (!(*conf->assign_hook) (newval, DoIt, interactive)) if (!(*conf->assign_hook) (newval, changeVal, interactive))
{ {
ereport(elevel, ereport(elevel,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
...@@ -2590,9 +2590,9 @@ set_config_option(const char *name, const char *value, ...@@ -2590,9 +2590,9 @@ set_config_option(const char *name, const char *value,
return false; return false;
} }
if (DoIt || makeDefault) if (changeVal || makeDefault)
{ {
if (DoIt) if (changeVal)
{ {
*conf->variable = newval; *conf->variable = newval;
conf->gen.source = source; conf->gen.source = source;
...@@ -2669,7 +2669,7 @@ set_config_option(const char *name, const char *value, ...@@ -2669,7 +2669,7 @@ set_config_option(const char *name, const char *value,
record->session_source > PGC_S_UNPRIVILEGED && record->session_source > PGC_S_UNPRIVILEGED &&
newval < conf->session_val && newval < conf->session_val &&
!superuser()) !superuser())
DoIt = DoIt_orig; changeVal = changeVal_orig;
} }
else else
{ {
...@@ -2678,7 +2678,7 @@ set_config_option(const char *name, const char *value, ...@@ -2678,7 +2678,7 @@ set_config_option(const char *name, const char *value,
} }
if (conf->assign_hook) if (conf->assign_hook)
if (!(*conf->assign_hook) (newval, DoIt, interactive)) if (!(*conf->assign_hook) (newval, changeVal, interactive))
{ {
ereport(elevel, ereport(elevel,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
...@@ -2687,9 +2687,9 @@ set_config_option(const char *name, const char *value, ...@@ -2687,9 +2687,9 @@ set_config_option(const char *name, const char *value,
return false; return false;
} }
if (DoIt || makeDefault) if (changeVal || makeDefault)
{ {
if (DoIt) if (changeVal)
{ {
*conf->variable = newval; *conf->variable = newval;
conf->gen.source = source; conf->gen.source = source;
...@@ -2765,7 +2765,7 @@ set_config_option(const char *name, const char *value, ...@@ -2765,7 +2765,7 @@ set_config_option(const char *name, const char *value,
record->session_source > PGC_S_UNPRIVILEGED && record->session_source > PGC_S_UNPRIVILEGED &&
newval < conf->session_val && newval < conf->session_val &&
!superuser()) !superuser())
DoIt = DoIt_orig; changeVal = changeVal_orig;
} }
else else
{ {
...@@ -2774,7 +2774,7 @@ set_config_option(const char *name, const char *value, ...@@ -2774,7 +2774,7 @@ set_config_option(const char *name, const char *value,
} }
if (conf->assign_hook) if (conf->assign_hook)
if (!(*conf->assign_hook) (newval, DoIt, interactive)) if (!(*conf->assign_hook) (newval, changeVal, interactive))
{ {
ereport(elevel, ereport(elevel,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
...@@ -2783,9 +2783,9 @@ set_config_option(const char *name, const char *value, ...@@ -2783,9 +2783,9 @@ set_config_option(const char *name, const char *value,
return false; return false;
} }
if (DoIt || makeDefault) if (changeVal || makeDefault)
{ {
if (DoIt) if (changeVal)
{ {
*conf->variable = newval; *conf->variable = newval;
conf->gen.source = source; conf->gen.source = source;
...@@ -2863,7 +2863,7 @@ set_config_option(const char *name, const char *value, ...@@ -2863,7 +2863,7 @@ set_config_option(const char *name, const char *value,
record->session_source > PGC_S_UNPRIVILEGED && record->session_source > PGC_S_UNPRIVILEGED &&
newval < conf->session_val && newval < conf->session_val &&
!superuser()) !superuser())
DoIt = DoIt_orig; changeVal = changeVal_orig;
} }
} }
else if (conf->reset_val) else if (conf->reset_val)
...@@ -2902,7 +2902,7 @@ set_config_option(const char *name, const char *value, ...@@ -2902,7 +2902,7 @@ set_config_option(const char *name, const char *value,
const char *hookresult; const char *hookresult;
hookresult = (*conf->assign_hook) (newval, hookresult = (*conf->assign_hook) (newval,
DoIt, interactive); changeVal, interactive);
guc_string_workspace = NULL; guc_string_workspace = NULL;
if (hookresult == NULL) if (hookresult == NULL)
{ {
...@@ -2932,9 +2932,9 @@ set_config_option(const char *name, const char *value, ...@@ -2932,9 +2932,9 @@ set_config_option(const char *name, const char *value,
guc_string_workspace = NULL; guc_string_workspace = NULL;
if (DoIt || makeDefault) if (changeVal || makeDefault)
{ {
if (DoIt) if (changeVal)
{ {
SET_STRING_VARIABLE(conf, newval); SET_STRING_VARIABLE(conf, newval);
conf->gen.source = source; conf->gen.source = source;
...@@ -2976,7 +2976,7 @@ set_config_option(const char *name, const char *value, ...@@ -2976,7 +2976,7 @@ set_config_option(const char *name, const char *value,
} }
} }
if (DoIt && (record->flags & GUC_REPORT)) if (changeVal && (record->flags & GUC_REPORT))
ReportGUCOption(record); ReportGUCOption(record);
return true; return true;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Copyright (c) 2000-2003, PostgreSQL Global Development Group * Copyright (c) 2000-2003, PostgreSQL Global Development Group
* Written by Peter Eisentraut <peter_e@gmx.net>. * Written by Peter Eisentraut <peter_e@gmx.net>.
* *
* $Id: guc.h,v 1.40 2003/08/04 23:59:41 tgl Exp $ * $Id: guc.h,v 1.41 2003/09/01 04:15:51 momjian Exp $
*-------------------------------------------------------------------- *--------------------------------------------------------------------
*/ */
#ifndef GUC_H #ifndef GUC_H
...@@ -127,7 +127,7 @@ extern void BeginReportingGUCOptions(void); ...@@ -127,7 +127,7 @@ extern void BeginReportingGUCOptions(void);
extern void ParseLongOption(const char *string, char **name, char **value); extern void ParseLongOption(const char *string, char **name, char **value);
extern bool set_config_option(const char *name, const char *value, extern bool set_config_option(const char *name, const char *value,
GucContext context, GucSource source, GucContext context, GucSource source,
bool isLocal, bool DoIt); bool isLocal, bool changeVal);
extern void ShowGUCConfigOption(const char *name, DestReceiver *dest); extern void ShowGUCConfigOption(const char *name, DestReceiver *dest);
extern void ShowAllGUCConfig(DestReceiver *dest); extern void ShowAllGUCConfig(DestReceiver *dest);
extern char *GetConfigOptionByName(const char *name, const char **varname); extern char *GetConfigOptionByName(const char *name, const char **varname);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment