Commit 7572b773 authored by Heikki Linnakangas's avatar Heikki Linnakangas

Fix build after removing JsonbValue.estSize field.

Oops, I didn't realize that contrib/hstore refers to jsonb stuff.
parent eee6cf1f
...@@ -1384,26 +1384,21 @@ hstore_to_jsonb(PG_FUNCTION_ARGS) ...@@ -1384,26 +1384,21 @@ hstore_to_jsonb(PG_FUNCTION_ARGS)
JsonbValue key, JsonbValue key,
val; val;
key.estSize = sizeof(JEntry);
key.type = jbvString; key.type = jbvString;
key.val.string.len = HS_KEYLEN(entries, i); key.val.string.len = HS_KEYLEN(entries, i);
key.val.string.val = pnstrdup(HS_KEY(entries, base, i), key.val.string.len); key.val.string.val = pnstrdup(HS_KEY(entries, base, i), key.val.string.len);
key.estSize += key.val.string.len;
res = pushJsonbValue(&state, WJB_KEY, &key); res = pushJsonbValue(&state, WJB_KEY, &key);
if (HS_VALISNULL(entries, i)) if (HS_VALISNULL(entries, i))
{ {
val.estSize = sizeof(JEntry);
val.type = jbvNull; val.type = jbvNull;
} }
else else
{ {
val.estSize = sizeof(JEntry);
val.type = jbvString; val.type = jbvString;
val.val.string.len = HS_VALLEN(entries, i); val.val.string.len = HS_VALLEN(entries, i);
val.val.string.val = pnstrdup(HS_VAL(entries, base, i), val.val.string.len); val.val.string.val = pnstrdup(HS_VAL(entries, base, i), val.val.string.len);
val.estSize += val.val.string.len;
} }
res = pushJsonbValue(&state, WJB_VALUE, &val); res = pushJsonbValue(&state, WJB_VALUE, &val);
} }
...@@ -1436,16 +1431,12 @@ hstore_to_jsonb_loose(PG_FUNCTION_ARGS) ...@@ -1436,16 +1431,12 @@ hstore_to_jsonb_loose(PG_FUNCTION_ARGS)
JsonbValue key, JsonbValue key,
val; val;
key.estSize = sizeof(JEntry);
key.type = jbvString; key.type = jbvString;
key.val.string.len = HS_KEYLEN(entries, i); key.val.string.len = HS_KEYLEN(entries, i);
key.val.string.val = pnstrdup(HS_KEY(entries, base, i), key.val.string.len); key.val.string.val = pnstrdup(HS_KEY(entries, base, i), key.val.string.len);
key.estSize += key.val.string.len;
res = pushJsonbValue(&state, WJB_KEY, &key); res = pushJsonbValue(&state, WJB_KEY, &key);
val.estSize = sizeof(JEntry);
if (HS_VALISNULL(entries, i)) if (HS_VALISNULL(entries, i))
{ {
val.type = jbvNull; val.type = jbvNull;
...@@ -1511,15 +1502,12 @@ hstore_to_jsonb_loose(PG_FUNCTION_ARGS) ...@@ -1511,15 +1502,12 @@ hstore_to_jsonb_loose(PG_FUNCTION_ARGS)
val.val.numeric = DatumGetNumeric( val.val.numeric = DatumGetNumeric(
DirectFunctionCall3(numeric_in, CStringGetDatum(tmp.data), 0, -1)); DirectFunctionCall3(numeric_in, CStringGetDatum(tmp.data), 0, -1));
val.estSize += VARSIZE_ANY(val.val.numeric) +sizeof(JEntry);
} }
else else
{ {
val.estSize = sizeof(JEntry);
val.type = jbvString; val.type = jbvString;
val.val.string.len = HS_VALLEN(entries, i); val.val.string.len = HS_VALLEN(entries, i);
val.val.string.val = pnstrdup(HS_VAL(entries, base, i), val.val.string.len); val.val.string.val = pnstrdup(HS_VAL(entries, base, i), val.val.string.len);
val.estSize += val.val.string.len;
} }
} }
res = pushJsonbValue(&state, WJB_VALUE, &val); res = pushJsonbValue(&state, WJB_VALUE, &val);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment