mirror of https://github.com/postgres/postgres
Fix build after removing JsonbValue.estSize field.
Oops, I didn't realize that contrib/hstore refers to jsonb stuff.
This commit is contained in:
parent
eee6cf1f33
commit
7572b77359
|
@ -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)
|
||||||
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)
|
||||||
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);
|
||||||
|
|
Loading…
Reference in New Issue