postgresql/src/backend/catalog
Tom Lane 9d6d8d7049 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
Catalog.pm Initial pgindent and pgperltidy run for v14. 2021-05-12 13:14:10 -04:00
Makefile Split function definitions out of system_views.sql into a new file. 2021-04-16 18:37:02 -04:00
aclchk.c Fix come incorrect elog() messages in aclchk.c 2022-12-23 10:04:33 +09:00
catalog.c Message style improvements 2021-06-28 08:36:44 +02:00
dependency.c Change some errdetail() to errdetail_internal() 2022-09-28 17:14:53 +02:00
genbki.pl Pre branch pgindent / pgperltidy run 2021-06-28 11:05:54 -04:00
heap.c Replace RelationOpenSmgr() with RelationGetSmgr(). 2022-11-17 16:54:30 -05:00
index.c Fix checking of index expressions in CompareIndexInfo(). 2023-09-28 14:05:25 -04:00
indexing.c Fix comment in indexing.c 2021-03-17 18:07:00 +09:00
information_schema.sql Add DISTINCT to information schema usage views 2021-04-21 11:54:47 +02:00
namespace.c Recalculate search_path after ALTER ROLE. 2023-08-07 15:12:33 -07:00
objectaccess.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
objectaddress.c Fix lookup error in extended stats ownership check 2021-08-31 18:36:06 +02:00
partition.c ALTER TABLE ... DETACH PARTITION ... CONCURRENTLY 2021-03-25 18:00:28 -03:00
pg_aggregate.c Reconsider the handling of procedure OUT parameters. 2021-06-10 17:11:36 -04:00
pg_cast.c Update copyright for 2021 2021-01-02 13:06:25 -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 2021 2021-01-02 13:06:25 -05:00
pg_db_role_setting.c Update copyright for 2021 2021-01-02 13:06:25 -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 Rename "enum blacklist" to "uncommitted enums". 2021-01-05 12:38:48 +13:00
pg_inherits.c Message style improvements 2021-06-28 08:36:44 +02:00
pg_largeobject.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
pg_namespace.c Update copyright for 2021 2021-01-02 13:06:25 -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_proc.c Avoid crash after function syntax error in a replication worker. 2022-11-03 12:01:57 -04:00
pg_publication.c Fix double publish of child table's data. 2021-12-09 08:49:50 +05:30
pg_range.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
pg_shdepend.c Avoid leaking memory during large-scale REASSIGN OWNED BY operations. 2021-12-01 13:44:47 -05:00
pg_subscription.c Initial pgindent and pgperltidy run for v14. 2021-05-12 13:14:10 -04:00
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 Fix use of cursor sensitivity terminology 2021-04-07 08:05:55 +02:00
storage.c Replace RelationOpenSmgr() with RelationGetSmgr(). 2022-11-17 16:54:30 -05:00
system_functions.sql Remove pg_wait_for_backend_termination(). 2021-06-14 17:29:37 -07:00
system_views.sql Fix incorrect permissions on pg_subscription. 2021-06-03 14:54:06 -04:00
toasting.c Fix toast rewrites in logical decoding. 2021-08-25 10:10:50 +05:30