Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #975 Invalid reuse of variables in CREATE clause #977

Merged
merged 1 commit into from
Jun 9, 2023

Conversation

MuhammadTahaNaveed
Copy link
Member

  • Added checks for invalid use of variables in create clause.
  • Fixed error position of path and node variables.
  • Added regression tests.

resolves #975

- Added checks for invalid use of variables in create clause.
- Fixed error position of path and node variables.
- Added regression tests.
regress/sql/cypher_create.sql Show resolved Hide resolved
regress/sql/cypher_create.sql Show resolved Hide resolved
@dehowef
Copy link
Member

dehowef commented Jun 8, 2023

Looks good to me.

@rafsun42
Copy link
Member

rafsun42 commented Jun 9, 2023

@MuhammadTahaNaveed Would the following query work:

MATCH (p:Person) WITH p AS r CREATE p=(a:Person)-[:Manages]->(r) return r

I get the following error. It has probably nothing to do with your changes.

test=# SELECT * FROM cypher('hey', $$ MATCH (p:Person) WITH p AS r CREATE p=(a:Person)-[:Manages]->(r) return r $$) as (a agtype);
ERROR:  ag function does not exist
LINE 1: SELECT * FROM cypher('hey', $$ MATCH (p:Person) WITH p AS r ...
                                     ^
DETAIL:  agtype_volatile_wrapper(1)

@MuhammadTahaNaveed
Copy link
Member Author

@MuhammadTahaNaveed Would the following query work:

MATCH (p:Person) WITH p AS r CREATE p=(a:Person)-[:Manages]->(r) return r

I get the following error. It has probably nothing to do with your changes.

test=# SELECT * FROM cypher('hey', $$ MATCH (p:Person) WITH p AS r CREATE p=(a:Person)-[:Manages]->(r) return r $$) as (a agtype);
ERROR:  ag function does not exist
LINE 1: SELECT * FROM cypher('hey', $$ MATCH (p:Person) WITH p AS r ...
                                     ^
DETAIL:  agtype_volatile_wrapper(1)

@rafsun42 Hi, yes this query should work. And it is working fine at my end.

Copy link
Member

@rafsun42 rafsun42 left a comment

Choose a reason for hiding this comment

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

Okay, looks good.

@jrgemignani jrgemignani merged commit e22c5ac into apache:master Jun 9, 2023
@MuhammadTahaNaveed MuhammadTahaNaveed deleted the create_clause_issue branch June 10, 2023 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid reuse of variables in CREATE clause
4 participants