Amit Langote e4e27976a6 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
2024-09-06 12:04:29 +09:00
..
2024-08-29 14:33:18 +02:00
2024-08-29 14:33:18 +02:00
2024-08-29 14:33:18 +02:00
2024-09-02 12:02:42 +02:00
2024-08-29 14:33:18 +02:00
2024-08-29 14:33:18 +02:00
2024-04-18 21:28:07 +02:00
2024-06-21 08:17:23 +02:00
2024-05-14 12:57:22 +02:00