Commit 35c129ca authored by Tom Lane's avatar Tom Lane

Fix define_custom_variable to preserve any sourcefile/sourceline information

present in the placeholder.  Noted while testing pg_stat_statements.
parent c63b9b1d
...@@ -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
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.488 2009/01/03 20:03:08 tgl Exp $ * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.489 2009/01/05 13:23:33 tgl Exp $
* *
*-------------------------------------------------------------------- *--------------------------------------------------------------------
*/ */
...@@ -5747,9 +5747,17 @@ define_custom_variable(struct config_generic * variable) ...@@ -5747,9 +5747,17 @@ define_custom_variable(struct config_generic * variable)
value = *pHolder->variable; value = *pHolder->variable;
if (value) if (value)
set_config_option(name, value, {
phcontext, pHolder->gen.source, if (set_config_option(name, value,
GUC_ACTION_SET, true); phcontext, pHolder->gen.source,
GUC_ACTION_SET, true))
{
/* Also copy over any saved source-location information */
if (pHolder->gen.sourcefile)
set_config_sourcefile(name, pHolder->gen.sourcefile,
pHolder->gen.sourceline);
}
}
/* /*
* Free up as much as we conveniently can of the placeholder structure * Free up as much as we conveniently can of the placeholder structure
......
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