From 236bb2c671b00891d7d010a2a38e22894819987d Mon Sep 17 00:00:00 2001 From: Ben Franksen Date: Fri, 15 Jan 2021 14:59:33 +0100 Subject: [PATCH] fix an out-dated comment in the array filter code --- modules/database/src/std/filters/arr.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/modules/database/src/std/filters/arr.c b/modules/database/src/std/filters/arr.c index 5f251844a..ffe3fce8f 100644 --- a/modules/database/src/std/filters/arr.c +++ b/modules/database/src/std/filters/arr.c @@ -128,19 +128,7 @@ static db_field_log* filter(void* pvt, dbChannel *chan, db_field_log *pfl) pfl->u.r.dtor = freeArray; pfl->u.r.pvt = my->arrayFreeList; } - /* Adjust no_elements to refer to the new pTarget. - * - * Setting pfl->no_elements outside of the "if" clause above is - * done to make requests fail if nTarget is zero, that is, if all - * elements selected by the filter are outside the array bounds. - * TODO: - * It would be possible to lift this restriction by interpreting - * a request with *no* number of elements (NULL pointer) as scalar - * (meaning: fail if we get less than one element); in contrast, - * a request that explicitly specifies one element would be - * interpreted as an array request, for which zero elements would - * be a normal expected result. - */ + /* adjust no_elements (even if zero elements remain) */ pfl->no_elements = nTarget; if (must_lock) dbScanUnlock(dbChannelRecord(chan));