• H
    Don't call ExecAssignScanProjectionInfo while in partitionMemoryContext. · d7662fd7
    Heikki Linnakangas 提交于
    This allows removing the weird pfree() of the resultTupleSlot's tuple
    descriptor. What would've happened without the pfree() is that the old
    slot was allocated in the first ExecAssignScanProjectionInfo() call, in
    partitionMemoryContext, and then immediately destroyed when the memory
    context was reset. The second call to ExecAssignScanProjectionInfo() tries
    to free the slot, again, causing the segfault. But we can avoid that
    by this rearrangement of the calls in a cleaner way.
    
    In the passing, clean up the code a bit. I found having separate variables,
    indexState and scanState, which point to the same struct, to be confusing.
    d7662fd7
nodeDynamicIndexscan.c 11.9 KB