postgresql/src/include/parser
Tom Lane eb213acfe2 Prevent duplicate escape-string warnings when using pg_stat_statements.
contrib/pg_stat_statements will sometimes run the core lexer a second time
on submitted statements.  Formerly, if you had standard_conforming_strings
turned off, this led to sometimes getting two copies of any warnings
enabled by escape_string_warning.  While this is probably no longer a big
deal in the field, it's a pain for regression testing.

To fix, change the lexer so it doesn't consult the escape_string_warning
GUC variable directly, but looks at a copy in the core_yy_extra_type state
struct.  Then, pg_stat_statements can change that copy to disable warnings
while it's redoing the lexing.

It seemed like a good idea to make this happen for all three of the GUCs
consulted by the lexer, not just escape_string_warning.  There's not an
immediate use-case for callers to adjust the other two AFAIK, but making
it possible is easy enough and seems like good future-proofing.

Arguably this is a bug fix, but there doesn't seem to be enough interest to
justify a back-patch.  We'd not be able to back-patch exactly as-is anyway,
for fear of breaking ABI compatibility of the struct.  (We could perhaps
back-patch the addition of only escape_string_warning by adding it at the
end of the struct, where there's currently alignment padding space.)
2015-01-22 18:11:00 -05:00
..
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
analyze.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
gramparse.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
keywords.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
kwlist.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
parse_agg.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
parse_clause.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
parse_coerce.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
parse_collate.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
parse_cte.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
parse_expr.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
parse_func.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
parse_node.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
parse_oper.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
parse_param.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
parse_relation.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
parse_target.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
parse_type.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
parse_utilcmd.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
parser.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
parsetree.h Update copyright for 2015 2015-01-06 11:43:47 -05:00
scanner.h Prevent duplicate escape-string warnings when using pg_stat_statements. 2015-01-22 18:11:00 -05:00
scansup.h Update copyright for 2015 2015-01-06 11:43:47 -05:00