1
0
mirror of https://github.com/pgvector/pgvector.git synced 2026-10-23 10:48:54 +03:00

Added check for left/right input types to amvalidate functions - closes #1045 [skip ci]

This commit is contained in:
Andrew Kane
2026-10-22 13:47:38 -07:00
parent b28edffe33
commit cbcf35510d
2 changed files with 22 additions and 0 deletions

View File

@@ -305,6 +305,17 @@ hnswvalidate(Oid opclassoid)
Form_pg_amproc procform = (Form_pg_amproc) GETSTRUCT(proctup);
bool ok;
/* Check matching left/right types */
if (procform->amproclefttype != procform->amprocrighttype)
{
ereport(INFO,
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
errmsg("operator family \"%s\" of access method %s contains support function %s with different left and right input types",
opfamilyname, "hnsw",
format_procedure(procform->amproc))));
result = false;
}
/* Check procedure numbers and function signatures */
switch (procform->amprocnum)
{

View File

@@ -222,6 +222,17 @@ ivfflatvalidate(Oid opclassoid)
Form_pg_amproc procform = (Form_pg_amproc) GETSTRUCT(proctup);
bool ok;
/* Check matching left/right types */
if (procform->amproclefttype != procform->amprocrighttype)
{
ereport(INFO,
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
errmsg("operator family \"%s\" of access method %s contains support function %s with different left and right input types",
opfamilyname, "ivfflat",
format_procedure(procform->amproc))));
result = false;
}
/* Check procedure numbers and function signatures */
switch (procform->amprocnum)
{