pgsql: Fix psql's code for locale-aware formatting of numeric output.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Fix psql's code for locale-aware formatting of numeric output.
Дата
Msg-id E1ZfJGX-0005lq-Ua@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix psql's code for locale-aware formatting of numeric output.

This code did the wrong thing entirely for numbers with an exponent
but no decimal point (e.g., '1e6'), as reported by Jeff Janes in
bug #13636.  More generally, it made lots of unverified assumptions
about what the input string could possibly look like.  Rearrange so
that it only fools with leading digits that it's directly verified
are there, and an immediately adjacent decimal point.  While at it,
get rid of some useless inefficiencies, like converting the grouping
count string to integer over and over (and over).

This has been broken for a long time, so back-patch to all supported
branches.

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/7e327ecd2b4e4ded1c4375a085bdf34e08885ee6

Modified Files
--------------
src/bin/psql/print.c |  102 ++++++++++++++++++++++----------------------------
1 file changed, 45 insertions(+), 57 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix psql's code for locale-aware formatting of numeric output.
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix psql's code for locale-aware formatting of numeric output.