Re: [HACKERS] Fix number skipping in to_number

Поиск
Список
Период
Сортировка
От Oliver Ford
Тема Re: [HACKERS] Fix number skipping in to_number
Дата
Msg-id CAGMVOdtMSdaRPV0Nw7pOUoyFhjMrNi9XmFyC5-PTD78LGUokzg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] Fix number skipping in to_number  (Thomas Munro <thomas.munro@enterprisedb.com>)
Ответы Re: [HACKERS] Fix number skipping in to_number  (Thomas Munro <thomas.munro@enterprisedb.com>)
Список pgsql-hackers
> The tests you added pass for me but the int8 test now fails with the
> following (this is from regression.diff after running
> 'PG_REGRESS_DIFF_OPTS="-dU10" make check').  It looks like some new
> whitespace is appearing on the right in the output of to_char().  I
> didn't try to understand why.
>
> @@ -453,34 +453,34 @@
>  ------------------+------------------
>   4567890123456789 | 4567890123456789
>  (1 row)
>
>  -- TO_CHAR()
>  --
>  SELECT '' AS to_char_1, to_char(q1, '9G999G999G999G999G999'),
> to_char(q2, '9,999,999,999,999,999')
>         FROM INT8_TBL;
>   to_char_1 |        to_char         |        to_char
>  -----------+------------------------+------------------------
> -           |                    123 |                    456
> +           |                    123 |               456
>             |                    123 |  4,567,890,123,456,789
> -           |  4,567,890,123,456,789 |                    123
> +           |  4,567,890,123,456,789 |               123
>             |  4,567,890,123,456,789 |  4,567,890,123,456,789
>             |  4,567,890,123,456,789 | -4,567,890,123,456,789
>  (5 rows)
>
>  SELECT '' AS to_char_2, to_char(q1, '9G999G999G999G999G999D999G999'),
> to_char(q2, '9,999,999,999,999,999.999,999')
>         FROM INT8_TBL;
>   to_char_2 |            to_char             |            to_char
>  -----------+--------------------------------+--------------------------------
> -           |                    123.000,000 |                    456.000,000
> +           |                    123.000,000 |               456.000,000
>             |                    123.000,000 |  4,567,890,123,456,789.000,000
> -           |  4,567,890,123,456,789.000,000 |                    123.000,000
> +           |  4,567,890,123,456,789.000,000 |               123.000,000
>             |  4,567,890,123,456,789.000,000 |  4,567,890,123,456,789.000,000
>             |  4,567,890,123,456,789.000,000 | -4,567,890,123,456,789.000,000
>  (5 rows)
>
>  SELECT '' AS to_char_3, to_char( (q1 * -1), '9999999999999999PR'),
> to_char( (q2 * -1), '9999999999999999.999PR')
>         FROM INT8_TBL;
>   to_char_3 |      to_char       |        to_char
>  -----------+--------------------+------------------------
>             |              <123> |              <456.000>
>             |              <123> | <4567890123456789.000>
>

That's strange, I can't replicate that issue on my Windows build. I've
tried with 'PG_REGRESS_DIFF_OPTS="-dU10" make check' and all the tests
(including int8) pass fine. The spacing in the results is perfectly
normal. I wonder if something else on your build is causing this? I've
also tried several "make check" options for different locales
mentioned in the docs and they pass fine.

>
> One superficial comment after first glimpse at the patch:
>
> +    if(!strncmp(Np->inout_p, Np->L_thousands_sep, separator_len))
>
> I believe the usual coding around here would be if (strncmp(...) == 0)
>

Yes you're right, that is the coding standard. I've changed it to that
in the attached v2.

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Вложения

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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: [HACKERS] recovery_target_time = 'now' is not an error but stillimpractical setting
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: [HACKERS] [BUGS] [postgresql 10 beta3] unrecognized node type: 90