postgresql/src
Amit Langote dd8bea88ab 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-09 13:46:58 +09:00
..
backend SQL/JSON: Avoid initializing unnecessary ON ERROR / ON EMPTY steps 2024-09-09 13:46:58 +09:00
bin Fix handling of NULL return value in typarray lookup 2024-09-05 15:32:22 +02:00
common Define PG_TBLSPC_DIR for path pg_tblspc/ in data folder 2024-09-03 09:11:54 +09:00
fe_utils Prevent mis-encoding of "trailing junk after numeric literal" errors. 2024-09-05 12:42:33 -04:00
include Add callbacks to control flush of fixed-numbered stats 2024-09-09 11:12:29 +09:00
interfaces Avoid core dump after getpwuid_r failure. 2024-09-08 19:14:40 -04:00
makefiles Add -Wmissing-variable-declarations to the standard compilation flags 2024-08-03 11:51:02 +02:00
pl Fix misleading error message context 2024-09-05 15:19:00 +02:00
port Only perform pg_strong_random init when required 2024-09-02 13:52:27 +02:00
template thread-safety: gmtime_r(), localtime_r() 2024-08-23 07:43:04 +02:00
test SQL/JSON: Fix default ON ERROR behavior for JSON_TABLE 2024-09-06 13:25:53 +09:00
timezone Update time zone data files to tzdata release 2024a. 2024-02-01 15:57:53 -05:00
tools Add block_range_read_stream_cb(), to deduplicate code. 2024-09-03 10:46:20 -07:00
tutorial Update copyright for 2024 2024-01-03 20:49:05 -05:00
.gitignore
DEVELOPERS
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
Makefile.global.in Add -Wmissing-variable-declarations to the standard compilation flags 2024-08-03 11:51:02 +02:00
Makefile.shlib Remove AIX support 2024-02-28 15:17:23 +04:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
nls-global.mk Remove distprep 2023-11-06 15:18:04 +01:00