Re: to_timestamp not stable if date string shorter than

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: to_timestamp not stable if date string shorter than
Дата
Msg-id 6946.1062562547@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: to_timestamp not stable if date string shorter than  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Ответы Re: to_timestamp not stable if date string shorter than  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Список pgsql-bugs
Stephan Szabo <sszabo@megazone.bigpanda.com> writes:
> Replying to myself again:
> In DCH_processor (formatting.c), it doesn't seem to stop if it's in the
> middle of processing nodes but runs off the inout string, should the for
> loop be something like:
>  for (n=node,s=inout;n->type!=NODE_TYPE_END && *s!='\0';++n,++s) {
> and get rid of the ++s at the bottom of the loop for safety?

That wouldn't change the behavior, would it?

The code is definitely running off the end of the input string.  I am
tempted to suggest that the "++s" at the bottom of the loop should
become
    if (*s)
        ++s;
but I'm not sure enough of the intentions of this code to recommend
that as a full fix.  Karel, the ball's in your court ...

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: to_timestamp not stable if date string shorter than
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: to_timestamp not stable if date string shorter than