Commit 62240ce5 authored by Marko Mäkelä's avatar Marko Mäkelä

Bug#59464 Race condition in row_vers_build_for_semi_consistent_read

row_vers_build_for_semi_consistent_read(): Dereference version_trx before
releasing kernel_mutex, but not thereafter.
parent 57d33262
...@@ -593,11 +593,15 @@ row_vers_build_for_semi_consistent_read( ...@@ -593,11 +593,15 @@ row_vers_build_for_semi_consistent_read(
mutex_enter(&kernel_mutex); mutex_enter(&kernel_mutex);
version_trx = trx_get_on_id(version_trx_id); version_trx = trx_get_on_id(version_trx_id);
if (version_trx
&& (version_trx->conc_state == TRX_COMMITTED_IN_MEMORY
|| version_trx->conc_state == TRX_NOT_STARTED)) {
version_trx = NULL;
}
mutex_exit(&kernel_mutex); mutex_exit(&kernel_mutex);
if (!version_trx if (!version_trx) {
|| version_trx->conc_state == TRX_NOT_STARTED
|| version_trx->conc_state == TRX_COMMITTED_IN_MEMORY) {
/* We found a version that belongs to a /* We found a version that belongs to a
committed transaction: return it. */ committed transaction: return it. */
......
2011-01-25 The InnoDB Team
* row/row0vers.c:
Fix Bug#59464 Race condition in row_vers_build_for_semi_consistent_read
2011-01-25 The InnoDB Team 2011-01-25 The InnoDB Team
* btr/btr0btr.c, btr/btr0cur.c, btr/btr0sea.c, * btr/btr0btr.c, btr/btr0cur.c, btr/btr0sea.c,
......
...@@ -669,11 +669,15 @@ row_vers_build_for_semi_consistent_read( ...@@ -669,11 +669,15 @@ row_vers_build_for_semi_consistent_read(
mutex_enter(&kernel_mutex); mutex_enter(&kernel_mutex);
version_trx = trx_get_on_id(version_trx_id); version_trx = trx_get_on_id(version_trx_id);
if (version_trx
&& (version_trx->conc_state == TRX_COMMITTED_IN_MEMORY
|| version_trx->conc_state == TRX_NOT_STARTED)) {
version_trx = NULL;
}
mutex_exit(&kernel_mutex); mutex_exit(&kernel_mutex);
if (!version_trx if (!version_trx) {
|| version_trx->conc_state == TRX_NOT_STARTED
|| version_trx->conc_state == TRX_COMMITTED_IN_MEMORY) {
/* We found a version that belongs to a /* We found a version that belongs to a
committed transaction: return it. */ committed transaction: return it. */
......
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