summaryrefslogtreecommitdiff
path: root/storage/blackhole/ha_blackhole.h
diff options
context:
space:
mode:
authorMats Kindahl <mats@sun.com>2008-10-02 11:02:38 +0200
committerMats Kindahl <mats@sun.com>2008-10-02 11:02:38 +0200
commit8d9cf89e96fa7606ed76ae5314a6dd0b4ee7fb44 (patch)
tree2a5130973af7732a68b80fd5930e25f0794724bf /storage/blackhole/ha_blackhole.h
parent70e2f814a775c11b6cd453d5f26dd3114c7e6b6f (diff)
downloadmariadb-git-8d9cf89e96fa7606ed76ae5314a6dd0b4ee7fb44.tar.gz
Bug #38360: BLACKHOLE replication with RBR is broken
The Blackhole engine did not support row-based replication since the delete_row(), update_row(), and the index and range searching functions were not implemented. This patch adds row-based replication support for the Blackhole engine by implementing the two functions mentioned above, and making the engine pretend that it has found the correct row to delete or update when executed from the slave SQL thread by implementing index and range searching functions. It is necessary to only pretend this for the SQL thread, since a SELECT executed on the Blackhole engine will otherwise never return EOF, causing a livelock. mysql-test/extra/binlog_tests/blackhole.test: Blackhole now handles row-based replication. mysql-test/extra/rpl_tests/rpl_blackhole.test: Test helper file for testing that blackhole actually writes something to the binary log on the slave. mysql-test/suite/binlog/t/binlog_multi_engine.test: Replication now handles row-based replcation. mysql-test/suite/rpl/t/rpl_blackhole.test: Test that Blackhole works with primary key, index, or none. sql/log_event.cc: Correcting code to only touch filler bits and leave all other bits alone. It is necessary since there is no guarantee that the engine will be able to fill in the bits correctly (e.g., the blackhole engine). storage/blackhole/ha_blackhole.cc: Adding definitions for update_row() and delete_row() to return OK when executed from the slave SQL thread with thd->query == NULL (indicating that row-based replication events are being processed). Changing rnd_next(), index_read(), index_read_idx(), and index_read_last() to return OK when executed from the slave SQL thread (faking that the row has been found so that processing proceeds to update/delete the row). storage/blackhole/ha_blackhole.h: Enabling row capabilities for engine. Defining write_row(), update_row(), and delete_row(). Making write_row() private (as it should be).
Diffstat (limited to 'storage/blackhole/ha_blackhole.h')
-rw-r--r--storage/blackhole/ha_blackhole.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/storage/blackhole/ha_blackhole.h b/storage/blackhole/ha_blackhole.h
index d5a0d08926c..085840cce43 100644
--- a/storage/blackhole/ha_blackhole.h
+++ b/storage/blackhole/ha_blackhole.h
@@ -53,7 +53,7 @@ public:
ulonglong table_flags() const
{
return(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER |
- HA_BINLOG_STMT_CAPABLE |
+ HA_BINLOG_STMT_CAPABLE | HA_BINLOG_ROW_CAPABLE |
HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY |
HA_FILE_BASED | HA_CAN_GEOMETRY | HA_CAN_INSERT_DELAYED);
}
@@ -72,7 +72,6 @@ public:
uint max_supported_key_part_length() const { return BLACKHOLE_MAX_KEY_LENGTH; }
int open(const char *name, int mode, uint test_if_locked);
int close(void);
- int write_row(uchar * buf);
int rnd_init(bool scan);
int rnd_next(uchar *buf);
int rnd_pos(uchar * buf, uchar *pos);
@@ -94,4 +93,8 @@ public:
THR_LOCK_DATA **store_lock(THD *thd,
THR_LOCK_DATA **to,
enum thr_lock_type lock_type);
+private:
+ virtual int write_row(uchar *buf);
+ virtual int update_row(const uchar *old_data, uchar *new_data);
+ virtual int delete_row(const uchar *buf);
};