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

Server terminates for SET plus-equal when the original properties has a non-scalar value #1159

Closed
Zainab-Saad opened this issue Aug 18, 2023 · 5 comments · Fixed by #1160
Closed
Labels
bug Something isn't working

Comments

@Zainab-Saad
Copy link
Contributor

Zainab-Saad commented Aug 18, 2023

Describe the bug
Updating properties of a vertex/edge (having a non-scalar value) with SET plus-equal terminates the server

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

What data setup do we need to do?
Create 2 vertices with non-scalar property values

SELECT * FROM cypher('graph', $$
CREATE (n: A {map: {a : 1}}), (m: B {lst: [1, 2]})
$$) AS (result agtype);

What is the command that caused the error?
This query terminated the server (same for vertex with label B)

SELECT * FROM cypher('graph', $$
MATCH (n: A) SET n += {bool: true} RETURN n
$$) AS (result agtype);

Expected behavior
Should update the properties as below

                                            result                                            
----------------------------------------------------------------------------------------------
 {"id": 844424930131969, "label": "A", "properties": {"map": {"a": 1}, "bool": true}}::vertex
(1 row)

Environment (please complete the following information):
AGE master (This problem exists for other branches too)

Additional context
SET plus-equal works fine for scalar property values

SELECT * FROM cypher('graph', $$
CREATE (n: C {num : 1}) RETURN n
$$) AS (result agtype);
SELECT * FROM cypher('graph', $$
MATCH (n: C) SET n += {bool: true} RETURN n
$$) AS (result agtype);
                                         result                                         
----------------------------------------------------------------------------------------
 {"id": 1407374883553281, "label": "C", "properties": {"num": 1, "bool": true}}::vertex
(1 row)
@Zainab-Saad Zainab-Saad added the bug Something isn't working label Aug 18, 2023
@rafsun42 rafsun42 self-assigned this Aug 18, 2023
@rafsun42
Copy link
Member

@Zainab-Saad Are you working on it?

@Zainab-Saad
Copy link
Contributor Author

@rafsun42 I have created a PR for this, could you review that?

@rafsun42
Copy link
Member

rafsun42 commented Aug 18, 2023

@Zainab-Saad This query didn't terminate on my machine (Master, PG15). What PG version are you using?

SELECT * FROM cypher('graph', $$
MATCH (n: A) SET n += {bool: true} RETURN n
$$) AS (result agtype);

EDIT:
I was able to reproduce the issue after compiling PG with --enable-cassert flag.

@Zainab-Saad
Copy link
Contributor Author

@rafsun42 version is PG 15.1. with the data setup I have provided, this query terminated.

@rafsun42
Copy link
Member

rafsun42 commented Aug 18, 2023

@Zainab-Saad
Is this the expected result for your data setup? I get this result on my machine.

Could you also put this on the "Expected behavior" section in case anyone else wants to reproduce the issue?

agedev=# SELECT * FROM cypher('graph', $$
MATCH (n: A) SET n += {bool: true} RETURN n
$$) AS (result agtype);
                                            result                                            
----------------------------------------------------------------------------------------------
 {"id": 844424930131969, "label": "A", "properties": {"map": {"a": 1}, "bool": true}}::vertex
(1 row)

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
None yet
Development

Successfully merging a pull request may close this issue.

2 participants