if (!value_nulls || value_nulls[i])
{
- pairs[i].key = VARDATA_ANY(key_datums[i]);
+ pairs[i].key = VARDATA(key_datums[i]);
pairs[i].val = NULL;
- pairs[i].keylen = hstoreCheckKeyLen(VARSIZE_ANY_EXHDR(key_datums[i]));
+ pairs[i].keylen =
+ hstoreCheckKeyLen(VARSIZE(key_datums[i]) - VARHDRSZ);
pairs[i].vallen = 4;
pairs[i].isnull = true;
pairs[i].needfree = false;
}
else
{
- pairs[i].key = VARDATA_ANY(key_datums[i]);
- pairs[i].val = VARDATA_ANY(value_datums[i]);
- pairs[i].keylen = hstoreCheckKeyLen(VARSIZE_ANY_EXHDR(key_datums[i]));
- pairs[i].vallen = hstoreCheckValLen(VARSIZE_ANY_EXHDR(value_datums[i]));
+ pairs[i].key = VARDATA(key_datums[i]);
+ pairs[i].val = VARDATA(value_datums[i]);
+ pairs[i].keylen =
+ hstoreCheckKeyLen(VARSIZE(key_datums[i]) - VARHDRSZ);
+ pairs[i].vallen =
+ hstoreCheckValLen(VARSIZE(value_datums[i]) - VARHDRSZ);
pairs[i].isnull = false;
pairs[i].needfree = false;
}
if (in_nulls[i * 2 + 1])
{
- pairs[i].key = VARDATA_ANY(in_datums[i * 2]);
+ pairs[i].key = VARDATA(in_datums[i * 2]);
pairs[i].val = NULL;
- pairs[i].keylen = hstoreCheckKeyLen(VARSIZE_ANY_EXHDR(in_datums[i * 2]));
+ pairs[i].keylen =
+ hstoreCheckKeyLen(VARSIZE(in_datums[i * 2]) - VARHDRSZ);
pairs[i].vallen = 4;
pairs[i].isnull = true;
pairs[i].needfree = false;
}
else
{
- pairs[i].key = VARDATA_ANY(in_datums[i * 2]);
- pairs[i].val = VARDATA_ANY(in_datums[i * 2 + 1]);
- pairs[i].keylen = hstoreCheckKeyLen(VARSIZE_ANY_EXHDR(in_datums[i * 2]));
- pairs[i].vallen = hstoreCheckValLen(VARSIZE_ANY_EXHDR(in_datums[i * 2 + 1]));
+ pairs[i].key = VARDATA(in_datums[i * 2]);
+ pairs[i].val = VARDATA(in_datums[i * 2 + 1]);
+ pairs[i].keylen =
+ hstoreCheckKeyLen(VARSIZE(in_datums[i * 2]) - VARHDRSZ);
+ pairs[i].vallen =
+ hstoreCheckValLen(VARSIZE(in_datums[i * 2 + 1]) - VARHDRSZ);
pairs[i].isnull = false;
pairs[i].needfree = false;
}
for (i = 0; i < noldoptions; i++)
{
- text *oldoption = DatumGetTextP(oldoptions[i]);
- char *text_str = VARDATA(oldoption);
- int text_len = VARSIZE(oldoption) - VARHDRSZ;
+ char *text_str = VARDATA(oldoptions[i]);
+ int text_len = VARSIZE(oldoptions[i]) - VARHDRSZ;
/* Search for a match in defList */
foreach(cell, defList)
for (i = 0; i < noptions; i++)
{
- text *optiontext = DatumGetTextP(optiondatums[i]);
- char *text_str = VARDATA(optiontext);
- int text_len = VARSIZE(optiontext) - VARHDRSZ;
+ char *text_str = VARDATA(optiondatums[i]);
+ int text_len = VARSIZE(optiondatums[i]) - VARHDRSZ;
int j;
/* Search for a match in reloptions */
if (key_nulls[i])
continue;
entries[j++] = make_text_key(JGINFLAG_KEY,
- VARDATA_ANY(key_datums[i]),
- VARSIZE_ANY_EXHDR(key_datums[i]));
+ VARDATA(key_datums[i]),
+ VARSIZE(key_datums[i]) - VARHDRSZ);
}
*nentries = j;
{
jbvp = findJsonbValueFromContainerLen(container,
JB_FOBJECT,
- VARDATA_ANY(pathtext[i]),
- VARSIZE_ANY_EXHDR(pathtext[i]));
+ VARDATA(pathtext[i]),
+ VARSIZE(pathtext[i]) - VARHDRSZ);
}
else if (have_array)
{
&textDatums, NULL, &ndatums);
for (i = 0; i < ndatums; i++)
{
- text *txtname = DatumGetTextPP(textDatums[i]);
- char *extName = text_to_cstring(txtname);
+ char *extName = TextDatumGetCString(textDatums[i]);
Oid extOid = get_extension_oid(extName, false);
requiredExtensions = lappend_oid(requiredExtensions, extOid);
errmsg("lexeme array may not contain nulls")));
lex = VARDATA(dlexemes[i]);
- lex_len = VARSIZE_ANY_EXHDR(dlexemes[i]);
+ lex_len = VARSIZE(dlexemes[i]) - VARHDRSZ;
lex_pos = tsvector_bsearch(tsout, lex, lex_len);
if (lex_pos >= 0 && (j = POSDATALEN(tsout, entry + lex_pos)) != 0)
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
errmsg("lexeme array may not contain nulls")));
- lex = VARDATA_ANY(dlexemes[i]);
- lex_len = VARSIZE_ANY_EXHDR(dlexemes[i]);
+ lex = VARDATA(dlexemes[i]);
+ lex_len = VARSIZE(dlexemes[i]) - VARHDRSZ;
lex_pos = tsvector_bsearch(tsin, lex, lex_len);
if (lex_pos >= 0)
/* Calculate space needed for surviving lexemes. */
for (i = 0; i < nitems; i++)
- datalen += VARSIZE_ANY_EXHDR(dlexemes[i]);
+ datalen += VARSIZE(dlexemes[i]) - VARHDRSZ;
tslen = CALCDATASIZE(nitems, datalen);
/* Allocate and fill tsvector. */
cur = STRPTR(tsout);
for (i = 0; i < nitems; i++)
{
- char *lex = VARDATA_ANY(dlexemes[i]);
- int lex_len = VARSIZE_ANY_EXHDR(dlexemes[i]);
+ char *lex = VARDATA(dlexemes[i]);
+ int lex_len = VARSIZE(dlexemes[i]) - VARHDRSZ;
memcpy(cur, lex, lex_len);
arrout[i].haspos = 0;