diff options
Diffstat (limited to 'src/backend/utils/misc/guc.c')
-rw-r--r-- | src/backend/utils/misc/guc.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 39d3775e801..d6cd009f239 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -1473,7 +1473,9 @@ check_GUC_init(struct config_generic *gconf) { struct config_string *conf = (struct config_string *) gconf; - if (*conf->variable != NULL && strcmp(*conf->variable, conf->boot_val) != 0) + if (*conf->variable != NULL && + (conf->boot_val == NULL || + strcmp(*conf->variable, conf->boot_val) != 0)) { elog(LOG, "GUC (PGC_STRING) %s, boot_val=%s, C-var=%s", conf->gen.name, conf->boot_val ? conf->boot_val : "<null>", *conf->variable); @@ -5255,7 +5257,14 @@ get_explain_guc_options(int *num) { struct config_string *lconf = (struct config_string *) conf; - modified = (strcmp(lconf->boot_val, *(lconf->variable)) != 0); + if (lconf->boot_val == NULL && + *lconf->variable == NULL) + modified = false; + else if (lconf->boot_val == NULL || + *lconf->variable == NULL) + modified = true; + else + modified = (strcmp(lconf->boot_val, *(lconf->variable)) != 0); } break; @@ -5482,7 +5491,8 @@ write_one_nondefault_variable(FILE *fp, struct config_generic *gconf) { struct config_string *conf = (struct config_string *) gconf; - fprintf(fp, "%s", *conf->variable); + if (*conf->variable) + fprintf(fp, "%s", *conf->variable); } break; |