summaryrefslogtreecommitdiff
path: root/sql/sql_sequence.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@mariadb.org>2018-05-09 06:39:38 +0300
committerMichael Widenius <monty@mariadb.org>2018-05-14 10:08:04 +0300
commitd853042b5f6ae67bddd87045e9f80438e4bd92f4 (patch)
treefd5bbc3febaf0c7a0feab8ee1a27b481ebae7a81 /sql/sql_sequence.cc
parent15419a558370aeed9521b498c34d50f20a8d47a5 (diff)
downloadmariadb-git-d853042b5f6ae67bddd87045e9f80438e4bd92f4.tar.gz
Added missing write_unlock() in case of errors
Diffstat (limited to 'sql/sql_sequence.cc')
-rw-r--r--sql/sql_sequence.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/sql_sequence.cc b/sql/sql_sequence.cc
index cb208a7b2e0..21a8781087f 100644
--- a/sql/sql_sequence.cc
+++ b/sql/sql_sequence.cc
@@ -459,7 +459,10 @@ int SEQUENCE::read_initial_values(TABLE *table)
mdl_requests.push_front(&mdl_request);
if (thd->mdl_context.acquire_locks(&mdl_requests,
thd->variables.lock_wait_timeout))
+ {
+ write_unlock(table);
DBUG_RETURN(HA_ERR_LOCK_WAIT_TIMEOUT);
+ }
}
save_lock_type= table->reginfo.lock_type;
table->reginfo.lock_type= TL_READ;
@@ -468,6 +471,7 @@ int SEQUENCE::read_initial_values(TABLE *table)
{
if (mdl_lock_used)
thd->mdl_context.release_lock(mdl_request.ticket);
+ write_unlock(table);
DBUG_RETURN(HA_ERR_LOCK_WAIT_TIMEOUT);
}
DBUG_ASSERT(table->reginfo.lock_type == TL_READ);