Fixes #6166 - ensure we don't execute the same execution plan twice in a row