postgresql/src/test/regress/expected
Tom Lane b0feda79fd Fix jsonb subscripting to cope with toasted subscript values.
jsonb_get_element() was incautious enough to use VARDATA() and
VARSIZE() directly on an arbitrary text Datum.  That of course
fails if the Datum is short-header, compressed, or out-of-line.
The typical result would be failing to match any element of a
jsonb object, though matching the wrong one seems possible as well.

setPathObject() was slightly brighter, in that it used VARDATA_ANY
and VARSIZE_ANY_EXHDR, but that only kept it out of trouble for
short-header Datums.  push_path() had the same issue.  This could
result in faulty subscripted insertions, though keys long enough to
cause a problem are likely rare in the wild.

Having seen these, I looked around for unsafe usages in the rest
of the adt/json* files.  There are a couple of places where it's not
immediately obvious that the Datum can't be compressed or out-of-line,
so I added pg_detoast_datum_packed() to cope if it is.  Also, remove
some other usages of VARDATA/VARSIZE on Datums we just extracted from
a text array.  Those aren't actively broken, but they will become so
if we ever start allowing short-header array elements, which does not
seem like a terribly unreasonable thing to do.  In any case they are
not great coding examples, and they could also do with comments
pointing out that we're assuming we don't need pg_detoast_datum_packed.

Per report from exe-dealer@yandex.ru.  Patch by me, but thanks to
David Johnston for initial investigation.  Back-patch to v14 where
jsonb subscripting was introduced.

