ArcadeData / arcadedb

ArcadeDB Multi-Model Database, one DBMS that supports SQL, Cypher, Gremlin, HTTP/JSON, MongoDB and Redis. ArcadeDB is a conceptual fork of OrientDB, the first Multi-Model DBMS. ArcadeDB supports Vector Embeddings.
https://arcadedb.com
Apache License 2.0
486 stars 60 forks source link

Manually escape $ for cypher when there is a new line in this same string #1649

Open ExtReMLapin opened 2 months ago

ExtReMLapin commented 2 months ago

Hello, It's me again

ArcadeDB Version:

ArcadeDB Server v24.5.1-SNAPSHOT (build 71472c4c05ae9278d0d5d71a919b31883e1ea767/1713899543605/main) is starting up... creating nodes and reading nodes

OS and JDK Version:

Running on Linux 5.15.0-100-generic - OpenJDK 64-Bit Server VM 11.0.22 for creating nodes and reading nodes

Hello,

Because of the param format limit I ended up using a lexer to detect the $variables in my cypher query, formating it in python and then sending it to arcadedb.

Issue, is that, yes I escape ' to \' , \ to \\ but $ STRINGS still causes an error.

error.txt

query.txt

Update : it seems that it's a new line AND the dollar sign in a string that causes an error (both of them at the same time)

Works :

CREATE (n:CHUNK {name: 'document DrSamChepard.pdf, chunk 5', subtype: 'CHUNK', text: '$50,000 bail,'}) RETURN ID(n)
CREATE (n:CHUNK {name: 'document DrSamChepard.pdf, chunk 5', subtype: 'CHUNK', text: '50,000 bail, 
lol new line'}) RETURN ID(n)

Doesn't work:

CREATE (n:CHUNK {name: 'document DrSamChepard.pdf, chunk 5', subtype: 'CHUNK', text: '$50,000 bail, 
lol new line'}) RETURN ID(n)