MCPcopy Create free account
hub / github.com/Tencent/phxsql / flush

Method flush

phx_percona/percona/sql/binlog.cc:782–793  ·  view source on GitHub ↗

Convenience method to flush both caches to the binary log. @param bytes_written Pointer to variable that will be set to the number of bytes written for the flush. @param wrote_xid Pointer to variable that will be set to @c true if any XID event was written to the binary log. Otherwise, the variable will not

Source from the content-addressed store, hash-verified

780 @return Error code on error, zero if no error.
781 */
782 int flush(THD *thd, my_off_t *bytes_written, bool *wrote_xid)
783 {
784 my_off_t stmt_bytes= 0;
785 my_off_t trx_bytes= 0;
786 DBUG_ASSERT(stmt_cache.has_xid() == 0);
787 if (int error= stmt_cache.flush(thd, &stmt_bytes, wrote_xid))
788 return error;
789 if (int error= trx_cache.flush(thd, &trx_bytes, wrote_xid))
790 return error;
791 *bytes_written= stmt_bytes + trx_bytes;
792 return 0;
793 }
794
795 binlog_stmt_cache_data stmt_cache;
796 binlog_trx_cache_data trx_cache;

Callers

nothing calls this directly

Calls 2

has_xidMethod · 0.80
flushMethod · 0.45

Tested by

no test coverage detected