Commit faabd6de authored by marko's avatar marko

Merge a change from MySQL AB:

ChangeSet@1.2528.24.43  2007-08-02 02:22:31-06:00  tsmith@hindu.god

Post-merge fix, add InnoDB compatibility hook (defined for
InnoDB only), thd_mark_transaction_to_rollback().
parent adabdefd
...@@ -600,9 +600,7 @@ convert_error_code_to_mysql( ...@@ -600,9 +600,7 @@ convert_error_code_to_mysql(
tell it also to MySQL so that MySQL knows to empty the tell it also to MySQL so that MySQL knows to empty the
cached binlog for this transaction */ cached binlog for this transaction */
if (thd) { thd_mark_transaction_to_rollback(thd, TRUE);
ha_rollback(thd);
}
return(HA_ERR_LOCK_DEADLOCK); return(HA_ERR_LOCK_DEADLOCK);
...@@ -612,9 +610,8 @@ convert_error_code_to_mysql( ...@@ -612,9 +610,8 @@ convert_error_code_to_mysql(
latest SQL statement in a lock wait timeout. Previously, we latest SQL statement in a lock wait timeout. Previously, we
rolled back the whole transaction. */ rolled back the whole transaction. */
if (thd && row_rollback_on_timeout) { thd_mark_transaction_to_rollback(thd,
ha_rollback(thd); (bool)row_rollback_on_timeout);
}
return(HA_ERR_LOCK_WAIT_TIMEOUT); return(HA_ERR_LOCK_WAIT_TIMEOUT);
...@@ -666,9 +663,7 @@ convert_error_code_to_mysql( ...@@ -666,9 +663,7 @@ convert_error_code_to_mysql(
tell it also to MySQL so that MySQL knows to empty the tell it also to MySQL so that MySQL knows to empty the
cached binlog for this transaction */ cached binlog for this transaction */
if (thd) { thd_mark_transaction_to_rollback(thd, TRUE);
ha_rollback(thd);
}
return(HA_ERR_LOCK_TABLE_FULL); return(HA_ERR_LOCK_TABLE_FULL);
} else if (error == DB_TOO_MANY_CONCURRENT_TRXS) { } else if (error == DB_TOO_MANY_CONCURRENT_TRXS) {
......
...@@ -242,4 +242,11 @@ int thd_non_transactional_update(const MYSQL_THD thd); ...@@ -242,4 +242,11 @@ int thd_non_transactional_update(const MYSQL_THD thd);
@return Value to be used as index into the binlog_format_names array @return Value to be used as index into the binlog_format_names array
*/ */
int thd_binlog_format(const MYSQL_THD thd); int thd_binlog_format(const MYSQL_THD thd);
/**
Mark transaction to rollback and mark error as fatal to a sub-statement.
@param thd Thread handle
@param all TRUE <=> rollback main transaction.
*/
void thd_mark_transaction_to_rollback(MYSQL_THD thd, bool all);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment