Skip to content

Commit 13ab195

Browse files
committed
document (in comments) why only pass-by-value allowed to orderby column
1 parent e33dac2 commit 13ab195

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

rumget.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,11 @@ callConsistentFn(RumState *rumstate, RumScanKey key)
9292
if (key->entryRes[i] && key->addInfoIsNull[0] == false)
9393
{
9494
key->outerAddInfoIsNull = false;
95-
/* XXX FIXME only pass-by-value!!! */
95+
/*
96+
* XXX FIXME only pass-by-value!!!
97+
* Value should be copied to long-lived memory context and,
98+
* somehow, freeed. Seems, the last is real problem
99+
*/
96100
key->outerAddInfo = key->addInfo[0];
97101
break;
98102
}

rumutil.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,13 @@ initRumState(RumState *state, Relation index)
333333
else
334334
state->supportCollation[i] = DEFAULT_COLLATION_OID;
335335
}
336+
337+
if (AttributeNumberIsValid(state->attrnOrderByColumn))
338+
{
339+
/* Follow FIXME comment(s) to understand */
340+
if (origTupdesc->attrs[state->attrnOrderByColumn - 1]->attbyval == false)
341+
elog(ERROR, "currently, RUM doesn't support order by over pass-by-reference column");
342+
}
336343
}
337344

338345
/*

0 commit comments

Comments
 (0)