Alvaro Herrera <alvherre@commandprompt.com> writes:
> Crazy ideas: add a #warning or #error to the header file unless there is
> some special symbol previously defined, something like
> #define I_UNDERSTAND_MEM_ALLOC_IN_TUPLETABLESLOT
> which means the developer did update his code.
Well, if we wanted to go that far, the simple solution is to rename
tuplesort_gettuple to something else. Guaranteed code breakage then.
However, I think this is overkill for a problem that only *might*
bite people. I kinda doubt that people are using TupleTableSlots in
add-on code, because the design of the executor makes it hard for
anything except plan nodes to obtain slots. You'd have to posit a
piece of code that isn't structured as
while ((tuple = tuplesort_gettuple(...)) != NULL){ process tuple; if (should_free) pfree(tuple);}
but instead hangs onto the last tuple past the sort shutdown, and
yet isn't a plan node.
regards, tom lane