On Mon, Jan 22, 2018 at 2:44 AM, Amit Khandekar <amitdkhan...@gmail.com> wrote: > Yes, right, that's what is happening. It is not happening on an Assert > though (there is no assert in that function). It is happening when we > try to access the array here : > > if (proute->subplan_partition_offsets && > proute->subplan_partition_offsets[subplan_index] == i) > > Attached is a fix, where I have introduced another field > PartitionTupleRouting.num_ subplan_partition_offsets, so that above, > we can add another condition (subplan_index < > proute->num_subplan_partition_offsets) in order to stop accessing the > array once we are done with all the offset array elements. > > Ran the update.sql test with valgrind enabled on my laptop, and the > valgrind output now does not show errors.
Tom, do you want to double-check that this fixes it for you? -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company