Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pg_qualstats.c
Original file line number Diff line number Diff line change
Expand Up @@ -2395,7 +2395,7 @@ pgqs_resolve_var(Var *var, pgqsWalkerContext *context)
* This function can recurse, so this can prevent infinite loop in case of
* any problem.
*/
CHECK_FOR_INTERRUPTS();
check_stack_depth();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the comment is probably poorly worded. The idea here wasn't to automatically raise an error in case of a too deep recursion but being able to cancel the query if this ends up recursing too much and/or infinitely.

We don't have a infinite recursion problem (at least there wasn't any such report and the this code hasn't change in years) so I would be more worried about not being able to cancel a query that has a lot of complex expressions.

Now if there were an infinite recursion then it would likely end up crashing, and crashing fast, so I'm not opposed to adding a stack depth check, but on top of the CFI, not instead of it.


#if PG_VERSION_NUM >= 140000
/* ROWID_VAR is only used during planning, so we shouldn't see it. */
Expand Down