mirror of
https://github.com/postgres/postgres.git
synced 2026-04-22 14:47:29 -04:00
This commit changes the post_parse_analyze_hook_type() hook to take a const JumbleState, to tell external modules that they are not allowed to touch the JumbleState that has been compiled by the core code. This fixes a pretty old problem with pg_stat_statements, that had always the idea of modifying the lengths of the constants stored in the JumbleState. The previous state could confuse extensions that need to look at a JumbleState depending on the loading order, if pg_stat_statements is part of the stack loaded. Another piece included in this commit is the move of the routine fill_in_constant_lengths() to queryjumblefuncs.c, to give an option to extensions to compile the lengths of the constants, if necessary. I was surprised by the number of external code that carries a copy of this routine (see the thread for details). Previously, this routine modified JumbleState. It now copies the set of LocationLens from JumbleState, and fills the constant lengths for separate use. pg_stat_statements is updated to use the new ComputeConstantLengths(). JumbleState is now marked with a const in the module, where relevant. Author: Sami Imseih <samimseih@gmail.com> Co-authored-by: Lukas Fittl <lukas@fittl.com> Discussion: https://postgr.es/m/CAA5RZ0tZp5qU0ikZEEqJnxvdSNGh1DWv80sb-k4QAUmiMoOp_Q@mail.gmail.com |
||
|---|---|---|
| .. | ||
| expected | ||
| sql | ||
| t | ||
| .gitignore | ||
| Makefile | ||
| meson.build | ||
| pg_stat_statements--1.0--1.1.sql | ||
| pg_stat_statements--1.1--1.2.sql | ||
| pg_stat_statements--1.2--1.3.sql | ||
| pg_stat_statements--1.3--1.4.sql | ||
| pg_stat_statements--1.4--1.5.sql | ||
| pg_stat_statements--1.4.sql | ||
| pg_stat_statements--1.5--1.6.sql | ||
| pg_stat_statements--1.6--1.7.sql | ||
| pg_stat_statements--1.7--1.8.sql | ||
| pg_stat_statements--1.8--1.9.sql | ||
| pg_stat_statements--1.9--1.10.sql | ||
| pg_stat_statements--1.10--1.11.sql | ||
| pg_stat_statements--1.11--1.12.sql | ||
| pg_stat_statements--1.12--1.13.sql | ||
| pg_stat_statements.c | ||
| pg_stat_statements.conf | ||
| pg_stat_statements.control | ||