postgresql/src/backend/catalog
Tom Lane 59371f1aeb Fix checking of index expressions in CompareIndexInfo().
This code was sloppy about comparison of index columns that
are expressions.  It didn't reliably reject cases where one
index has an expression where the other has a plain column,
and it could index off the start of the attmap array, leading
to a Valgrind complaint (though an actual crash seems unlikely).

I'm not sure that the expression-vs-column sloppiness leads
to any visible problem in practice, because the subsequent
comparison of the two expression lists would reject cases
where the indexes have different numbers of expressions
overall.  Maybe we could falsely match indexes having the
same expressions in different column positions, but it'd
require unlucky contents of the word before the attmap array.
It's not too surprising that no problem has been reported
from the field.  Nonetheless, this code is clearly wrong.

Per bug #18135 from Alexander Lakhin.  Back-patch to all
supported branches.

Discussion: https://postgr.es/m/18135-532f4a755e71e4d2@postgresql.org
2023-09-28 14:05:25 -04:00
..
.gitignore Build in some knowledge about foreign-key relationships in the catalogs. 2021-02-02 17:11:55 -05:00
aclchk.c Fix come incorrect elog() messages in aclchk.c 2022-12-23 10:04:30 +09:00
catalog.c Rethink method for assigning OIDs to the template0 and postgres DBs. 2022-04-21 16:23:15 -04:00
Catalog.pm Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
dependency.c Change some errdetail() to errdetail_internal() 2022-09-28 17:14:53 +02:00
genbki.pl Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
heap.c pgstat: Fix transactional stats dropping for indexes 2022-09-23 13:13:50 -07:00
index.c Fix checking of index expressions in CompareIndexInfo(). 2023-09-28 14:05:25 -04:00
indexing.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
information_schema.sql Fix bogus dependency handling for GENERATED expressions. 2022-03-21 14:58:49 -04:00
Makefile Allow granting SET and ALTER SYSTEM privileges on GUC parameters. 2022-04-06 13:24:33 -04:00
namespace.c Recalculate search_path after ALTER ROLE. 2023-08-07 15:12:49 -07:00
objectaccess.c Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
objectaddress.c Tighten pg_get_object_address argument checking 2022-09-21 09:42:22 -04:00
partition.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_aggregate.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_attrdef.c Remove extraneous blank lines before block-closing braces 2022-04-13 19:16:02 +02:00
pg_cast.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_class.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_collation.c In extensions, don't replace objects not belonging to the extension. 2022-08-08 11:12:31 -04:00
pg_constraint.c Fix self-referencing foreign keys with partitioned tables 2022-10-07 19:37:48 +02:00
pg_conversion.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_db_role_setting.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_depend.c In extensions, don't replace objects not belonging to the extension. 2022-08-08 11:12:31 -04:00
pg_enum.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_inherits.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_largeobject.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_namespace.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_operator.c In extensions, don't replace objects not belonging to the extension. 2022-08-08 11:12:31 -04:00
pg_parameter_acl.c Allow granting SET and ALTER SYSTEM privileges on GUC parameters. 2022-04-06 13:24:33 -04:00
pg_proc.c Avoid crash after function syntax error in a replication worker. 2022-11-03 12:01:57 -04:00
pg_publication.c Message style improvements 2022-09-24 18:38:35 -04:00
pg_range.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_shdepend.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_subscription.c Reorder subskiplsn in pg_subscription to avoid alignment issues. 2022-04-07 09:39:25 +05:30
pg_type.c In extensions, don't replace objects not belonging to the extension. 2022-08-08 11:12:31 -04:00
sql_feature_packages.txt Cleanup in SQL features files 2020-03-28 08:46:18 +01:00
sql_features.txt Revert SQL/JSON features 2022-09-01 17:10:42 -04:00
storage.c Add 'static' to file-local variables missing it. 2022-05-12 12:39:33 -07:00
system_functions.sql pgstat: add pg_stat_have_stats() test helper. 2022-04-07 00:21:54 -07:00
system_views.sql Fix new pg_publication_tables query. 2022-09-06 18:00:32 -04:00
toasting.c Add UNIQUE null treatment option 2022-02-03 11:48:21 +01:00