Re: pgsql: Add Result Cache executor node (take 2)

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: pgsql: Add Result Cache executor node (take 2)
Дата
Msg-id 20210402204734.6mo3nfacnljlicgn@alap3.anarazel.de
обсуждение исходный текст
Ответ на pgsql: Add Result Cache executor node (take 2)  (David Rowley <drowley@postgresql.org>)
Ответы Re: pgsql: Add Result Cache executor node (take 2)  (David Rowley <dgrowleyml@gmail.com>)
Список pgsql-committers
Hi,

On 2021-04-02 01:11:35 +0000, David Rowley wrote:
> Add Result Cache executor node (take 2)

Since this commit I am seeing

In file included from /home/andres/src/postgresql/src/include/postgres.h:46,
                 from /home/andres/src/postgresql/src/backend/executor/nodeResultCache.c:67:
/home/andres/src/postgresql/src/backend/executor/nodeResultCache.c: In function ‘entry_purge_tuples’:
/home/andres/src/postgresql/src/backend/executor/nodeResultCache.c:290:27: warning: comparison of unsigned expression
in‘>= 0’ is always true [-Wtype-limits]
 
  290 |  Assert(rcstate->mem_used >= 0);
      |                           ^~
/home/andres/src/postgresql/src/include/c.h:848:9: note: in definition of macro ‘Assert’
  848 |   if (!(condition)) \
      |         ^~~~~~~~~
/home/andres/src/postgresql/src/backend/executor/nodeResultCache.c: In function ‘remove_cache_entry’:
/home/andres/src/postgresql/src/backend/executor/nodeResultCache.c:349:27: warning: comparison of unsigned expression
in‘>= 0’ is always true [-Wtype-limits]
 
  349 |  Assert(rcstate->mem_used >= 0);
      |                           ^~
/home/andres/src/postgresql/src/include/c.h:848:9: note: in definition of macro ‘Assert’
  848 |   if (!(condition)) \
      |         ^~~~~~~~~

Now, it's a bit of an over-pedantic warning, but it's also kinda right,
ensuring that a variable that cannot be negative is bigger than 0 is a
bit redundant.

Greetings,

Andres Freund



В списке pgsql-committers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: pgsql: Use macro MONTHS_PER_YEAR instead of '12' in /ecpg/pgtypeslib
Следующее
От: David Rowley
Дата:
Сообщение: pgsql: Remove useless Asserts in Result Cache code