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:
11
src/hnsw.c
11
src/hnsw.c
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user