Re: [BUGS] BUG #12070: hstore extension: hstore_to_json_loose produces invalid JSON - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: [BUGS] BUG #12070: hstore extension: hstore_to_json_loose produces invalid JSON
Date
Msg-id 547607D4.7030508@dunslane.net
Whole thread Raw
In response to Re: [BUGS] BUG #12070: hstore extension: hstore_to_json_loose produces invalid JSON  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
On 11/26/2014 11:48 AM, Andrew Dunstan wrote:
>
>
>
>
> In json.c we now check numbers like this:
>
>    JsonLexContext dummy_lex;
>    bool        numeric_error;
>    ...
>    dummy_lex.input = *outputstr == '-' ? outputstr + 1 : outputstr;
>    dummy_lex.input_length = strlen(dummy_lex.input);
>    json_lex_number(&dummy_lex, dummy_lex.input, &numeric_error);
>
> numeric_error is true IFF outputstr is a legal json number.

er is NOT a legal json number

cheers

andrew






pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: [BUGS] BUG #12070: hstore extension: hstore_to_json_loose produces invalid JSON
Next
From: Peter Geoghegan
Date:
Subject: Re: [pgsql-packagers] Palle Girgensohn's ICU patch