Skip to content

Commit 0e63366

Browse files
committed
fixed a bug that the table metadata lock is not released when open_index is failed
1 parent f9bc8f9 commit 0e63366

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

handlersocket/database.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -476,12 +476,12 @@ void
476476
dbcontext::close_tables_if()
477477
{
478478
unlock_tables_if();
479+
DENA_VERBOSE(100, fprintf(stderr, "HNDSOCK close tables\n"));
480+
close_thread_tables(thd);
481+
#if MYSQL_VERSION_ID >= 50505
482+
thd->mdl_context.release_transactional_locks();
483+
#endif
479484
if (!table_vec.empty()) {
480-
DENA_VERBOSE(100, fprintf(stderr, "HNDSOCK close tables\n"));
481-
close_thread_tables(thd);
482-
#if MYSQL_VERSION_ID >= 50505
483-
thd->mdl_context.release_transactional_locks();
484-
#endif
485485
statistic_increment(close_tables_count, &LOCK_status);
486486
table_vec.clear();
487487
table_map.clear();

regtest/test_01_lib/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
TESTS="01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19";
3+
TESTS="01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20";
44

55
source ../common/compat.sh
66

0 commit comments

Comments
 (0)