Below is the list of changes that have just been committed into a local
5.1 repository of mats. When mats does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1841 05/04/07 14:13:02 mats@stripped +3 -0
WL#2324: MySQL Injector Interface
Added method to allow handler to insert row-level events in the
binlog itself.
sql/handler.h
1.134 05/04/07 14:12:58 mats@stripped +7 -0
Injective handlers insert row-level events in the binlog themself.
sql/handler.cc
1.152 05/04/07 14:12:58 mats@stripped +9 -3
If the handler is injective, it will insert the rows in the binlog itself.
sql/ha_ndbcluster.h
1.83 05/04/07 14:12:58 mats@stripped +3 -0
NDB is an injective handler.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: mats
# Host: romeo.kindahl.net
# Root: /home/bk/w2324-mysql-5.1
--- 1.151/sql/handler.cc 2005-04-01 13:40:13 +02:00
+++ 1.152/sql/handler.cc 2005-04-07 14:12:58 +02:00
@@ -2411,7 +2411,9 @@
}
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
DBUG_PRINT("info", ("Writing row to THD"));
- if (table->s->tmp_table == NO_TMP_TABLE) {
+ if (table->s->tmp_table == NO_TMP_TABLE
+ && !this->is_injective())
+ {
bitvector const cols(table->s->fields, true);
thd->write_row(table, cols, buf);
}
@@ -2442,7 +2444,9 @@
DBUG_RETURN(error);
}
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
- if (table->s->tmp_table == NO_TMP_TABLE) {
+ if (table->s->tmp_table == NO_TMP_TABLE
+ && !this->is_injective())
+ {
bitvector const cols(table->s->fields, true);
thd->update_row(table, cols, old_data, new_data);
}
@@ -2473,7 +2477,9 @@
DBUG_RETURN(error);
}
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
- if (table->s->tmp_table == NO_TMP_TABLE) {
+ if (table->s->tmp_table == NO_TMP_TABLE
+ && !this->is_injective())
+ {
bitvector const cols(table->s->fields, true);
thd->delete_row(table, cols, buf);
}
--- 1.133/sql/handler.h 2005-04-01 13:40:13 +02:00
+++ 1.134/sql/handler.h 2005-04-07 14:12:58 +02:00
@@ -555,6 +555,13 @@
int ha_stmt_begin();
int ha_stmt_end();
+ /*
+ If the handler does it's own injection of the rows, this member function
+ should return 'true'. An alternative would be to use a set of replication
+ flags, which might be implemented to be faster.
+ */
+ virtual bool is_injective() const { return false; }
+
virtual int index_read(byte * buf, const byte * key,
uint key_len, enum ha_rkey_function find_flag)
{ return HA_ERR_WRONG_COMMAND; }
--- 1.82/sql/ha_ndbcluster.h 2005-03-29 09:06:07 +02:00
+++ 1.83/sql/ha_ndbcluster.h 2005-04-07 14:12:58 +02:00
@@ -453,6 +453,9 @@
bool low_byte_first() const;
bool has_transactions();
+
+ virtual bool is_injective() const { return true; }
+
const char* index_type(uint key_number);
double scan_time();
| Thread |
|---|
| • bk commit into 5.1 tree (mats:1.1841) | Mats Kindahl | 7 Apr |