summaryrefslogtreecommitdiff
path: root/storage/tokudb/ha_tokudb_alter_56.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-06-27 20:35:26 +0200
committerSergei Golubchik <serg@mariadb.org>2015-06-27 20:35:26 +0200
commit658992699b204da04382142e77af042c8a33a334 (patch)
tree464bc87eae9ffb0fd1a7ba6fa11148b50a295d6b /storage/tokudb/ha_tokudb_alter_56.cc
parentfe7e334f3e238368e18fc2ccb98b3357ecb1e03e (diff)
parenta6087e7dc1ef3561d8189c8db15e9591d0f9b520 (diff)
downloadmariadb-git-658992699b204da04382142e77af042c8a33a334.tar.gz
Merge tag 'mariadb-10.0.20' into 10.1
Diffstat (limited to 'storage/tokudb/ha_tokudb_alter_56.cc')
-rw-r--r--storage/tokudb/ha_tokudb_alter_56.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/storage/tokudb/ha_tokudb_alter_56.cc b/storage/tokudb/ha_tokudb_alter_56.cc
index d574bae9a33..28c0b4419c0 100644
--- a/storage/tokudb/ha_tokudb_alter_56.cc
+++ b/storage/tokudb/ha_tokudb_alter_56.cc
@@ -784,13 +784,16 @@ bool ha_tokudb::commit_inplace_alter_table(TABLE *altered_table, Alter_inplace_i
assert(trx->tokudb_lock_count > 0);
// for partitioned tables, we use a single transaction to do all of the partition changes. the tokudb_lock_count
// is a reference count for each of the handlers to the same transaction. obviously, we want to only abort once.
- if (!--trx->tokudb_lock_count) {
- abort_txn(ctx->alter_txn);
- ctx->alter_txn = NULL;
- trx->stmt = NULL;
- trx->sub_sp_level = NULL;
+ if (trx->tokudb_lock_count > 0) {
+ if (--trx->tokudb_lock_count <= trx->create_lock_count) {
+ trx->create_lock_count = 0;
+ abort_txn(ctx->alter_txn);
+ ctx->alter_txn = NULL;
+ trx->stmt = NULL;
+ trx->sub_sp_level = NULL;
+ }
+ transaction = NULL;
}
- transaction = NULL;
if (ctx->add_index_changed) {
restore_add_index(table, ha_alter_info->index_add_count, ctx->incremented_num_DBs, ctx->modified_DBs);