convert_error_code_to_mysql(): Do not call thd_mark_transaction_to_rollback()

when thd is NULL.
This commit is contained in:
marko 2007-11-30 12:20:56 +00:00
parent da72864792
commit 2883a914f3

View file

@ -600,7 +600,9 @@ convert_error_code_to_mysql(
tell it also to MySQL so that MySQL knows to empty the
cached binlog for this transaction */
thd_mark_transaction_to_rollback(thd, TRUE);
if (thd) {
thd_mark_transaction_to_rollback(thd, TRUE);
}
return(HA_ERR_LOCK_DEADLOCK);
} else if (error == (int) DB_LOCK_WAIT_TIMEOUT) {
@ -609,8 +611,10 @@ convert_error_code_to_mysql(
latest SQL statement in a lock wait timeout. Previously, we
rolled back the whole transaction. */
thd_mark_transaction_to_rollback(thd,
(bool)row_rollback_on_timeout);
if (thd) {
thd_mark_transaction_to_rollback(
thd, (bool)row_rollback_on_timeout);
}
return(HA_ERR_LOCK_WAIT_TIMEOUT);
@ -662,7 +666,9 @@ convert_error_code_to_mysql(
tell it also to MySQL so that MySQL knows to empty the
cached binlog for this transaction */
thd_mark_transaction_to_rollback(thd, TRUE);
if (thd) {
thd_mark_transaction_to_rollback(thd, TRUE);
}
return(HA_ERR_LOCK_TABLE_FULL);
} else if (error == DB_TOO_MANY_CONCURRENT_TRXS) {