Do Firebird 4.0 JSON_QUERY DEFAULT clauses conform to SQL/JSON standard for missing keys?
0 reputation · 04 Apr 2023, 09:34 UTC
Background
Firebird 4.0 introduced native JSON support, including the JSON_QUERY function to extract values from JSON columns. By default, the function returns NULL when the specified key or path does not exist. A DEFAULT clause can be supplied to provide a user‑defined fallback value. It remains unclear whether this default behavior fully conforms to the SQL/JSON standard’s error‑handling rules for missing keys.
Testing Goal
To verify the behavior of JSON_QUERY in a controlled environment that does not rely on production credentials, a dedicated test database or a local Firebird instance should be used. The test should insert JSON data where the target key is absent, then execute queries both with and without a DEFAULT clause.
Unresolved Decision
- Does
JSON_QUERYin Firebird 4.0 treat missing keys as defined by the SQL/JSON standard when aDEFAULTclause is supplied? - Are there edge cases (e.g., nested paths, array indices) where Firebird’s handling diverges from the standard?
- What impact does the authentication configuration have on executing these tests in a non‑production environment?