From 7c8107f30bc093dc83bd2c5e81f9e2900164b552 Mon Sep 17 00:00:00 2001 From: Alexander Kuzmenkov <36882414+akuzm@users.noreply.github.com> Date: Tue, 5 Nov 2024 16:12:12 +0100 Subject: [PATCH] more --- src/chunk_index.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/chunk_index.c b/src/chunk_index.c index 6c68538b252..35b9d16d63e 100644 --- a/src/chunk_index.c +++ b/src/chunk_index.c @@ -1185,6 +1185,9 @@ Datum ts_chunk_index_clone(PG_FUNCTION_ARGS) { Oid chunk_index_oid = PG_GETARG_OID(0); + if (!OidIsValid(chunk_index_oid)) + ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("invalid chunk index"))); + Relation chunk_index_rel; Relation hypertable_rel; Relation chunk_rel; @@ -1228,7 +1231,13 @@ Datum ts_chunk_index_replace(PG_FUNCTION_ARGS) { Oid chunk_index_oid_old = PG_GETARG_OID(0); + if (!OidIsValid(chunk_index_oid_old)) + ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("invalid chunk index"))); + Oid chunk_index_oid_new = PG_GETARG_OID(1); + if (!OidIsValid(chunk_index_oid_new)) + ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("invalid chunk index"))); + Relation index_rel; Chunk *chunk; ChunkIndexMapping cim;