aboutsummaryrefslogtreecommitdiff
path: root/contrib/xml2/xpath.c
diff options
context:
space:
mode:
authorAmit Langote <amitlan@postgresql.org>2024-09-09 13:46:58 +0900
committerAmit Langote <amitlan@postgresql.org>2024-09-09 13:46:58 +0900
commitdd8bea88abf4794d99270ced884a8bc1e387255d (patch)
treed1be3ffc41c4ebfec668ec92789a06270661500f /contrib/xml2/xpath.c
parent87b6c3c0b703c3a71bc640f456a24937744ff30b (diff)
downloadpostgresql-dd8bea88abf4794d99270ced884a8bc1e387255d.tar.gz
postgresql-dd8bea88abf4794d99270ced884a8bc1e387255d.zip
SQL/JSON: Avoid initializing unnecessary ON ERROR / ON EMPTY steps
When the ON ERROR / ON EMPTY behavior is to return NULL, returning NULL directly from ExecEvalJsonExprPath() suffices. Therefore, there's no need to create separate steps to check the error/empty flag or those to evaluate the the constant NULL expression. This speeds up common cases because the default ON ERROR / ON EMPTY behavior for JSON_QUERY() and JSON_VALUE() is to return NULL. However, these steps are necessary if the RETURNING type is a domain, as constraints on the domain may need to be checked. Reported-by: Jian He <jian.universality@gmail.com> Author: Jian He <jian.universality@gmail.com> Author: Amit Langote <amitlangote09@gmail.com> Discussion: https://postgr.es/m/CACJufxEo4sUjKCYtda0_qt9tazqqKPmF1cqhW9KBOUeJFqQd2g@mail.gmail.com Backpatch-through: 17
Diffstat (limited to 'contrib/xml2/xpath.c')
0 files changed, 0 insertions, 0 deletions