20 #include <my_global.h>
21 #include <my_bitmap.h>
23 #include "rpl_constants.h"
63 static void free_instance();
77 typedef uchar* record_type;
78 typedef uint32 server_id_type;
123 : m_table(tbl.get_table()),
124 save_read_set(m_table->read_set),
125 save_write_set(m_table->write_set)
127 m_table->column_bitmaps_set_no_signal(const_cast<MY_BITMAP*>(new_rs),
128 const_cast<MY_BITMAP*>(new_ws));
132 m_table->column_bitmaps_set_no_signal(save_read_set, save_write_set);
142 : m_table(table), m_is_transactional(is_transactional)
146 char const *db_name()
const {
return m_table->s->db.str; }
147 char const *table_name()
const {
return m_table->s->table_name.str; }
148 TABLE *get_table()
const {
return m_table; }
149 bool is_transactional()
const {
return m_is_transactional; }
153 bool m_is_transactional;
162 char const *file_name()
const {
return m_file_name; }
163 my_off_t file_pos()
const {
return m_file_pos; }
166 char const *m_file_name;
170 transaction() : m_thd(NULL) { }
171 transaction(transaction
const&);
175 void clear() { m_thd= NULL; }
178 bool good()
const {
return m_thd != NULL; }
181 transaction& operator=(transaction t) {
202 int use_table(server_id_type sid,
table tbl);
207 int write_row (server_id_type sid,
table tbl,
210 const uchar* extra_row_info);
211 int write_row (server_id_type sid,
table tbl,
218 int delete_row(server_id_type sid,
table tbl,
221 const uchar* extra_row_info);
222 int delete_row(server_id_type sid,
table tbl,
228 int update_row(server_id_type sid,
table tbl,
230 record_type before, record_type after,
231 const uchar* extra_row_info);
232 int update_row(server_id_type sid,
table tbl,
234 record_type before, record_type after);
260 binlog_pos start_pos()
const;
277 binlog_pos next_pos()
const;
283 void swap(transaction& o) {
286 binlog_pos
const tmp= m_start_pos;
287 m_start_pos= o.m_start_pos;
293 binlog_pos
const tmp= m_next_pos;
294 m_next_pos= o.m_next_pos;
300 THD*
const tmp= m_thd;
305 enum_state
const tmp= m_state;
349 int check_state(enum_state
const target_state)
352 static char const *state_name[] = {
353 "START_STATE",
"TABLE_STATE",
"ROW_STATE",
"STATE_COUNT"
356 DBUG_ASSERT(0 <= target_state && target_state <= STATE_COUNT);
357 DBUG_PRINT(
"info", (
"In state %s", state_name[m_state]));
360 if (m_state <= target_state && target_state <= m_state + 1 &&
361 m_state < STATE_COUNT)
362 m_state= target_state;
364 m_state= STATE_COUNT;
365 return m_state == STATE_COUNT ? 1 : 0;
369 binlog_pos m_start_pos;
370 binlog_pos m_next_pos;
383 void new_trans(THD *, transaction *);
385 int record_incident(THD*, Incident incident);