summaryrefslogtreecommitdiff
path: root/sql/log_event.cc
diff options
context:
space:
mode:
authormonty@mashka.mysql.fi <>2003-01-04 15:40:55 +0200
committermonty@mashka.mysql.fi <>2003-01-04 15:40:55 +0200
commitf9772317eefe95fe8152d69593082b2864164e16 (patch)
tree49da2620373e1b4c73d505405819d5d7097786bc /sql/log_event.cc
parent7c82789929e36ede31dd181f54ddffd30ba7f3ed (diff)
parent6d6f051178c7c3201c77b5fa427252d50bd5fea3 (diff)
downloadmariadb-git-f9772317eefe95fe8152d69593082b2864164e16.tar.gz
merge
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r--sql/log_event.cc23
1 files changed, 20 insertions, 3 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index a01b1ee6170..8f98fa511a0 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -296,9 +296,13 @@ int Log_event::exec_event(struct st_relay_log_info* rli)
{
if (rli) // QQ When is this not true ?
{
- rli->inc_pos(get_event_len(),log_pos);
- DBUG_ASSERT(rli->sql_thd != 0);
- flush_relay_log_info(rli);
+ if (rli->inside_transaction)
+ rli->inc_pending(get_event_len());
+ else
+ {
+ rli->inc_pos(get_event_len(),log_pos);
+ flush_relay_log_info(rli);
+ }
}
return 0;
}
@@ -865,6 +869,19 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli)
mysql_log.write(thd,COM_QUERY,"%s",thd->query);
DBUG_PRINT("query",("%s",thd->query));
mysql_parse(thd, thd->query, q_len);
+
+ /*
+ Set a flag if we are inside an transaction so that we can restart
+ the transaction from the start if we are killed
+
+ This will only be done if we are supporting transactional tables
+ in the slave.
+ */
+ if (!strcmp(thd->query,"BEGIN"))
+ rli->inside_transaction= opt_using_transactions;
+ else if (!strcmp(thd->query,"COMMIT"))
+ rli->inside_transaction=0;
+
DBUG_PRINT("info",("expected_error: %d last_errno: %d",
expected_error, thd->net.last_errno));
if ((expected_error != (actual_error= thd->net.last_errno)) &&