From c741f7f0959978bd6c8731e38fd07d7dd3e112d9 Mon Sep 17 00:00:00 2001 From: Sven Klemm Date: Tue, 8 Oct 2024 22:48:51 +0200 Subject: [PATCH] Treat RETURN NEXT and RETURN QUERY not as end of path --- src/pgspot/path.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/pgspot/path.py b/src/pgspot/path.py index b14cd80..1cc689f 100644 --- a/src/pgspot/path.py +++ b/src/pgspot/path.py @@ -84,25 +84,18 @@ def dfs(node, path, pathes): | "PLpgSQL_stmt_open" | "PLpgSQL_stmt_perform" | "PLpgSQL_stmt_raise" + | "PLpgSQL_stmt_return_next" + | "PLpgSQL_stmt_return_query" | "PLpgSQL_stmt_rollback" ): path.steps.append(node) # nodes not yet implemented - case ( - "PLpgSQL_stmt_case" - | "PLpgSQL_stmt_exit" - | "PLpgSQL_stmt_forc" - | "PLpgSQL_stmt_foreach_a" - ): + case "PLpgSQL_stmt_case" | "PLpgSQL_stmt_exit" | "PLpgSQL_stmt_foreach_a": raise Exception(f"Not yet implemented {node.type}") # nodes that will end current path - case ( - "PLpgSQL_stmt_return" - | "PLpgSQL_stmt_return_next" - | "PLpgSQL_stmt_return_query" - ): + case "PLpgSQL_stmt_return": path.steps.append(node) path.stack.clear() return