Discussion: https://postgr.es/m/205321670615953@mail.yandex.ru
2022-12-12 16:17:54 -05:00
..
advisory_lock.out tests: Restrict pg_locks queries in advisory_locks.sql to current database 2022-10-05 10:44:38 -07:00
aggregates.out Revert "Optimize order of GROUP BY keys". 2022-10-03 10:56:16 -04:00
alter_generic.out Add a SET option to the GRANT command. 2022-11-18 12:32:56 -05:00
alter_operator.out
alter_table.out Support writing "CREATE/ALTER TABLE ... SET STORAGE DEFAULT". 2022-11-10 18:20:49 -05:00
amutils.out Support INCLUDE'd columns in SP-GiST. 2021-04-05 18:41:21 -04:00
arrays.out Convert a few datatype input functions to use "soft" error reporting. 2022-12-09 10:14:53 -05:00
async.out
bit.out Add bit_count SQL function 2021-03-23 10:13:58 +01:00
bitmapops.out
boolean.out Convert a few datatype input functions to use "soft" error reporting. 2022-12-09 10:14:53 -05:00
box.out
brin_bloom.out BRIN bloom indexes 2021-03-26 13:35:32 +01:00
brin_multi.out Fix handling of NaN values in BRIN minmax multi 2021-11-06 01:50:44 +01:00
brin.out Avoid loss of code coverage with unlogged-index test cases. 2022-09-25 13:10:17 -04:00
btree_index.out Rearrange core regression tests to reduce cross-script dependencies. 2022-02-08 15:30:38 -05:00
case.out Add support for NullIfExpr in eval_const_expressions 2021-04-02 11:01:49 +02:00
char_1.out Change type "char"'s I/O format for non-ASCII characters. 2022-08-02 10:29:35 -04:00
char_2.out Change type "char"'s I/O format for non-ASCII characters. 2022-08-02 10:29:35 -04:00
char.out Change type "char"'s I/O format for non-ASCII characters. 2022-08-02 10:29:35 -04:00
circle.out
cluster.out Fix CLUSTER tuplesorts on abbreviated expressions. 2022-04-20 17:17:43 -07:00
collate.icu.utf8_1.out
collate.icu.utf8.out Add option to use ICU as global locale provider 2022-03-17 11:13:16 +01:00
collate.linux.utf8_1.out
collate.linux.utf8.out Database-level collation version tracking 2022-02-14 08:27:26 +01:00
collate.out Improve error checking of CREATE COLLATION options. 2021-07-18 11:08:34 +01:00
combocid.out Sanitize the term "combo CID" in code comments 2021-03-25 16:08:03 +09:00
comments.out
compression_1.out Remove error message hints mentioning configure options 2022-04-08 07:41:55 +02:00
compression.out Remove forced toast recompression in VACUUM FULL/CLUSTER 2021-06-14 09:25:50 +09:00
constraints.out Choose FK name correctly during partition attachment 2022-09-08 13:17:02 +02:00
conversion.out Rearrange core regression tests to reduce cross-script dependencies. 2022-02-08 15:30:38 -05:00
copy2.out Add more tests for COPY with incorrect option combinations 2022-11-02 09:57:54 +09:00
copy.out Simplify and clarify an error message 2022-08-18 11:36:55 +02:00
copydml.out
copyselect.out psql: Show all query results by default 2022-04-04 20:00:33 +02:00
create_aggregate.out
create_am.out Improve handling of SET ACCESS METHOD for ALTER MATERIALIZED VIEW 2022-03-19 19:13:52 +09:00
create_cast.out Record dependencies of a cast on other casts that it requires. 2022-10-17 14:02:05 -04:00
create_function_c.out Rename create_function_N test scripts for clarity. 2022-02-08 15:40:08 -05:00
create_function_sql.out Fix handling of R/W expanded datums that are passed to SQL functions. 2022-08-10 13:37:25 -04:00
create_index_spgist.out Add a planner support function for starts_with(). 2021-11-17 16:54:12 -05:00
create_index.out Fix a few issues with REINDEX grammar 2022-07-26 10:16:26 +09:00
create_misc.out Rearrange core regression tests to reduce cross-script dependencies. 2022-02-08 15:30:38 -05:00
create_operator.out Rearrange core regression tests to reduce cross-script dependencies. 2022-02-08 15:30:38 -05:00
create_procedure.out Reconsider the handling of procedure OUT parameters. 2021-06-10 17:11:36 -04:00
create_role.out Make role grant system more consistent with other privileges. 2022-08-22 11:35:17 -04:00
create_table_like.out Don't print extra parens around expressions in extended stats 2021-09-01 00:43:22 +02:00
create_table.out Report a more useful error for reloptions on a partitioned table. 2022-11-09 12:28:34 -05:00
create_type.out Add test scaffolding for soft error reporting from input functions. 2022-12-09 10:08:44 -05:00
create_view.out Fix under-parenthesized display of AT TIME ZONE constructs. 2022-12-01 11:38:14 -05:00
date.out Convert datetime input functions to use "soft" error reporting. 2022-12-09 16:07:49 -05:00
dbsize.out Teach pg_size_pretty and pg_size_bytes about petabytes 2021-07-09 18:56:00 +12:00
delete.out
dependency.out Provide per-table permissions for vacuum and analyze. 2022-11-28 12:08:14 -05:00
domain.out Convert domain_in to report errors softly. 2022-12-11 12:56:54 -05:00
drop_if_exists.out
drop_operator.out
enum.out
equivclass.out
errors.out Rearrange core regression tests to reduce cross-script dependencies. 2022-02-08 15:30:38 -05:00
event_trigger.out Allow event trigger table_rewrite for ALTER MATERIALIZED VIEW 2022-08-17 14:55:20 +09:00
explain.out Track I/O timing for temporary file blocks in EXPLAIN (BUFFERS) 2022-04-08 11:27:21 +09:00
expressions.out Replace SQLValueFunction by COERCE_SQL_SYNTAX 2022-11-21 18:31:59 +09:00
fast_default.out Revert 56-bit relfilenode change and follow-up commits. 2022-09-28 09:55:28 -04:00
float4-misrounded-input.out Convert a few datatype input functions to use "soft" error reporting. 2022-12-09 10:14:53 -05:00
float4.out Convert a few datatype input functions to use "soft" error reporting. 2022-12-09 10:14:53 -05:00
float8.out Convert a few datatype input functions to use "soft" error reporting. 2022-12-09 10:14:53 -05:00
foreign_data.out Add a SET option to the GRANT command. 2022-11-18 12:32:56 -05:00
foreign_key.out Create FKs properly when attaching table as partition 2022-11-03 20:40:21 +01:00
functional_deps.out
generated.out Fix bogus dependency handling for GENERATED expressions. 2022-03-21 14:58:49 -04:00
geometry.out Fix NaN comparison in circle_same test 2022-09-12 12:59:06 +02:00
gin.out Avoid loss of code coverage with unlogged-index test cases. 2022-09-25 13:10:17 -04:00
gist.out Avoid loss of code coverage with unlogged-index test cases. 2022-09-25 13:10:17 -04:00
groupingsets.out Make pull_var_clause() handle GroupingFuncs exactly like Aggrefs. 2022-05-12 11:31:46 -04:00
guc.out Introduce GUC_NO_RESET flag. 2022-09-27 11:47:12 -04:00
hash_func.out Fix portability issue in tests from commit ce773f230. 2021-09-03 10:01:02 -04:00
hash_index.out Rearrange core regression tests to reduce cross-script dependencies. 2022-02-08 15:30:38 -05:00
hash_part.out Avoid using ambiguous word "non-negative" in error messages. 2021-07-28 01:20:16 +09:00
horology.out Rearrange core regression tests to reduce cross-script dependencies. 2022-02-08 15:30:38 -05:00
identity.out Add support for MERGE SQL command 2022-03-28 16:47:48 +02:00
incremental_sort.out Revert "Optimize order of GROUP BY keys". 2022-10-03 10:56:16 -04:00
index_including_gist.out
index_including.out Support INCLUDE'd columns in SP-GiST. 2021-04-05 18:41:21 -04:00
indexing.out Fix subtly-incorrect matching of parent and child partitioned indexes. 2022-08-18 12:12:03 -04:00
indirect_toast.out Rearrange core regression tests to reduce cross-script dependencies. 2022-02-08 15:30:38 -05:00
inet.out
infinite_recurse_1.out
infinite_recurse.out
inherit.out Allow ordered partition scans in more cases 2021-08-03 12:25:52 +12:00
init_privs.out
insert_conflict.out Give better hints for ambiguous or unreferenceable columns. 2022-11-22 18:46:31 -05:00
insert.out Rearrange core regression tests to reduce cross-script dependencies. 2022-02-08 15:30:38 -05:00
int2.out Convert a few datatype input functions to use "soft" error reporting. 2022-12-09 10:14:53 -05:00
int4.out Convert a few datatype input functions to use "soft" error reporting. 2022-12-09 10:14:53 -05:00
int8.out Convert a few datatype input functions to use "soft" error reporting. 2022-12-09 10:14:53 -05:00
interval.out Convert datetime input functions to use "soft" error reporting. 2022-12-09 16:07:49 -05:00
join_hash.out Increase hash_mem_multiplier default to 2.0. 2022-02-16 18:41:52 -08:00
join.out Remove bogus Assert and dead code in remove_useless_results_recurse(). 2022-11-29 10:52:44 -05:00
json_encoding_1.out Convert json_in and jsonb_in to report errors softly. 2022-12-11 11:28:15 -05:00
json_encoding_2.out
json_encoding.out Convert json_in and jsonb_in to report errors softly. 2022-12-11 11:28:15 -05:00
json.out Convert json_in and jsonb_in to report errors softly. 2022-12-11 11:28:15 -05:00
jsonb_jsonpath.out
jsonb.out Fix jsonb subscripting to cope with toasted subscript values. 2022-12-12 16:17:54 -05:00
jsonpath_encoding_1.out
jsonpath_encoding_2.out
jsonpath_encoding.out
jsonpath.out Tweak detail and hint messages to be consistent with project policy 2022-07-20 09:50:12 +09:00
largeobject_1.out Prevent write operations on large objects in read-only transactions 2022-07-04 15:48:52 +09:00
largeobject.out Prevent write operations on large objects in read-only transactions 2022-07-04 15:48:52 +09:00
limit.out Error out if SKIP LOCKED and WITH TIES are both specified 2021-10-01 18:29:18 -03:00
line.out
lock.out Add support for security invoker views. 2022-03-22 10:28:10 +00:00
lseg.out
macaddr8.out
macaddr.out
matview.out Show 'AS "?column?"' explicitly when it's important. 2022-05-21 14:45:58 -04:00
md5.out Put tests of md5() function into separate test file 2022-10-13 12:02:31 +02:00
memoize.out Fix Memoize to work with partitionwise joining. 2022-12-05 12:36:40 -05:00
merge.out Update MERGE docs to mention that ONLY is supported. 2022-12-09 10:00:01 +00:00
misc_functions.out Add some tests to check the SQL functions of control file 2022-10-27 09:58:44 +09:00
misc_sanity.out Replace explicit PIN entries in pg_depend with an OID range test. 2021-07-15 11:41:47 -04:00
misc.out Rearrange core regression tests to reduce cross-script dependencies. 2022-02-08 15:30:38 -05:00
money.out
multirangetypes.out Add range_agg with multirange inputs 2022-03-30 20:16:23 +02:00
mvcc.out Fix typo in MVCC test comment 2022-08-25 10:31:20 +02:00
name.out
namespace.out
numeric_big.out Improve the accuracy of numeric power() for integer exponents. 2022-10-20 10:10:17 +01:00
numeric.out Convert a few datatype input functions to use "soft" error reporting. 2022-12-09 10:14:53 -05:00
numerology.out Reject trailing junk after numeric literals 2022-02-16 10:37:31 +01:00
object_address.out Make object_address test output easier to update 2022-11-18 16:00:52 +01:00
oid.out
oidjoins.out Revert 56-bit relfilenode change and follow-up commits. 2022-09-28 09:55:28 -04:00
opr_sanity.out Revert SQL/JSON features 2022-09-01 17:07:14 -04:00
partition_aggregate.out Revert "Optimize order of GROUP BY keys". 2022-10-03 10:56:16 -04:00
partition_info.out
partition_join.out Avoid making commutatively-duplicate clauses in EquivalenceClasses. 2022-10-27 14:42:18 -04:00
partition_prune.out Change the name of the Result Cache node to Memoize 2021-07-14 12:43:58 +12:00
password.out
path.out
pg_lsn.out
plancache.out
plpgsql.out Tighten enforcement of variable CONSTANT markings in plpgsql. 2022-04-30 11:54:28 -04:00
point.out Rearrange core regression tests to reduce cross-script dependencies. 2022-02-08 15:30:38 -05:00
polygon.out
polymorphism.out Fix bugs in polymorphic-argument resolution for multiranges. 2021-07-27 15:01:49 -04:00
portals_p2.out
portals.out Fix incorrect logic in HaveRegisteredOrActiveSnapshot(). 2022-04-16 16:04:50 -04:00
prepare.out Fix pg_prepared_statements.result_types for DML statements 2022-07-05 10:26:36 +02:00
prepared_xacts_1.out Fix check for conflicting session- vs transaction-level locks. 2021-07-24 18:35:52 -04:00
prepared_xacts.out Fix check for conflicting session- vs transaction-level locks. 2021-07-24 18:35:52 -04:00
privileges.out Provide non-superuser predefined roles for vacuum and analyze 2022-11-28 12:08:14 -05:00
psql_crosstab.out Change return type of EXTRACT to numeric 2021-04-06 07:20:42 +02:00
psql.out Add USER SET parameter values for pg_db_role_setting 2022-12-09 13:12:20 +03:00
publication.out Improve some publication-related error messages 2022-09-27 14:11:31 +02:00
random.out
rangefuncs.out Close old gap in dependency checks for functions returning composite. 2022-07-22 12:46:42 -04:00
rangetypes.out Rearrange core regression tests to reduce cross-script dependencies. 2022-02-08 15:30:38 -05:00
regex.out Fix regexp misbehavior with capturing parens inside "{0}". 2021-08-24 16:37:26 -04:00
regproc.out
reindex_catalog.out
reloptions.out Try to stabilize reloptions test, again. 2022-01-20 23:10:40 +13:00
replica_identity.out Block ALTER TABLE .. DROP NOT NULL on columns in replica identity index 2021-11-25 15:04:56 +09:00
returning.out
roleattributes.out
rowsecurity.out Remove logic for converting a table to a view. 2022-12-02 12:14:32 -05:00
rowtypes.out Convert a few datatype input functions to use "soft" error reporting. 2022-12-09 10:14:53 -05:00
rules.out Rework query relation permission checking 2022-12-06 16:09:24 +01:00
sanity_check.out Test ALIGNOF_DOUBLE==4 compatibility under ALIGNOF_DOUBLE==8. 2022-04-22 20:20:11 -07:00
security_label.out
select_distinct_on.out Use Limit instead of Unique to implement DISTINCT, when possible 2022-10-28 23:04:38 +13:00
select_distinct.out Use Limit instead of Unique to implement DISTINCT, when possible 2022-10-28 23:04:38 +13:00
select_having_1.out
select_having_2.out
select_having.out
select_implicit_1.out
select_implicit_2.out
select_implicit.out
select_into.out Rearrange core regression tests to reduce cross-script dependencies. 2022-02-08 15:30:38 -05:00
select_parallel.out Add proper regression test for the recent SRFs-in-pathkeys problem. 2022-08-04 11:11:33 -04:00
select_views.out
select.out Fix core dump in transformValuesClause when there are no columns. 2022-05-09 14:15:37 -04:00
sequence.out Unlogged sequences 2022-04-07 16:18:00 +02:00
spgist.out Avoid loss of code coverage with unlogged-index test cases. 2022-09-25 13:10:17 -04:00
stats_ext.out Fix planner failure with extended statistics on partitioned tables. 2022-11-01 14:34:44 -04:00
stats.out Fix initialization of pg_stat_get_lastscan() 2022-11-08 10:50:09 +09:00
strings.out Put tests of md5() function into separate test file 2022-10-13 12:02:31 +02:00
subscription.out Improve the WARNING message for CREATE SUBSCRIPTION. 2022-10-13 06:09:43 +05:30
subselect.out Improve ruleutils' printout of LATERAL references within subplans. 2022-11-16 20:06:09 -05:00
sysviews.out Revert "Optimize order of GROUP BY keys". 2022-10-03 10:56:16 -04:00
tablesample.out Fix some anomalies with NO SCROLL cursors. 2021-09-10 13:18:32 -04:00
tablespace.out Add regression tests for ALTER MATERIALIZED VIEW with tablespaces 2022-03-19 17:28:50 +09:00
temp.out
test_setup.out Test ALIGNOF_DOUBLE==4 compatibility under ALIGNOF_DOUBLE==8. 2022-04-22 20:20:11 -07:00
text.out Rearrange core regression tests to reduce cross-script dependencies. 2022-02-08 15:30:38 -05:00
tid.out Eliminate duplicate code in table.c. 2022-07-26 08:22:53 +05:30
tidrangescan.out
tidscan.out Avoid making commutatively-duplicate clauses in EquivalenceClasses. 2022-10-27 14:42:18 -04:00
time.out Convert datetime input functions to use "soft" error reporting. 2022-12-09 16:07:49 -05:00
timestamp.out Convert datetime input functions to use "soft" error reporting. 2022-12-09 16:07:49 -05:00
timestamptz.out Convert datetime input functions to use "soft" error reporting. 2022-12-09 16:07:49 -05:00
timetz.out Convert datetime input functions to use "soft" error reporting. 2022-12-09 16:07:49 -05:00
transactions.out Introduce GUC_NO_RESET flag. 2022-09-27 11:47:12 -04:00
triggers.out Correct error message for row-level triggers with transition tables on partitioned tables. 2022-11-04 19:15:00 +09:00
truncate.out
tsdicts.out
tsearch.out Rearrange core regression tests to reduce cross-script dependencies. 2022-02-08 15:30:38 -05:00
tsrf.out
tstypes.out Disallow making an empty lexeme via array_to_tsvector(). 2021-11-06 13:28:53 -04:00
tuplesort.out Improve performance of ORDER BY / DISTINCT aggregates 2022-08-02 23:11:45 +12:00
txid.out
type_sanity.out Put typtype letters back into consistent order 2022-02-22 10:11:38 +01:00
typed_table.out
unicode_1.out
unicode.out Fix buffer overrun in unicode string normalization with empty input 2021-11-11 15:00:59 +09:00
union.out Give better hints for ambiguous or unreferenceable columns. 2022-11-22 18:46:31 -05:00
updatable_views.out Yet further fixes for multi-row VALUES lists for updatable views. 2022-10-11 18:24:14 -04:00
update.out Fix mishandling of resjunk columns in ON CONFLICT ... UPDATE tlists. 2021-05-10 11:02:29 -04:00
uuid.out
vacuum_parallel.out Don't overlook indexes during parallel VACUUM. 2021-11-02 12:06:17 -07:00
vacuum.out Provide per-table permissions for vacuum and analyze. 2022-11-28 12:08:14 -05:00
varchar_1.out Rearrange core regression tests to reduce cross-script dependencies. 2022-02-08 15:30:38 -05:00
varchar_2.out Rearrange core regression tests to reduce cross-script dependencies. 2022-02-08 15:30:38 -05:00
varchar.out Rearrange core regression tests to reduce cross-script dependencies. 2022-02-08 15:30:38 -05:00
window.out Remove uses of MemoryContextContains in nodeAgg.c and nodeWindowAgg.c. 2022-10-06 13:27:34 -04:00
with.out Fix EXPLAIN of SEARCH BREADTH FIRST with a constant initial value. 2022-10-16 19:18:08 -04:00
write_parallel.out Enable parallelism in REFRESH MATERIALIZED VIEW. 2021-03-17 15:04:17 +13:00
xid.out Add min() and max() aggregates for xid8. 2022-02-10 12:33:41 +09:00
xml_1.out Adjust XML test case to avoid unstable behavior. 2022-08-31 22:21:39 -04:00
xml_2.out Adjust XML test case to avoid unstable behavior. 2022-08-31 22:21:39 -04:00
xml.out Adjust XML test case to avoid unstable behavior. 2022-08-31 22:21:39 -04:00
xmlmap_1.out Remove error message hints mentioning configure options 2022-04-08 07:41:55 +02:00
xmlmap.out Fix incorrect xmlschema output for types timetz and timestamptz. 2022-03-18 16:01:42 -04:00