pgsql: Fix jsonpath existense checking of missing variables

Поиск
Список
Период
Сортировка
От Alexander Korotkov
Тема pgsql: Fix jsonpath existense checking of missing variables
Дата
Msg-id E1pFzTN-003J1w-Ok@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix jsonpath existense checking of missing variables

The current jsonpath code assumes that the referenced variable always exists.
It could only throw an error at the value valuation time.  At the same time
existence checking assumes variable is present without valuation, and error
suppression doesn't work for missing variables.

This commit makes existense checking trigger an error for missing variables.
This makes the overall behavior consistent.

Backpatch to 12 where jsonpath was introduced.

Reported-by: David G. Johnston
Discussion: https://postgr.es/m/CAKFQuwbeytffJkVnEqDyLZ%3DrQsznoTh1OgDoOF3VmOMkxcTMjA%40mail.gmail.com
Author: Alexander Korotkov, David G. Johnston
Backpatch-through: 12

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0d9221f1d251b956a33660bff1420140f8abebcb

Modified Files
--------------
src/backend/utils/adt/jsonpath_exec.c        |  8 +++++--
src/test/regress/expected/jsonb_jsonpath.out | 32 ++++++++++++++++++++++++++++
src/test/regress/sql/jsonb_jsonpath.sql      |  8 +++++++
3 files changed, 46 insertions(+), 2 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Alexander Korotkov
Дата:
Сообщение: pgsql: Fix jsonpath existense checking of missing variables
Следующее
От: Alexander Korotkov
Дата:
Сообщение: pgsql: Fix jsonpath existense checking of missing variables