1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Assume deconstruct_array() outputs are untoasted.

In functions that issue a deconstruct_array() call, consistently use
plain VARSIZE()/VARDATA() on the array elements.  Prior practice was
divided between those and VARSIZE_ANY_EXHDR()/VARDATA_ANY().
This commit is contained in:
Noah Misch
2017-03-12 19:35:31 -04:00
parent 9e0926468a
commit 2fd26b23b6
6 changed files with 33 additions and 30 deletions

View File

@ -760,9 +760,8 @@ transformRelOptions(Datum oldOptions, List *defList, char *namspace,
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)
@ -1055,9 +1054,8 @@ parseRelOptions(Datum options, bool validate, relopt_kind kind,
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 */