From 40fda15dcebdd07ee75ac1f55dad145f91297b99 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 10 Sep 2007 00:57:22 +0000 Subject: Code review for GUC revert-values-if-removed-from-postgresql.conf patch; and in passing, fix some bogosities dating from the custom_variable_classes patch. Fix guc-file.l to correctly check changes in custom_variable_classes that are attempted concurrently with additions/removals of custom variables, and don't allow the new setting to be applied in advance of checking it. Clean up messy and undocumented situation for string variables with NULL boot_val. Fix DefineCustomVariable functions to initialize boot_val correctly. Prevent find_option from inserting bogus placeholders for custom variables that are simply inquired about rather than being set. --- src/backend/utils/cache/ts_cache.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/backend/utils/cache/ts_cache.c') diff --git a/src/backend/utils/cache/ts_cache.c b/src/backend/utils/cache/ts_cache.c index 94051b8c32f..63c57905565 100644 --- a/src/backend/utils/cache/ts_cache.c +++ b/src/backend/utils/cache/ts_cache.c @@ -20,7 +20,7 @@ * Copyright (c) 2006-2007, PostgreSQL Global Development Group * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/cache/ts_cache.c,v 1.2 2007/08/22 01:39:45 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/cache/ts_cache.c,v 1.3 2007/09/10 00:57:21 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -592,14 +592,6 @@ getTSCurrentConfig(bool emitError) const char * assignTSCurrentConfig(const char *newval, bool doit, GucSource source) { - /* do nothing during initial GUC setup */ - if (newval == NULL) - { - if (doit) - TSCurrentConfigCache = InvalidOid; - return newval; - } - /* * If we aren't inside a transaction, we cannot do database access so * cannot verify the config name. Must accept it on faith. @@ -637,7 +629,7 @@ assignTSCurrentConfig(const char *newval, bool doit, GucSource source) newval = strdup(buf); pfree(buf); - if (doit) + if (doit && newval) TSCurrentConfigCache = cfgId; } else -- cgit v1.2.3