[MDEV-20291] Handling of SQL/JSON path syntax errors Created: 2019-08-08  Updated: 2019-08-08

Status: Open
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.4.7
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Markus Winand Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: 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).


Generated at Thu Feb 08 08:58:20 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.