noahxzhu commented on issue #1722: URL: https://github.com/apache/age/issues/1722#issuecomment-2041038580
I'm testing some cases with the python driver, the behavior like below # Case 1 ``` def test(p: str): prepared_statement = """ MERGE (n1:`TEST` {id: %s}) """ ag.execCypher(prepared_statement, params=(p,)) ag.commit() test("a's") ``` GOT ``` psycopg2.errors.SyntaxError: syntax error at or near "'s'" LINE 1: SELECT * from cypher(NULL,NULL) as (v agtype); ``` # Case 2 ``` def test(p: str): prepared_statement = """ MERGE (n1:`TEST` {id: %s}) """ ag.execCypher(prepared_statement, params=(p,)) ag.commit() test('a"s') ``` GOT ``` psycopg2.errors.SyntaxError: unexpected character at or near "\" LINE 1: SELECT * from cypher(NULL,NULL) as (v agtype); ``` # Case 3 I think we shouldn't add quotes for the params, right? ``` def test(p: str): prepared_statement = """ MERGE (n1:`TEST` {id: '%s'}) """ ag.execCypher(prepared_statement, params=(p,)) ag.commit() test('a"s') ``` GOT ``` psycopg2.errors.SyntaxError: unexpected character at or near "\" LINE 1: SELECT * from cypher(NULL,NULL) as (v agtype); ``` # Case 4 ``` def test(p: str): prepared_statement = """ MERGE (n1:`TEST` {id: '%s'}) """ ag.execCypher(prepared_statement, params=(p,)) ag.commit() test("a's") ``` GOT ``` psycopg2.errors.SyntaxError: syntax error at or near "a" LINE 1: SELECT * from cypher(NULL,NULL) as (v agtype); ``` # Case 5 ``` def test(p: str): prepared_statement = """ MERGE (n1:`TEST` {id: "%s"}) """ ag.execCypher(prepared_statement, params=(p,)) ag.commit() test("a's") ``` GOT Succeed but the data like this ``` {"id": "'a''s'"}  ``` # Case 6 ``` def test(p: str): prepared_statement = """ MERGE (n1:`TEST` {id: "%s"}) """ ag.execCypher(prepared_statement, params=(p,)) ag.commit() test('a"s') GOT ``` psycopg2.errors.SyntaxError: syntax error at or near "s" LINE 1: SELECT * from cypher(NULL,NULL) as (v agtype); ``` -- 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 For queries about this service, please contact Infrastructure at: us...@infra.apache.org