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.1835 05/04/04 10:50:34 mats@stripped +3 -0
WL#2325: Some minor changes to injector interface.
sql/rpl_injector.h
1.6 05/04/04 10:50:29 mats@stripped +20 -0
Added comments on intended usage.
sql/rpl_injector.cc
1.8 05/04/04 10:50:29 mats@stripped +6 -0
Added transaction supporting code in injector.
sql/log.cc
1.160 05/04/04 10:50:29 mats@stripped +5 -0
Disabled writing directly to binary log file.
# 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/w2325-mysql-5.1
--- 1.159/sql/log.cc 2005-04-01 13:40:13 +02:00
+++ 1.160/sql/log.cc 2005-04-04 10:50:29 +02:00
@@ -1598,7 +1598,12 @@
mixed trans/non-trans table types the best possible in binlogging)
- or if the event asks for it (cache_stmt == true).
*/
+#if 0
+ // Disabled writing directly to the log, since it doesn't work right now.
if (opt_using_transactions && thd && event_info->can_be_cached())
+#else
+ if (opt_using_transactions && thd)
+#endif
{
IO_CACHE *trans_log= (IO_CACHE*)thd->ha_data[binlog_hton.slot];
--- 1.7/sql/rpl_injector.cc 2005-04-01 13:32:30 +02:00
+++ 1.8/sql/rpl_injector.cc 2005-04-04 10:50:29 +02:00
@@ -33,11 +33,16 @@
// !!! binlog_pos does not follow RAII !!!
m_start_pos.m_file_name = my_strdup(log_info.log_file_name, MYF(0));
m_start_pos.m_file_pos = log_info.pos;
+ m_thd->transaction_begin(); // !!! Can fail
}
injector::transaction::
~transaction()
{
+ // To flush the pending event and clean up the pending stuff for the
+ // transaction.
+ m_thd->transaction_end(); // !!! Can fail
+
// Needed since my_free expects a 'char*' (instead of 'void*').
char* const the_memory = const_cast<char*>(m_start_pos.m_file_name);
@@ -53,6 +58,7 @@
commit()
{
DBUG_ENTER("injector::transaction::commit()");
+ m_thd->transaction_end();
ha_commit(m_thd);
DBUG_RETURN(0);
}
--- 1.5/sql/rpl_injector.h 2005-03-21 19:24:56 +01:00
+++ 1.6/sql/rpl_injector.h 2005-04-04 10:50:29 +02:00
@@ -71,6 +71,26 @@
references to tables. The constructors can implicitly be used to
construct references from, e.g., strings containing table names.
+ EXAMPLE
+
+ The class is intended to be used *by value*. Please, do not try to
+ construct objects of this type using 'new'; instead construct an
+ object, possibly a temporary object. For example:
+
+ injector::transaction::table tbl("my_db", "foo");
+ bitvector cols(i, true);
+ inj->write_row(::server_id, tbl, cols, row_data);
+
+ or
+
+ bitvector cols(i, true);
+ inj->write_row(::server_id,
+ injector::transaction::table("my_db", "foo"),
+ cols, row_data);
+
+ This will work, be more efficient, and have greater chance of
+ inlining, not run the risk of losing pointers.
+
COLLABORATION
injector::transaction
| Thread |
|---|
| • bk commit into 5.1 tree (mats:1.1835) | Mats Kindahl | 4 Apr |