mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-04 11:40:57 +08:00
Added checks for invalid indexes - #591
This commit is contained in:
@@ -170,7 +170,11 @@ IvfflatGetMetaPageInfo(Relation index, int *lists, int *dimensions)
|
||||
page = BufferGetPage(buf);
|
||||
metap = IvfflatPageGetMeta(page);
|
||||
|
||||
*lists = metap->lists;
|
||||
if (unlikely(metap->magicNumber != IVFFLAT_MAGIC_NUMBER))
|
||||
elog(ERROR, "ivfflat index is not valid");
|
||||
|
||||
if (lists != NULL)
|
||||
*lists = metap->lists;
|
||||
|
||||
if (dimensions != NULL)
|
||||
*dimensions = metap->dimensions;
|
||||
|
||||
Reference in New Issue
Block a user