• Tom Lane's avatar
    Fix confusion about number of subplans in partitioned INSERT setup. · 78a030a4
    Tom Lane authored
    ExecInitModifyTable() thought there was a plan per partition, but no,
    there's only one.  The problem had escaped detection so far because there
    would only be visible misbehavior if there were a SubPlan (not an InitPlan)
    in the quals being duplicated for each partition.  However, valgrind
    detected a bogus memory access in test cases added by commit 4f7a95be,
    and investigation of that led to discovery of the bug.  The additional
    test case added here crashes without the patch.
    
    Patch by Amit Langote, test case by me.
    
    Discussion: https://postgr.es/m/10974.1497227727@sss.pgh.pa.us
    78a030a4
rowsecurity.sql 59.2 KB