Skip to content

Invalid reuse of previous clause variable in succeeding CREATE clause #1513

@Zainab-Saad

Description

@Zainab-Saad

Describe the bug
The succeeding CREATE clause is letting the reuse of variable of the previous CREATE.

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

What is the command that caused the error?

SELECT * FROM cypher('graph', $$ CREATE(n) CREATE(n)  RETURN n $$) AS (result agtype);

creates one vertex

                             result                             
----------------------------------------------------------------
 {"id": 281474976710657, "label": "", "properties": {}}::vertex
(1 row)

Environment (please complete the following information):
AGE master - PG16

Expected behavior
The second CREATE clause should give a duplicate variable error. Neo4j errors out as:

Variable `n` already declared (line 1, column 18 (offset: 17))
"CREATE(n) CREATE(n)  RETURN n"
                  ^

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions