Flush caches for session. @note @c set_trans_pos is called with a pointer to the file name that the binary log currently use and a rotation will change the contents of the variable. The position is used when calling the after_flush, after_commit, and after_rollback hooks, but these have been placed so that they occur before a rotation is executed. It is the responsibility o
| 6807 | copy it if they need it after the hook has returned. |
| 6808 | */ |
| 6809 | std::pair<int,my_off_t> |
| 6810 | MYSQL_BIN_LOG::flush_thread_caches(THD *thd) |
| 6811 | { |
| 6812 | binlog_cache_mngr *cache_mngr= thd_get_cache_mngr(thd); |
| 6813 | my_off_t bytes= 0; |
| 6814 | bool wrote_xid= false; |
| 6815 | int error= cache_mngr->flush(thd, &bytes, &wrote_xid); |
| 6816 | if (!error && bytes > 0) |
| 6817 | { |
| 6818 | /* |
| 6819 | Note that set_trans_pos does not copy the file name. See |
| 6820 | this function documentation for more info. |
| 6821 | */ |
| 6822 | thd->set_trans_pos(log_file_name, my_b_tell(&log_file)); |
| 6823 | if (wrote_xid) |
| 6824 | inc_prep_xids(thd); |
| 6825 | } |
| 6826 | DBUG_PRINT("debug", ("bytes: %llu", bytes)); |
| 6827 | return std::make_pair(error, bytes); |
| 6828 | } |
| 6829 | |
| 6830 | |
| 6831 | /** |
nothing calls this directly
no test coverage detected