Fix shadow variable in postgres.c

-Wshadow=compatible-local is added by default since 0fe954c, and this
warning was detected under -DWRITE_READ_PARSE_PLAN_TREES.

Reviewed-by: David Rowley
Discussion: https://postgr.es/m/Y0Ya5SH0QiaO9kKG@paquier.xyz
This commit is contained in:
Michael Paquier 2022-10-12 13:42:30 +09:00
parent a1176c67c4
commit 4574eb9d38

View File

@ -815,15 +815,15 @@ pg_rewrite_query(Query *query)
foreach(lc, querytree_list)
{
Query *query = lfirst_node(Query, lc);
char *str = nodeToString(query);
Query *curr_query = lfirst_node(Query, lc);
char *str = nodeToString(curr_query);
Query *new_query = stringToNodeWithLocations(str);
/*
* queryId is not saved in stored rules, but we must preserve it
* here to avoid breaking pg_stat_statements.
*/
new_query->queryId = query->queryId;
new_query->queryId = curr_query->queryId;
new_list = lappend(new_list, new_query);
pfree(str);