]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Check for stack overflow when rewriting graph queries
authorPeter Eisentraut <peter@eisentraut.org>
Fri, 24 Apr 2026 06:18:21 +0000 (08:18 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Fri, 24 Apr 2026 06:18:21 +0000 (08:18 +0200)
commit2ff289d03939498a656a0c6cf2da08623f8357b4
tree1b61942f7bb34fce5e584307c9742c8ae5b6f157
parent863c4b827d92879dbd526a43a23c33fa9bd23b4f
Check for stack overflow when rewriting graph queries

generate_queries_for_path_pattern_recurse() and
generate_setop_from_pathqueries() are recursive functions.  For a
property graph with hundreds of tables, a graph pattern with a handful
element patterns can cause stack overflow.  Fix it by calling
check_stack_depth() at the beginning of these functions.

Author: Satyanarayana Narlapuram <satyanarlapuram@gmail.com>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Discussion: https://www.postgresql.org/message-id/CAHg+QDfgK0xddH8f3eAb+UVn7sBDOnv8RvM6OkP4HtHAt6aD7w@mail.gmail.com
src/backend/rewrite/rewriteGraphTable.c