Re: Bug in to_timestamp(). - Mailing list pgsql-hackers

From amul sul
Subject Re: Bug in to_timestamp().
Date
Msg-id 1349968951.17422721.1472104390685.JavaMail.yahoo@mail.yahoo.com
Whole thread Raw
In response to Re: Bug in to_timestamp().  (Artur Zakirov <a.zakirov@postgrespro.ru>)
List pgsql-hackers
Hi Artur Zakirov,

0001-to-timestamp-format-checking-v3.patch looks pretty reasonable to me, other than following concern:

#1.
Whitespace @ line # 317.

#2. Warning at compilation;

formatting.c: In function ‘do_to_timestamp’:
formatting.c:3049:37: warning: ‘prev_type’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (prev_type == NODE_TYPE_SPACE || prev_type == NODE_TYPE_SEPARATOR)
^
formatting.c:2988:5: note: ‘prev_type’ was declared here
prev_type;
^

You can avoid this by assigning  zero (or introduce NODE_TYPE_INVAL ) to prev_type at following line:

256 +               prev_type;



Regards,
Amul Sul



pgsql-hackers by date:

Previous
From: Satoshi Nagayasu
Date:
Subject: Re: pg_stat_lwlock wait time view
Next
From: Etsuro Fujita
Date:
Subject: Re: Oddity in EXPLAIN for foreign/custom join pushdown plans