Hi Sanja, As far I understand, JOIN structure has two "modules" to support join re-execution: M1. save_join_tab() saves/restores the contents of JOIN::join_tab array, as if execution process changed JOIN_TAB structures M2. JOIN::tmp_join is used to save/restore the contents of JOIN structure itself. What puzzles me are two questions: Q1: Why do we have separate functions to M1 and M2, instead of one "save everything" call, and one "restore everything" call? Q2: Why does M1 copy the whole JOIN_TAB structures? I've made a patch which makes it to save/restore JOIN::join_tab pointer instead (attached), and it passed all tests in the main test suite. (I am asking all this in connection with bug MDEV-238 on MWL#182 code) BR Sergei -- Sergei Petrunia, Software Developer Monty Program AB, http://askmonty.org Blog: http://s.petrunia.net/blog