Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 2ecbb0a

Browse files
committed
Remove dependency to query text in JumbleQuery()
Since 3db72eb, the query ID of utilities is generated using the Query structure, making the use of the query string in JumbleQuery() unnecessary. This commit removes the argument "querytext" from JumbleQuery(). Reported-by: Joe Conway Reviewed-by: Nathan Bossart Discussion: https://postgr.es/m/ZJlQAWE4COFqHuAV@paquier.xyz
1 parent 876d17d commit 2ecbb0a

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/backend/commands/explain.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ ExplainQuery(ParseState *pstate, ExplainStmt *stmt,
255255

256256
query = castNode(Query, stmt->query);
257257
if (IsQueryIdEnabled())
258-
jstate = JumbleQuery(query, pstate->p_sourcetext);
258+
jstate = JumbleQuery(query);
259259

260260
if (post_parse_analyze_hook)
261261
(*post_parse_analyze_hook) (pstate, query, jstate);

src/backend/nodes/queryjumblefuncs.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ CleanQuerytext(const char *query, int *location, int *len)
9797
}
9898

9999
JumbleState *
100-
JumbleQuery(Query *query, const char *querytext)
100+
JumbleQuery(Query *query)
101101
{
102102
JumbleState *jstate = NULL;
103103

src/backend/parser/analyze.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ parse_analyze_fixedparams(RawStmt *parseTree, const char *sourceText,
124124
query = transformTopLevelStmt(pstate, parseTree);
125125

126126
if (IsQueryIdEnabled())
127-
jstate = JumbleQuery(query, sourceText);
127+
jstate = JumbleQuery(query);
128128

129129
if (post_parse_analyze_hook)
130130
(*post_parse_analyze_hook) (pstate, query, jstate);
@@ -166,7 +166,7 @@ parse_analyze_varparams(RawStmt *parseTree, const char *sourceText,
166166
check_variable_parameters(pstate, query);
167167

168168
if (IsQueryIdEnabled())
169-
jstate = JumbleQuery(query, sourceText);
169+
jstate = JumbleQuery(query);
170170

171171
if (post_parse_analyze_hook)
172172
(*post_parse_analyze_hook) (pstate, query, jstate);
@@ -203,7 +203,7 @@ parse_analyze_withcb(RawStmt *parseTree, const char *sourceText,
203203
query = transformTopLevelStmt(pstate, parseTree);
204204

205205
if (IsQueryIdEnabled())
206-
jstate = JumbleQuery(query, sourceText);
206+
jstate = JumbleQuery(query);
207207

208208
if (post_parse_analyze_hook)
209209
(*post_parse_analyze_hook) (pstate, query, jstate);

src/include/nodes/queryjumble.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ extern PGDLLIMPORT int compute_query_id;
6464

6565

6666
extern const char *CleanQuerytext(const char *query, int *location, int *len);
67-
extern JumbleState *JumbleQuery(Query *query, const char *querytext);
67+
extern JumbleState *JumbleQuery(Query *query);
6868
extern void EnableQueryId(void);
6969

7070
extern PGDLLIMPORT bool query_id_enabled;

0 commit comments

Comments
 (0)