Handling Query_log_event resets thd->db pointer (see Query_log_event::do_apply_event). Therefore if IO cache contains Query_log_event, thd->db will be reset during transaction replay.
Handling Query_log_event resets thd->db pointer (see Query_log_ event:: do_apply_ event). Therefore if IO cache contains Query_log_event, thd->db will be reset during transaction replay.