mirror of
https://github.com/postgres/postgres.git
synced 2025-05-12 16:21:30 +03:00
Return valid json when converting an empty hstore.
Oskari Saarenmaa.
This commit is contained in:
parent
41b46ed8a2
commit
bfb327ac1d
@ -1240,11 +1240,7 @@ hstore_to_json_loose(PG_FUNCTION_ARGS)
|
|||||||
dst;
|
dst;
|
||||||
|
|
||||||
if (count == 0)
|
if (count == 0)
|
||||||
{
|
PG_RETURN_TEXT_P(cstring_to_text_with_len("{}",2));
|
||||||
out = palloc(1);
|
|
||||||
*out = '\0';
|
|
||||||
PG_RETURN_TEXT_P(cstring_to_text(out));
|
|
||||||
}
|
|
||||||
|
|
||||||
buflen = 3;
|
buflen = 3;
|
||||||
|
|
||||||
@ -1369,11 +1365,7 @@ hstore_to_json(PG_FUNCTION_ARGS)
|
|||||||
dst;
|
dst;
|
||||||
|
|
||||||
if (count == 0)
|
if (count == 0)
|
||||||
{
|
PG_RETURN_TEXT_P(cstring_to_text_with_len("{}",2));
|
||||||
out = palloc(1);
|
|
||||||
*out = '\0';
|
|
||||||
PG_RETURN_TEXT_P(cstring_to_text(out));
|
|
||||||
}
|
|
||||||
|
|
||||||
buflen = 3;
|
buflen = 3;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user