From 8299319548d7b3162e51bd8268e85d8af54f3e71 Mon Sep 17 00:00:00 2001 From: Alex Kwak Date: Thu, 15 Dec 2022 14:18:20 +0900 Subject: [PATCH] tests --- src/backend/parser/analyze.c | 44 ++++++------------------------------ 1 file changed, 7 insertions(+), 37 deletions(-) diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c index 9176129744d..dd2736fd483 100644 --- a/src/backend/parser/analyze.c +++ b/src/backend/parser/analyze.c @@ -3439,8 +3439,6 @@ transformCypherStmt(ParseState *pstate, CypherStmt *stmt) CypherClause *clause; NodeTag type; bool valid = true; - NodeTag update_type = T_Invalid; - bool read = false; clause = (CypherClause *) stmt->last; type = cypherClauseTag(clause); @@ -3454,7 +3452,6 @@ transformCypherStmt(ParseState *pstate, CypherStmt *stmt) case T_CypherDeleteClause: case T_CypherSetClause: case T_CypherMergeClause: - update_type = type; break; default: valid = false; @@ -3473,7 +3470,13 @@ transformCypherStmt(ParseState *pstate, CypherStmt *stmt) switch (type) { case T_CypherMatchClause: - read = true; + case T_CypherCreateClause: + case T_CypherDeleteClause: + case T_CypherSetClause: + case T_CypherMergeClause: + case T_CypherLoadClause: + case T_CypherUnwindClause: + /* do nothing. */ break; case T_CypherProjection: if (cypherProjectionKind(clause->detail) == CP_RETURN) @@ -3482,39 +3485,6 @@ transformCypherStmt(ParseState *pstate, CypherStmt *stmt) (errcode(ERRCODE_SYNTAX_ERROR), errmsg("RETURN must be at the end of the query"))); } - else - { - /* CP_WITH */ - if (update_type != T_Invalid && - update_type != T_CypherCreateClause) - read = true; - } - break; - case T_CypherCreateClause: - if (update_type == T_Invalid || - update_type == T_CypherMergeClause) - { - update_type = T_CypherCreateClause; - } - /* todo: restriction is required? */ - break; - case T_CypherDeleteClause: - case T_CypherSetClause: - /* todo: restriction is required? */ - break; - case T_CypherMergeClause: - if (update_type == T_Invalid || - update_type == T_CypherCreateClause) - { - update_type = T_CypherMergeClause; - } - /* todo: restriction is required? */ - break; - case T_CypherLoadClause: - read = true; - break; - case T_CypherUnwindClause: - read = true; break; default: elog(ERROR, "unrecognized Cypher clause type: %d", type);