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
This commit is contained in:
parent
876d17d62f
commit
2ecbb0a493
@ -255,7 +255,7 @@ ExplainQuery(ParseState *pstate, ExplainStmt *stmt,
|
|||||||
|
|
||||||
query = castNode(Query, stmt->query);
|
query = castNode(Query, stmt->query);
|
||||||
if (IsQueryIdEnabled())
|
if (IsQueryIdEnabled())
|
||||||
jstate = JumbleQuery(query, pstate->p_sourcetext);
|
jstate = JumbleQuery(query);
|
||||||
|
|
||||||
if (post_parse_analyze_hook)
|
if (post_parse_analyze_hook)
|
||||||
(*post_parse_analyze_hook) (pstate, query, jstate);
|
(*post_parse_analyze_hook) (pstate, query, jstate);
|
||||||
|
@ -97,7 +97,7 @@ CleanQuerytext(const char *query, int *location, int *len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
JumbleState *
|
JumbleState *
|
||||||
JumbleQuery(Query *query, const char *querytext)
|
JumbleQuery(Query *query)
|
||||||
{
|
{
|
||||||
JumbleState *jstate = NULL;
|
JumbleState *jstate = NULL;
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ parse_analyze_fixedparams(RawStmt *parseTree, const char *sourceText,
|
|||||||
query = transformTopLevelStmt(pstate, parseTree);
|
query = transformTopLevelStmt(pstate, parseTree);
|
||||||
|
|
||||||
if (IsQueryIdEnabled())
|
if (IsQueryIdEnabled())
|
||||||
jstate = JumbleQuery(query, sourceText);
|
jstate = JumbleQuery(query);
|
||||||
|
|
||||||
if (post_parse_analyze_hook)
|
if (post_parse_analyze_hook)
|
||||||
(*post_parse_analyze_hook) (pstate, query, jstate);
|
(*post_parse_analyze_hook) (pstate, query, jstate);
|
||||||
@ -166,7 +166,7 @@ parse_analyze_varparams(RawStmt *parseTree, const char *sourceText,
|
|||||||
check_variable_parameters(pstate, query);
|
check_variable_parameters(pstate, query);
|
||||||
|
|
||||||
if (IsQueryIdEnabled())
|
if (IsQueryIdEnabled())
|
||||||
jstate = JumbleQuery(query, sourceText);
|
jstate = JumbleQuery(query);
|
||||||
|
|
||||||
if (post_parse_analyze_hook)
|
if (post_parse_analyze_hook)
|
||||||
(*post_parse_analyze_hook) (pstate, query, jstate);
|
(*post_parse_analyze_hook) (pstate, query, jstate);
|
||||||
@ -203,7 +203,7 @@ parse_analyze_withcb(RawStmt *parseTree, const char *sourceText,
|
|||||||
query = transformTopLevelStmt(pstate, parseTree);
|
query = transformTopLevelStmt(pstate, parseTree);
|
||||||
|
|
||||||
if (IsQueryIdEnabled())
|
if (IsQueryIdEnabled())
|
||||||
jstate = JumbleQuery(query, sourceText);
|
jstate = JumbleQuery(query);
|
||||||
|
|
||||||
if (post_parse_analyze_hook)
|
if (post_parse_analyze_hook)
|
||||||
(*post_parse_analyze_hook) (pstate, query, jstate);
|
(*post_parse_analyze_hook) (pstate, query, jstate);
|
||||||
|
@ -64,7 +64,7 @@ extern PGDLLIMPORT int compute_query_id;
|
|||||||
|
|
||||||
|
|
||||||
extern const char *CleanQuerytext(const char *query, int *location, int *len);
|
extern const char *CleanQuerytext(const char *query, int *location, int *len);
|
||||||
extern JumbleState *JumbleQuery(Query *query, const char *querytext);
|
extern JumbleState *JumbleQuery(Query *query);
|
||||||
extern void EnableQueryId(void);
|
extern void EnableQueryId(void);
|
||||||
|
|
||||||
extern PGDLLIMPORT bool query_id_enabled;
|
extern PGDLLIMPORT bool query_id_enabled;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user