Skip to content

Commit 35c129c

Browse files
committed
Fix define_custom_variable to preserve any sourcefile/sourceline information
present in the placeholder. Noted while testing pg_stat_statements.
1 parent c63b9b1 commit 35c129c

File tree

1 file changed

+12
-4
lines changed
  • src/backend/utils/misc

1 file changed

+12
-4
lines changed

src/backend/utils/misc/guc.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Written by Peter Eisentraut <peter_e@gmx.net>.
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.488 2009/01/03 20:03:08 tgl Exp $
13+
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.489 2009/01/05 13:23:33 tgl Exp $
1414
*
1515
*--------------------------------------------------------------------
1616
*/
@@ -5747,9 +5747,17 @@ define_custom_variable(struct config_generic * variable)
57475747
value = *pHolder->variable;
57485748

57495749
if (value)
5750-
set_config_option(name, value,
5751-
phcontext, pHolder->gen.source,
5752-
GUC_ACTION_SET, true);
5750+
{
5751+
if (set_config_option(name, value,
5752+
phcontext, pHolder->gen.source,
5753+
GUC_ACTION_SET, true))
5754+
{
5755+
/* Also copy over any saved source-location information */
5756+
if (pHolder->gen.sourcefile)
5757+
set_config_sourcefile(name, pHolder->gen.sourcefile,
5758+
pHolder->gen.sourceline);
5759+
}
5760+
}
57535761

57545762
/*
57555763
* Free up as much as we conveniently can of the placeholder structure

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy