Wrong comment in statscmds.c/CreateStatistics?

Поиск
Список
Период
Сортировка
От Peter Smith
Тема Wrong comment in statscmds.c/CreateStatistics?
Дата
Msg-id CAHut+PvaWgJbBTF-PX_7gKCLP=ExtP934c0HFtVe3_7BdWiC_g@mail.gmail.com
обсуждение исходный текст
Ответы Re: Wrong comment in statscmds.c/CreateStatistics?  (Junwang Zhao <zhjwpku@gmail.com>)
Список pgsql-hackers
I happened to notice the following code in
src/backend/commands/statscmds.c, CreateStatistics:

======
/*
* Parse the statistics kinds.
*
* First check that if this is the case with a single expression, there
* are no statistics kinds specified (we don't allow that for the simple
* CREATE STATISTICS form).
*/
if ((list_length(stmt->exprs) == 1) && (list_length(stxexprs) == 1))
{
/* statistics kinds not specified */
if (list_length(stmt->stat_types) > 0)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("when building statistics on a single expression, statistics
kinds may not be specified")));
}
======


AFAICT that one-line comment (/* statistics kinds not specified */) is
wrong because at that point we don't yet know if kinds are specified
or not.

SUGGESTION-1
Change the comment to /* Check there are no statistics kinds specified */

SUGGESTION-2
Simply remove that one-line comment because the larger comment seems
to be saying the same thing anyhow.

Thoughts?

------
Kind Regards,
Peter Smith.
Fujitsu Australia



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: SQL/JSON features for v15
Следующее
От: Nikita Glukhov
Дата:
Сообщение: Re: SQL/JSON features for v15