Commit 20b52e66 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:4920], in ha_tokudb.cc, protect indexer->close and indexer->abort with shanre->num_DBs_lock

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@44159 c7de825b-a66e-492c-adef-691d508d4ae1
parent 2a9c58c2
...@@ -3896,7 +3896,7 @@ int ha_tokudb::write_row(uchar * record) { ...@@ -3896,7 +3896,7 @@ int ha_tokudb::write_row(uchar * record) {
} }
} }
txn = create_sub_trans ? sub_trans : transaction; txn = create_sub_trans ? sub_trans : transaction;
if (tokudb_debug & TOKUDB_DEBUG_CHECK_KEY) { if (tokudb_debug & TOKUDB_DEBUG_CHECK_KEY) {
test_row_packing(record,&prim_key,&row); test_row_packing(record,&prim_key,&row);
...@@ -7484,7 +7484,9 @@ int ha_tokudb::tokudb_add_index( ...@@ -7484,7 +7484,9 @@ int ha_tokudb::tokudb_add_index(
error = indexer->build(indexer); error = indexer->build(indexer);
if (error) { goto cleanup; } if (error) { goto cleanup; }
rw_wrlock(&share->num_DBs_lock);
error = indexer->close(indexer); error = indexer->close(indexer);
rw_unlock(&share->num_DBs_lock);
if (error) { goto cleanup; } if (error) { goto cleanup; }
indexer = NULL; indexer = NULL;
} }
...@@ -7660,7 +7662,9 @@ int ha_tokudb::tokudb_add_index( ...@@ -7660,7 +7662,9 @@ int ha_tokudb::tokudb_add_index(
if (indexer != NULL) { if (indexer != NULL) {
sprintf(status_msg, "aborting creation of indexes."); sprintf(status_msg, "aborting creation of indexes.");
thd_proc_info(thd, status_msg); thd_proc_info(thd, status_msg);
rw_wrlock(&share->num_DBs_lock);
indexer->abort(indexer); indexer->abort(indexer);
rw_unlock(&share->num_DBs_lock);
} }
if (error == DB_LOCK_NOTGRANTED && ((tokudb_debug & TOKUDB_DEBUG_HIDE_DDL_LOCK_ERRORS) == 0)) { if (error == DB_LOCK_NOTGRANTED && ((tokudb_debug & TOKUDB_DEBUG_HIDE_DDL_LOCK_ERRORS) == 0)) {
sql_print_error("Could not add indexes to table %s because \ sql_print_error("Could not add indexes to table %s because \
......
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