diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2015-06-04 13:00:53 +0300 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2015-06-04 15:02:24 +0300 |
commit | a8b8544a03f56a6a2c6357a7ea137cbb17a6372b (patch) | |
tree | 8702ecac0c0820d0e33e6b3fa75953587c8b5f30 /storage/xtradb | |
parent | c79e98e4918635da126231224088c054a21917be (diff) | |
download | mariadb-git-a8b8544a03f56a6a2c6357a7ea137cbb17a6372b.tar.gz |
MDEV-7906: InnoDB: Failing assertion: prebuilt->sql_stat_start || trx->state == 1 on concurrent multi-table update
Analysis: Problem is that SQL-layer calls handler API after storage
engine has already returned error state. InnoDB does internal
rollback when it notices transaction error (e.g. lock wait timeout,
deadlock, etc.) and after this transaction is not naturally in
correct state to continue.
Fix: Do not continue fetch operations if transaction is not started.
Diffstat (limited to 'storage/xtradb')
-rw-r--r-- | storage/xtradb/handler/ha_innodb.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index ac883e9ee6b..5034e7e70e1 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -102,7 +102,6 @@ extern "C" { #include "ibuf0ibuf.h" enum_tx_isolation thd_get_trx_isolation(const THD* thd); - } #include "ha_innodb.h" @@ -7327,6 +7326,11 @@ ha_innobase::general_fetch( DBUG_ENTER("general_fetch"); + /* If transaction is not startted do not continue, instead return a error code. */ + if(!(prebuilt->sql_stat_start || (prebuilt->trx && prebuilt->trx->state == 1))) { + DBUG_RETURN(HA_ERR_END_OF_FILE); + } + if (UNIV_UNLIKELY(share->ib_table->is_corrupt && srv_pass_corrupt_table <= 1)) { DBUG_RETURN(HA_ERR_CRASHED); |