The following check at the beginning of slot_deform_datarow
if (slot->tts_tupleDescriptor == NULL || slot->tts_datarow == NULL)
return;
was replaced with two asserts, enforcing the same conditions (except
that instead of silently returning it'll cause failure).
Silently ignoring such condition seems quite suspicious, and likely
only masks other errors - for example why should it be OK to call
this function without a data row?
This change seems safe, because all current callers already access
tts_tupleDescriptor - for example in the fastpath checks - and so
this field can't ever be NULL here. Also, we only call this function
after explicitly checking tts_datarow, so that can't be NULL either.
uint32 n32;
MemoryContext oldcontext;
- if (slot->tts_tupleDescriptor == NULL || slot->tts_datarow == NULL)
- return;
+ Assert(slot->tts_tupleDescriptor != NULL);
+ Assert(slot->tts_datarow != NULL);
natts = slot->tts_tupleDescriptor->natts;