|
10 | 10 | * Written by Peter Eisentraut <peter_e@gmx.net>. |
11 | 11 | * |
12 | 12 | * IDENTIFICATION |
13 | | - * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.335 2006/08/11 20:15:16 momjian Exp $ |
| 13 | + * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.336 2006/08/12 04:11:50 momjian Exp $ |
14 | 14 | * |
15 | 15 | *-------------------------------------------------------------------- |
16 | 16 | */ |
@@ -2694,39 +2694,39 @@ InitializeGUCOptions(void) |
2694 | 2694 | structconfig_bool*conf= (structconfig_bool*)gconf; |
2695 | 2695 |
|
2696 | 2696 | if (conf->assign_hook) |
2697 | | -if (!(*conf->assign_hook) (conf->boot_val, true, |
| 2697 | +if (!(*conf->assign_hook) (conf->reset_val, true, |
2698 | 2698 | PGC_S_DEFAULT)) |
2699 | 2699 | elog(FATAL,"failed to initialize %s to %d", |
2700 | | -conf->gen.name, (int)conf->boot_val); |
2701 | | -*conf->variable=conf->reset_val=conf->boot_val; |
| 2700 | +conf->gen.name, (int)conf->reset_val); |
| 2701 | +*conf->variable=conf->reset_val; |
2702 | 2702 | break; |
2703 | 2703 | } |
2704 | 2704 | casePGC_INT: |
2705 | 2705 | { |
2706 | 2706 | structconfig_int*conf= (structconfig_int*)gconf; |
2707 | 2707 |
|
2708 | | -Assert(conf->boot_val >=conf->min); |
2709 | | -Assert(conf->boot_val <=conf->max); |
| 2708 | +Assert(conf->reset_val >=conf->min); |
| 2709 | +Assert(conf->reset_val <=conf->max); |
2710 | 2710 | if (conf->assign_hook) |
2711 | | -if (!(*conf->assign_hook) (conf->boot_val, true, |
| 2711 | +if (!(*conf->assign_hook) (conf->reset_val, true, |
2712 | 2712 | PGC_S_DEFAULT)) |
2713 | 2713 | elog(FATAL,"failed to initialize %s to %d", |
2714 | | -conf->gen.name,conf->boot_val); |
2715 | | -*conf->variable=conf->reset_val=conf->boot_val; |
| 2714 | +conf->gen.name,conf->reset_val); |
| 2715 | +*conf->variable=conf->reset_val; |
2716 | 2716 | break; |
2717 | 2717 | } |
2718 | 2718 | casePGC_REAL: |
2719 | 2719 | { |
2720 | 2720 | structconfig_real*conf= (structconfig_real*)gconf; |
2721 | 2721 |
|
2722 | | -Assert(conf->boot_val >=conf->min); |
2723 | | -Assert(conf->boot_val <=conf->max); |
| 2722 | +Assert(conf->reset_val >=conf->min); |
| 2723 | +Assert(conf->reset_val <=conf->max); |
2724 | 2724 | if (conf->assign_hook) |
2725 | | -if (!(*conf->assign_hook) (conf->boot_val, true, |
| 2725 | +if (!(*conf->assign_hook) (conf->reset_val, true, |
2726 | 2726 | PGC_S_DEFAULT)) |
2727 | 2727 | elog(FATAL,"failed to initialize %s to %g", |
2728 | | -conf->gen.name,conf->boot_val); |
2729 | | -*conf->variable=conf->reset_val=conf->boot_val; |
| 2728 | +conf->gen.name,conf->reset_val); |
| 2729 | +*conf->variable=conf->reset_val; |
2730 | 2730 | break; |
2731 | 2731 | } |
2732 | 2732 | casePGC_STRING: |
@@ -3179,7 +3179,7 @@ AtEOXact_GUC(bool isCommit, bool isSubXact) |
3179 | 3179 | for (i=0;i<num_guc_variables;i++) |
3180 | 3180 | { |
3181 | 3181 | structconfig_generic*gconf=guc_variables[i]; |
3182 | | -intmy_status=gconf->status& (~GUC_IN_CONFFILE); |
| 3182 | +intmy_status=gconf->status; |
3183 | 3183 | GucStack*stack=gconf->stack; |
3184 | 3184 | booluseTentative; |
3185 | 3185 | boolchanged; |
@@ -3726,19 +3726,8 @@ parse_value(int elevel, const struct config_generic *record, |
3726 | 3726 | } |
3727 | 3727 | else |
3728 | 3728 | { |
3729 | | -/* Revert value to default if source is configuration file. It is used when |
3730 | | - * configuration parameter is removed/commented out in the config file. Else |
3731 | | - * RESET or SET TO DEFAULT command is called and reset_val is used. |
3732 | | - */ |
3733 | | -if(*source==PGC_S_FILE ) |
3734 | | -{ |
3735 | | -newval=conf->boot_val; |
3736 | | -} |
3737 | | -else |
3738 | | -{ |
3739 | | -newval=conf->reset_val; |
3740 | | -*source=conf->gen.reset_source; |
3741 | | -} |
| 3729 | +newval=conf->reset_val; |
| 3730 | +*source=conf->gen.reset_source; |
3742 | 3731 | } |
3743 | 3732 |
|
3744 | 3733 | if (conf->assign_hook) |
@@ -3781,19 +3770,8 @@ parse_value(int elevel, const struct config_generic *record, |
3781 | 3770 | } |
3782 | 3771 | else |
3783 | 3772 | { |
3784 | | -/* Revert value to default if source is configuration file. It is used when |
3785 | | - * configuration parameter is removed/commented out in the config file. Else |
3786 | | - * RESET or SET TO DEFAULT command is called and reset_val is used. |
3787 | | - */ |
3788 | | -if(*source==PGC_S_FILE ) |
3789 | | -{ |
3790 | | -newval=conf->boot_val; |
3791 | | -} |
3792 | | -else |
3793 | | -{ |
3794 | | -newval=conf->reset_val; |
3795 | | -*source=conf->gen.reset_source; |
3796 | | -} |
| 3773 | +newval=conf->reset_val; |
| 3774 | +*source=conf->gen.reset_source; |
3797 | 3775 | } |
3798 | 3776 |
|
3799 | 3777 | if (conf->assign_hook) |
@@ -3836,19 +3814,8 @@ parse_value(int elevel, const struct config_generic *record, |
3836 | 3814 | } |
3837 | 3815 | else |
3838 | 3816 | { |
3839 | | -/* Revert value to default if source is configuration file. It is used when |
3840 | | - * configuration parameter is removed/commented out in the config file. Else |
3841 | | - * RESET or SET TO DEFAULT command is called and reset_val is used. |
3842 | | - */ |
3843 | | -if(*source==PGC_S_FILE ) |
3844 | | -{ |
3845 | | -newval=conf->boot_val; |
3846 | | -} |
3847 | | -else |
3848 | | -{ |
3849 | | -newval=conf->reset_val; |
3850 | | -*source=conf->gen.reset_source; |
3851 | | -} |
| 3817 | +newval=conf->reset_val; |
| 3818 | +*source=conf->gen.reset_source; |
3852 | 3819 | } |
3853 | 3820 |
|
3854 | 3821 | if (conf->assign_hook) |
@@ -3882,20 +3849,6 @@ parse_value(int elevel, const struct config_generic *record, |
3882 | 3849 | if (conf->gen.flags&GUC_IS_NAME) |
3883 | 3850 | truncate_identifier(newval,strlen(newval), true); |
3884 | 3851 | } |
3885 | | -elseif (*source==PGC_S_FILE) |
3886 | | -{ |
3887 | | -/* Revert value to default when item is removed from config file. */ |
3888 | | -if (conf->boot_val!=NULL ) |
3889 | | -{ |
3890 | | -newval=guc_strdup(elevel,conf->boot_val); |
3891 | | -if (newval==NULL) |
3892 | | -return false; |
3893 | | -} |
3894 | | -else |
3895 | | -{ |
3896 | | -return false; |
3897 | | -} |
3898 | | -} |
3899 | 3852 | elseif (conf->reset_val) |
3900 | 3853 | { |
3901 | 3854 | /* |
@@ -4100,11 +4053,6 @@ verify_config_option(const char *name, const char *value, |
4100 | 4053 |
|
4101 | 4054 | if(parse_value(elevel,record,value,&source, false,&newval) ) |
4102 | 4055 | { |
4103 | | -/* Mark record like presented in the config file. Be carefull if |
4104 | | - * you use this function for another purpose than config file |
4105 | | - * verification. It causes confusion configfile parser. */ |
4106 | | -record->status |=GUC_IN_CONFFILE; |
4107 | | - |
4108 | 4056 | if(isNewEqual!=NULL) |
4109 | 4057 | *isNewEqual=is_newvalue_equal(record,value); |
4110 | 4058 | if(isContextOK!=NULL) |
@@ -4167,7 +4115,7 @@ set_config_option(const char *name, const char *value, |
4167 | 4115 | * Should we set reset/stacked values?(If so, the behavior is not |
4168 | 4116 | * transactional.) |
4169 | 4117 | */ |
4170 | | -makeDefault=changeVal&& (source <=PGC_S_OVERRIDE)&& (value!=NULL||source==PGC_S_FILE); |
| 4118 | +makeDefault=changeVal&& (source <=PGC_S_OVERRIDE)&& (value!=NULL); |
4171 | 4119 |
|
4172 | 4120 | /* |
4173 | 4121 | * Ignore attempted set if overridden by previously processed setting. |
|