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

Invalid reuse of variables in CREATE clause #975

Closed
MuhammadTahaNaveed opened this issue Jun 8, 2023 · 0 comments · Fixed by #977
Closed

Invalid reuse of variables in CREATE clause #975

MuhammadTahaNaveed opened this issue Jun 8, 2023 · 0 comments · Fixed by #977
Assignees
Labels
bug Something isn't working

Comments

@MuhammadTahaNaveed
Copy link
Member

Describe the bug
Age is allowing invalid reuse of variables in CREATE clause.

How are you accessing AGE (Command line, driver, etc.)?

  • terminal

What is the command that caused the error?

SELECT * from cypher('my_graph_name', $$
  CREATE p=(p)
$$) as (a agtype);

This command should error out saying that p is already declared but it passes.

 result 
--------
(0 rows)
SELECT * from cypher('my_graph_name', $$
  CREATE p=(p) RETURN p
$$) as (a agtype);
ERROR:  column reference "p" is ambiguous
LINE 1: ...ELECT * from cypher('new4', $$CREATE p=(p) RETURN p$$) as (r...

Expected behavior
Should have failed with error saying p already declared

Environment (please complete the following information):

  • latest

Additional context
Need to add proper checks for valid variable reuse.

@MuhammadTahaNaveed MuhammadTahaNaveed added the bug Something isn't working label Jun 8, 2023
MuhammadTahaNaveed added a commit to MuhammadTahaNaveed/age that referenced this issue Jun 8, 2023
- Added checks for invalid use of variables in create clause.
- Fixed error position of path and node variables.
- Added regression tests.
jrgemignani pushed a commit that referenced this issue Jun 9, 2023
- Added checks for invalid use of variables in create clause.
- Fixed error position of path and node variables.
- Added regression tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

Successfully merging a pull request may close this issue.

1 participant