Bug #92819 ExprParser throws WrongArgumentException when parsing empty JSON Array
Submitted: 17 Oct 2018 9:36 Modified: 8 Apr 2019 21:04
Reporter: Vladimir Marinov Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:8.0.12 OS:Any
Assigned to: CPU Architecture:Any
Tags: EmptyArray, ExprParser

[17 Oct 2018 9:36] Vladimir Marinov
Description:
Given that {"emptyObject": {}} is valid expression it is expected that {"emptyArray": []} should also be valid expression

How to repeat:
String expWithEmptyArray = "{\"emptyArray\": []}";
ExprUtil.argObjectToExpr(Expression.expr(expWithEmptyArray), false);
[24 Oct 2018 7:33] MySQL Verification Team
Hello Vladimir,

Thank you for the report.
Verifying based on my internal discussion with Alex(C/J Dev).

regards,
Umesh
[8 Apr 2019 21:04] Daniel So
Posted by developer:
 
Added the following entry to the Connector/J 8.0.16 changelog:

"Connector/J threw an error when a JSON document contained only a field with an empty array as its value. With this fix, Connector/J now takes that as a valid JSON document."