From e005b524762b7c0616d11f7b5f27962fcf5e5951 Mon Sep 17 00:00:00 2001 From: Andrew Dunstan Date: Sun, 16 Mar 2014 08:18:37 -0400 Subject: [PATCH] fix field name for estSize in hstore_to_jsonb*. --- contrib/hstore/hstore_io.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/contrib/hstore/hstore_io.c b/contrib/hstore/hstore_io.c index d1067184f9..0035a260fd 100644 --- a/contrib/hstore/hstore_io.c +++ b/contrib/hstore/hstore_io.c @@ -1395,26 +1395,26 @@ hstore_to_jsonb(PG_FUNCTION_ARGS) { JsonbValue key, val; - key.size = sizeof(JEntry); + key.estSize = sizeof(JEntry); key.type = jbvString; key.string.len = HS_KEYLEN(entries, i); key.string.val = pnstrdup(HS_KEY(entries, base, i), key.string.len); - key.size += key.string.len; + key.estSize += key.string.len; res = pushJsonbValue(&state, WJB_KEY, &key); if (HS_VALISNULL(entries, i)) { - val.size = sizeof(JEntry); + val.estSize = sizeof(JEntry); val.type = jbvNull; } else { - val.size = sizeof(JEntry); + val.estSize = sizeof(JEntry); val.type = jbvString; val.string.len = HS_VALLEN(entries, i); val.string.val = pnstrdup(HS_VAL(entries, base, i), val.string.len); - val.size += val.string.len; + val.estSize += val.string.len; } res = pushJsonbValue(&state, WJB_VALUE, &val); } @@ -1447,15 +1447,15 @@ hstore_to_jsonb_loose(PG_FUNCTION_ARGS) { JsonbValue key, val; - key.size = sizeof(JEntry); + key.estSize = sizeof(JEntry); key.type = jbvString; key.string.len = HS_KEYLEN(entries, i); key.string.val = pnstrdup(HS_KEY(entries, base, i), key.string.len); - key.size += key.string.len; + key.estSize += key.string.len; res = pushJsonbValue(&state, WJB_KEY, &key); - val.size = sizeof(JEntry); + val.estSize = sizeof(JEntry); if (HS_VALISNULL(entries, i)) { @@ -1521,15 +1521,15 @@ hstore_to_jsonb_loose(PG_FUNCTION_ARGS) val.type = jbvNumeric; val.numeric = DatumGetNumeric( DirectFunctionCall3(numeric_in, CStringGetDatum(tmp.data), 0, -1)); - val.size += VARSIZE_ANY(val.numeric) +sizeof(JEntry); + val.estSize += VARSIZE_ANY(val.numeric) +sizeof(JEntry); } else { - val.size = sizeof(JEntry); + val.estSize = sizeof(JEntry); val.type = jbvString; val.string.len = HS_VALLEN(entries, i); val.string.val = pnstrdup(HS_VAL(entries, base, i), val.string.len); - val.size += val.string.len; + val.estSize += val.string.len; } } res = pushJsonbValue(&state, WJB_VALUE, &val); -- 2.39.5