[
https://issues.apache.org/jira/browse/TINKERPOP-3077?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Cole Greer closed TINKERPOP-3077.
---------------------------------
Fix Version/s: 3.6.8
3.7.3
Assignee: Cole Greer
Resolution: Fixed
> Javascript translator incorrectly handle quotes, null and undefined values
> --------------------------------------------------------------------------
>
> Key: TINKERPOP-3077
> URL: https://issues.apache.org/jira/browse/TINKERPOP-3077
> Project: TinkerPop
> Issue Type: Bug
> Components: javascript
> Affects Versions: 3.6.7, 3.7.2
> Reporter: Valentyn Kahamlyk
> Assignee: Cole Greer
> Priority: Blocker
> Fix For: 3.6.8, 3.7.3
>
>
> If there are `null` or `undefined` values in queries, the translator converts
> them incorrectly. `null` converted as string "null" and `undefined` is
> simply skipped.
> Quotes are not properly escaped
> Simple reproducer.
> {code:javascript}
> const script1 = new Translator('g')
> .translate(g.addV('test').property('empty', null).getBytecode());
> console.log(script1);
> const script2 = new Translator('g')
> .translate(g.addV('test').property('empty', undefined).getBytecode());
> console.log(script2);
> const script3 = new Translator('g')
> .translate(g.addV('test').property('quotes', "some \"quotes' in the
> middle.").getBytecode());
> console.log(script3);{code}
>
> output:
> {code:java}
> g.addV('test').property('empty', 'null')
> g.addV('test').property('empty', )
> g.addV('test').property('quotes', 'some "quotes' in the middle.')
> {code}
> which results in a server error when submitting translated query.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)