Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
3.6.7, 3.7.2
-
None
Description
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.
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);
output:
g.addV('test').property('empty', 'null') g.addV('test').property('empty', ) g.addV('test').property('quotes', 'some "quotes' in the middle.')
which results in a server error when submitting translated query.