Annotate_rows event needs to be preserved until the last Rows event has been applied because after it has been applied thd->query points to the query stored inside this event.