diff options
author | kostja@dipika.(none) <> | 2008-02-19 14:43:01 +0300 |
---|---|---|
committer | kostja@dipika.(none) <> | 2008-02-19 14:43:01 +0300 |
commit | acf9b1f346e8b9dc59ad8e1f6a1ff20ef96d0dcd (patch) | |
tree | e540052e63f7376b653b6418116db3340c22b891 /sql/rpl_injector.cc | |
parent | 48d326612aa16f2d7fdcc9e78f5f7b99f0e3c0a7 (diff) | |
download | mariadb-git-acf9b1f346e8b9dc59ad8e1f6a1ff20ef96d0dcd.tar.gz |
A fix and a test case for Bug#12713 "Error in a stored function called from
a SELECT doesn't cause ROLLBACK of statem".
The idea of the fix is to ensure that we always commit the current
statement at the end of dispatch_command(). In order to not issue
redundant disc syncs, an optimization of the two-phase commit
protocol is implemented to bypass the two phase commit if
the transaction is read-only.
Diffstat (limited to 'sql/rpl_injector.cc')
-rw-r--r-- | sql/rpl_injector.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sql/rpl_injector.cc b/sql/rpl_injector.cc index aa3020c42be..684655d1c3b 100644 --- a/sql/rpl_injector.cc +++ b/sql/rpl_injector.cc @@ -62,6 +62,26 @@ int injector::transaction::commit() { DBUG_ENTER("injector::transaction::commit()"); m_thd->binlog_flush_pending_rows_event(true); + /* + Cluster replication does not preserve statement or + transaction boundaries of the master. Instead, a new + transaction on replication slave is started when a new GCI + (global checkpoint identifier) is issued, and is committed + when the last event of the check point has been received and + processed. This ensures consistency of each cluster in + cluster replication, and there is no requirement for stronger + consistency: MySQL replication is asynchronous with other + engines as well. + + A practical consequence of that is that row level replication + stream passed through the injector thread never contains + COMMIT events. + Here we should preserve the server invariant that there is no + outstanding statement transaction when the normal transaction + is committed by committing the statement transaction + explicitly. + */ + ha_autocommit_or_rollback(m_thd, 0); end_trans(m_thd, COMMIT); DBUG_RETURN(0); } |