Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.4.7
-
None
-
None
Description
In MDEV-11826 there is a discussion that the default of NULL ON ERROR shall be followed, which it is.
However, I don't think that the ON ERROR setting affects syntax errors in the SQL/JSON path expression itself. Syntax errors in the path itself violate SQL-2:2016 9.39 Syntax Rule 3.
9075-1:2011 6.3.3.2 (watch out: part 1) says that "The treatment of language that does not conform to the SQL Formats and Syntax Rules is implementation-dependent". IMHO that means that NULL ON ERROR does not prevent you from raising an error for SYNTAX ERRORS.
The same paragraph even requires implementation that only process conforming SQL in a conforming way MUST raise an error in that case.
I've seen two other implementations that always raise syntax errors in the SQL/JSON path (without ON ERROR clause). A third implementation only raises syntax errors if both ERROR ON ERROR and STRICT mode is used (this is clearly wrong, lax vs. strict only affects structural errors). Also typos in the keyword STRICT don't raise errors in this implementation (pretty pointless approach IMHO).