alexgraul opened a new issue, #2067:
URL: https://github.com/apache/age/issues/2067

   **Describe the bug**
   A clear and concise description of what the bug is.
   
   **How are you accessing AGE (Command line, driver, etc.)?**
   Direct PG CLI for reproduction
   
   **What data setup do we need to do?**
   Create `mygraph`
   
   **What is the command that caused the error?**
   ```pgsql
   ...
   SELECT * FROM cypher('mygraph', $$ 
        MERGE (a:Airport { code: 'ATL'})
        MERGE (b:Airport { code: 'LHR'})
        MERGE (c:Airport { code: 'LGW'})
   $$) AS (value agtype);
   
   SELECT * FROM cypher('mygraph', $$ 
        MATCH (left:Airport) WHERE left.code = 'LHR'
        MATCH (right:Airport) WHERE right.code = 'LGW'
       MERGE (left)-[edge:ROUTE { code: 1 }]->(right)
       SET edge.foo = 2
       SET edge.bar = 2
       RETURN edge
   $$) AS (value agtype);
   
   SELECT * FROM cypher('mygraph', $$ 
        MATCH (:Airport)-[r:ROUTE { code: 1 }]->(:Airport)
        RETURN r
   $$) AS (value agtype);       
   
   SELECT * FROM cypher('mygraph', $$ 
        MATCH (left:Airport) WHERE left.code = 'ATL'
        MATCH (right:Airport) WHERE right.code = 'LGW'
       MERGE (left)-[edge:ROUTE { code: 2 }]->(right)
       SET edge.foo = 2
       RETURN edge
   $$) AS (value agtype);
   
   SELECT * FROM cypher('mygraph', $$ 
        MATCH (:Airport)-[r:ROUTE { code: 2 }]->(:Airport)
        RETURN r
   $$) AS (value agtype);       
   ...
   ```
   
   Observe that query 3 MATCH `[:Route { code: 1}]` returns an edge with props 
`{"bar": 2, "foo": 2, "code": 1}`
   The last query MATCH `[:Route { code: 2}]` however returns an edge with the 
props `{"code": 2}` - prop `foo` is missing.
   
   
   **What is the necessary configuration info needed?**
   Stock Apache AGE docker image
   
   **Expected behavior**
   The property `foo` should have been created on the edge that was created by 
the MERGE command in query 4. The returned edge correctly has the property but 
it is not actually stored in the database, thus query 5 returns an edge without 
`foo`.
   If you run query 4 twice it will work, this seems to be specific to a single 
SET coupled with a MERGE statement that is creating a new edge. It works 
correctly in all tested scenarios for vertices. 
   
   **Environment (please complete the following information):**
   - Version: 1.5


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@age.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to