mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
Update query_id computation
Properly fix: - the "ONLY" in FROM [ONLY] isn't hashed - the agglevelsup field in GROUPING isn't hashed - WITH TIES not being hashed (new in PG 13) - "DISTINCT" in "GROUP BY [DISTINCT]" isn't hashed (new in PG 14) Reported-by: Julien Rouhaud Discussion: https://postgr.es/m/20210425081119.ulyzxqz23ueh3wuj@nol
This commit is contained in:
@ -230,6 +230,7 @@ JumbleQueryInternal(JumbleState *jstate, Query *query)
|
||||
JumbleExpr(jstate, (Node *) query->onConflict);
|
||||
JumbleExpr(jstate, (Node *) query->returningList);
|
||||
JumbleExpr(jstate, (Node *) query->groupClause);
|
||||
APP_JUMB(query->groupDistinct);
|
||||
JumbleExpr(jstate, (Node *) query->groupingSets);
|
||||
JumbleExpr(jstate, query->havingQual);
|
||||
JumbleExpr(jstate, (Node *) query->windowClause);
|
||||
@ -237,6 +238,7 @@ JumbleQueryInternal(JumbleState *jstate, Query *query)
|
||||
JumbleExpr(jstate, (Node *) query->sortClause);
|
||||
JumbleExpr(jstate, query->limitOffset);
|
||||
JumbleExpr(jstate, query->limitCount);
|
||||
APP_JUMB(query->limitOption);
|
||||
JumbleRowMarks(jstate, query->rowMarks);
|
||||
JumbleExpr(jstate, query->setOperations);
|
||||
}
|
||||
@ -259,6 +261,7 @@ JumbleRangeTable(JumbleState *jstate, List *rtable)
|
||||
case RTE_RELATION:
|
||||
APP_JUMB(rte->relid);
|
||||
JumbleExpr(jstate, (Node *) rte->tablesample);
|
||||
APP_JUMB(rte->inh);
|
||||
break;
|
||||
case RTE_SUBQUERY:
|
||||
JumbleQueryInternal(jstate, rte->subquery);
|
||||
@ -399,6 +402,7 @@ JumbleExpr(JumbleState *jstate, Node *node)
|
||||
GroupingFunc *grpnode = (GroupingFunc *) node;
|
||||
|
||||
JumbleExpr(jstate, (Node *) grpnode->refs);
|
||||
APP_JUMB(grpnode->agglevelsup);
|
||||
}
|
||||
break;
|
||||
case T_WindowFunc:
|
||||
|
Reference in New Issue
Block a user