summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorJan Lindström <jplindst@mariadb.org>2014-01-25 11:02:49 +0200
committerJan Lindström <jplindst@mariadb.org>2014-01-25 11:02:49 +0200
commitd43afb8828e358f9c3bb690d0fdcd88b0637f155 (patch)
treef977f3b5fa3c938183510750aecbea31bccc67ef /sql/handler.cc
parentd0f77b83611077344ff29db02ea5593c9da62537 (diff)
parent02765f4c614069ece1f30976848b6299ba6f24bd (diff)
downloadmariadb-git-d43afb8828e358f9c3bb690d0fdcd88b0637f155.tar.gz
Merge MariaDB-10.0.7 revision 3961.
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc18
1 files changed, 15 insertions, 3 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 4816f5f6ae0..4c797259e2c 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -1620,10 +1620,16 @@ int ha_rollback_trans(THD *thd, bool all)
}
trans->ha_list= 0;
trans->no_2pc=0;
- if (is_real_trans && thd->transaction_rollback_request &&
- thd->transaction.xid_state.xa_state != XA_NOTR)
- thd->transaction.xid_state.rm_error= thd->get_stmt_da()->sql_errno();
}
+
+ /*
+ Thanks to possibility of MDL deadlock rollback request can come even if
+ transaction hasn't been started in any transactional storage engine.
+ */
+ if (is_real_trans && thd->transaction_rollback_request &&
+ thd->transaction.xid_state.xa_state != XA_NOTR)
+ thd->transaction.xid_state.rm_error= thd->get_stmt_da()->sql_errno();
+
/* Always cleanup. Even if nht==0. There may be savepoints. */
if (is_real_trans)
{
@@ -5931,6 +5937,7 @@ int handler::ha_update_row(const uchar *old_data, uchar *new_data)
(and the old record is in record[1]).
*/
DBUG_ASSERT(new_data == table->record[0]);
+ DBUG_ASSERT(old_data == table->record[1]);
MYSQL_UPDATE_ROW_START(table_share->db.str, table_share->table_name.str);
mark_trx_read_write();
@@ -5954,6 +5961,11 @@ int handler::ha_delete_row(const uchar *buf)
Log_func *log_func= Delete_rows_log_event::binlog_row_logging_function;
DBUG_ASSERT(table_share->tmp_table != NO_TMP_TABLE ||
m_lock_type == F_WRLCK);
+ /*
+ Normally table->record[0] is used, but sometimes table->record[1] is used.
+ */
+ DBUG_ASSERT(buf == table->record[0] ||
+ buf == table->record[1]);
MYSQL_DELETE_ROW_START(table_share->db.str, table_share->table_name.str);
mark_trx_read_write();