Re: [HACKERS] BUG #12070: hstore extension: hstore_to_json_loose produces invalid JSON

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, bouda(at)edookit(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] BUG #12070: hstore extension: hstore_to_json_loose produces invalid JSON
Date: 2014-11-26 17:03:16
Message-ID: 547607D4.7030508@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs 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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message John R Pierce 2014-11-26 17:16:48 Re: Fwd: Rocks 6.1.1 with JDBC connection - What should be wrong?
Previous Message Andrew Dunstan 2014-11-26 16:48:00 Re: [HACKERS] BUG #12070: hstore extension: hstore_to_json_loose produces invalid JSON

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2014-11-26 17:38:18 Re: [pgsql-packagers] Palle Girgensohn's ICU patch
Previous Message Andrew Dunstan 2014-11-26 16:48:00 Re: [HACKERS] BUG #12070: hstore extension: hstore_to_json_loose produces invalid JSON