rafsun-yu opened a new issue, #332:
URL: https://github.com/apache/age/issues/332

   **Describe the bug**
   The `delete_global_graphs` command fails (return `false`) to delete a graph 
context if any graph context later in the list was deleted before.
   
   **How are you accessing AGE (Command line, driver, etc.)?**
   - Command Line
   
   **What data setup do we need to do?**
   ```pgsql
   ...
   -- create 3 graphs 
   SELECT * FROM create_graph('age_global_graph_1');
   SELECT * FROM cypher('age_global_graph_1', $$ CREATE (v:vertex_from_graph_1) 
RETURN v  $$) AS (v agtype);
   
   SELECT * FROM create_graph('age_global_graph_2');
   SELECT * FROM cypher('age_global_graph_2', $$ CREATE (v:vertex_from_graph_2) 
RETURN v  $$) AS (v agtype);
   
   SELECT * FROM create_graph('age_global_graph_3');
   SELECT * FROM cypher('age_global_graph_3', $$ CREATE (v:vertex_from_graph_3) 
RETURN v  $$) AS (v agtype);
   
   -- load contexts using the vertex_stats command 
   SELECT * FROM cypher('age_global_graph_3', $$ MATCH (u) RETURN 
vertex_stats(u) $$) AS (result agtype);
   SELECT * FROM cypher('age_global_graph_2', $$ MATCH (u) RETURN 
vertex_stats(u) $$) AS (result agtype);
   SELECT * FROM cypher('age_global_graph_1', $$ MATCH (u) RETURN 
vertex_stats(u) $$) AS (result agtype);
   ...
   ```
   
   **What is the necessary configuration info needed?**
   - AGE needs to be installed in the PG 11.17.
   
   **What is the command that caused the error?**
   ```pgsql
   -- delete age_global_graph_2's context
   -- should return true (succeeded)
   SELECT * FROM cypher('age_global_graph_2', $$ RETURN 
delete_global_graphs('age_global_graph_2') $$) AS (result agtype);
   
   -- delete age_global_graph_1's context
   -- should return true (succeed) because previous command should not delete 
the 1st graph's context
   SELECT * FROM cypher('age_global_graph_1', $$ RETURN 
delete_global_graphs('age_global_graph_1') $$) AS (result agtype);
   
   -- delete age_global_graph_3's context
   -- should return true (succeed) because previous commands should not delete 
the 3rd graph's context
   SELECT * FROM cypher('age_global_graph_3', $$ RETURN 
delete_global_graphs('age_global_graph_3') $$) AS (result agtype);
   ```
   ```pgsql
   SELECT * FROM cypher('age_global_graph_2', $$ RETURN 
delete_global_graphs('age_global_graph_2') $$) AS (result agtype);
    result 
   --------
    true
   (1 row)
   
   SELECT * FROM cypher('age_global_graph_1', $$ RETURN 
delete_global_graphs('age_global_graph_1') $$) AS (result agtype);
    result 
   --------
    false
   (1 row)
   
   SELECT * FROM cypher('age_global_graph_3', $$ RETURN 
delete_global_graphs('age_global_graph_3') $$) AS (result agtype);
    result 
   --------
    true
   (1 row)
   ```
   
   **Expected behavior**
   The second query should return `true`.
   
   **Environment (please complete the following information):**
   - Version: PG 11.17
   
   **Additional context**
   N/A
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to