You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@age.apache.org by GitBox <gi...@apache.org> on 2022/07/26 13:31:36 UTC

[GitHub] [age] selendym opened a new issue, #241: Output serialization for strings seems to be incorrect at times

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: dev-unsubscribe@age.apache.org.apache.org

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


[GitHub] [age] jrgemignani commented on issue #241: Output serialization for strings seems to be incorrect at times

Posted by GitBox <gi...@apache.org>.
jrgemignani commented on issue #241:
URL: https://github.com/apache/age/issues/241#issuecomment-1200681907

   Interesting. There appears to be a positional component to this bug -
   ```
   psql-11.5-5432-pgsql=# 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)
   
   psql-11.5-5432-pgsql=# SELECT * FROM ag_catalog.cypher('g', $$ with { id: 42, label: "label_name", properties: {} }::vertex as z return { v: "asdf", z: z } $$) AS (c ag_catalog.agtype);
                                           c
   ---------------------------------------------------------------------------------
    {"v": "asdf", "z": {"id": 42, "label": "label_name", "properties": {}}::vertex}
   (1 row)
   ```
   ```
   psql-11.5-5432-pgsql=# 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)
   
   psql-11.5-5432-pgsql=# SELECT * FROM ag_catalog.cypher('g', $$ with { id: 42, label: "label_name", properties: {} }::vertex as z return { a: "ASDF", v: "asdf", z: z } $$) AS (c ag_catalog.agtype);
                                                 c
   ----------------------------------------------------------------------------------------------
    {"a": "ASDF", "v": "asdf", "z": {"id": 42, "label": "label_name", "properties": {}}::vertex}
   (1 row)
   ```
   
   
   


-- 
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-unsubscribe@age.apache.org

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