Re: [HACKERS] Small patch for pg_basebackup argument parsing

Поиск
Список
Период
Сортировка
От Pierre Ducroquet
Тема Re: [HACKERS] Small patch for pg_basebackup argument parsing
Дата
Msg-id 4118888.2l8e7bj9bN@peanuts2
обсуждение исходный текст
Ответ на Re: [HACKERS] Small patch for pg_basebackup argument parsing  (Michael Paquier <michael.paquier@gmail.com>)
Ответы Re: [HACKERS] Small patch for pg_basebackup argument parsing
Список pgsql-hackers
On Friday, April 14, 2017 8:44:37 AM CEST Michael Paquier wrote:
> On Fri, Apr 14, 2017 at 6:32 AM, Pierre Ducroquet <p.psql@pinaraf.info>
wrote:
> > Yesterday while doing a few pg_basebackup, I realized that the integer
> > parameters were not properly checked against invalid input.
> > It is not a critical issue, but this could be misleading for an user who
> > writes -z max or -s 0.5…
> > I've attached the patch to this mail. Should I add it to the next commit
> > fest or is it not needed for such small patches ?
>
> A call to atoi is actually equivalent to strtol with the rounding:
> (int)strtol(str, (char **)NULL, 10);
> So I don't think this is worth caring.

The problem with atoi is that it simply ignores any invalid input and returns
0 instead.
That's why I did this patch, because I did a typo when calling pg_basebackup
and was not warned for an invalid input.
But it doesn't matter that much, so if you don't think that's interesting, no
problem.

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

Предыдущее
От: Kyotaro HORIGUCHI
Дата:
Сообщение: Re: [HACKERS] Interval for launching the table sync worker
Следующее
От: Amit Langote
Дата:
Сообщение: [HACKERS] Minor typo in partition.c