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

Method binlog_write_row

phx_percona/percona/sql/binlog.cc:9177–9206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9175 };
9176
9177CPP_UNNAMED_NS_END
9178
9179int THD::binlog_write_row(TABLE* table, bool is_trans,
9180 uchar const *record,
9181 const uchar* extra_row_info)
9182{
9183 DBUG_ASSERT(is_current_stmt_binlog_format_row() && mysql_bin_log.is_open());
9184
9185 /*
9186 Pack records into format for transfer. We are allocating more
9187 memory than needed, but that doesn't matter.
9188 */
9189 Row_data_memory memory(table, max_row_length(table, record));
9190 if (!memory.has_memory())
9191 return HA_ERR_OUT_OF_MEM;
9192
9193 uchar *row_data= memory.slot(0);
9194
9195 size_t const len= pack_row(table, table->write_set, row_data, record);
9196
9197 Rows_log_event* const ev=
9198 binlog_prepare_pending_rows_event(table, server_id, len, is_trans,
9199 static_cast<Write_rows_log_event*>(0),
9200 extra_row_info);
9201
9202 if (unlikely(ev == 0))
9203 return HA_ERR_OUT_OF_MEM;
9204
9205 return ev->add_row_data(row_data, len);
9206}
9207
9208int THD::binlog_update_row(TABLE* table, bool is_trans,
9209 const uchar *before_record,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected