BUG #13906: improper hstore_to_json_loose functioning

Started by Dmitry Ryabovabout 10 years ago2 messagesbugs
Jump to latest
#1Dmitry Ryabov
dmitry-ryabov@mail.ru

The following bug has been logged on the website:

Bug reference: 13906
Logged by: Dmitry Ryabov
Email address: dmitry-ryabov@mail.ru
PostgreSQL version: 9.4.5
Operating system: any
Description:

select hstore_to_json_loose(hstore('abc', '2016-01-01'))

any date/time/timestamp interpreted as the number

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

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Dmitry Ryabov (#1)
Re: BUG #13906: improper hstore_to_json_loose functioning

dmitry-ryabov@mail.ru writes:

select hstore_to_json_loose(hstore('abc', '2016-01-01'))
any date/time/timestamp interpreted as the number

Yeah, that's broken all right. Looking more closely, the combination of
IsValidJsonNumber and json_lex_number will fail to notice trailing junk
that is not part of a number unless that junk is (or at least begins with)
an alphanumeric. The "-" here breaks that.

Will fix, thanks for the report!

regards, tom lane

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