selendym opened a new issue, #241:
URL: https://github.com/apache/age/issues/241
**Describe the bug**
Output serialization for strings seems to be incorrect at times.
**How are you accessing AGE (Command line, driver, etc.)?**
With `psql` from the docker image. One container for the server and another
one for the client.
**What data setup do we need to do?**
```sql
select * from ag_catalog.create_graph('g');
```
**What is the necessary configuration info needed?**
Just the docker image built from master branch.
**What is the command that caused the error?**
```sql
postgres=# SELECT * FROM ag_catalog.cypher('g', $$ with { id: 42, label:
"label_name", properties: {} }::vertex as v return { a: "ASDF", v: v } $$) AS
(c ag_catalog.agtype);
c
---------------------------------------------------------------------------------
{"a": "ASDF", "v": {"id": 42, "label": "label_name", "properties":
{}}::vertex}
(1 row)
postgres=# SELECT * FROM ag_catalog.cypher('g', $$ with { id: 42, label:
"label_name", properties: {} }::vertex as v return { z: "asdf", v: v } $$) AS
(c ag_catalog.agtype);
c
-----------------------------------------------------------------------------
{"v": {"id": 42, "label": "label_name", "properties": {}}::vertex, "z": ""}
(1 row)
postgres=# SELECT * FROM ag_catalog.cypher('g', $$ with { id: 42, label:
"label_name", properties: {} }::vertex as v return { a: "ASDF", z: "asdf", v: v
} $$) AS (c ag_catalog.agtype);
c
----------------------------------------------------------------------------------------------
{"a": "ASDF", "v": {"id": 42, "label": "label_name", "properties":
{}}::vertex, "z": " asd"}
(1 row)
```
The first query in the above listing is correct while the last two serialize
`"z"` incorrectly.
Note that `"a"` seems to be serialized correctly, so the order wrt the
vertex `"v"` seems to be relevant here.
Similarly for edges:
```sql
postgres=# SELECT * FROM ag_catalog.cypher('g', $$ with { id: 42, start_id:
42, end_id: 42, label: "label_name", properties: {} }::edge as e return { a:
"ASDF", e: e } $$) AS (c ag_catalog.agtype);
c
-------------------------------------------------------------------------------------------------------------
{"a": "ASDF", "e": {"id": 42, "label": "label_name", "end_id": 42,
"start_id": 42, "properties": {}}::edge}
(1 row)
postgres=# SELECT * FROM ag_catalog.cypher('g', $$ with { id: 42, start_id:
42, end_id: 42, label: "label_name", properties: {} }::edge as e return { z:
"asdf", e: e } $$) AS (c ag_catalog.agtype);
c
---------------------------------------------------------------------------------------------------------
{"e": {"id": 42, "label": "label_name", "end_id": 42, "start_id": 42,
"properties": {}}::edge, "z": ""}
(1 row)
postgres=# SELECT * FROM ag_catalog.cypher('g', $$ with { id: 42, start_id:
42, end_id: 42, label: "label_name", properties: {} }::edge as e return { a:
"ASDF", z: "asdf", e: e } $$) AS (c ag_catalog.agtype);
c
--------------------------------------------------------------------------------------------------------------------------
{"a": "ASDF", "e": {"id": 42, "label": "label_name", "end_id": 42,
"start_id": 42, "properties": {}}::edge, "z": " asd"}
(1 row)
```
**Expected behavior**
All of the strings should be serialized correctly.
**Environment (please complete the following information):**
- env: docker
- branch: master
- commit: 5ded59f
--
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]