summaryrefslogtreecommitdiff
path: root/sql/table_cache.cc
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2018-12-09 14:29:32 +0400
committerSergey Vojtovich <svoj@mariadb.org>2018-12-09 14:29:32 +0400
commit03922bb3871766f58dafbb465c67c8f66e1aad4b (patch)
tree07c92bcb1b22dfcff1ef692cb57029641249b53f /sql/table_cache.cc
parent09bad0958452df9323fcb9049f62a23468e978f5 (diff)
downloadmariadb-git-bb-10.4-svoj-backup.tar.gz
Fixed false positive from close_cached_connection_tablesbb-10.4-svoj-backup
Diffstat (limited to 'sql/table_cache.cc')
-rw-r--r--sql/table_cache.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/sql/table_cache.cc b/sql/table_cache.cc
index 099181cb33c..c23bb53b9a9 100644
--- a/sql/table_cache.cc
+++ b/sql/table_cache.cc
@@ -1094,6 +1094,7 @@ bool tdc_remove_table(THD *thd, enum_tdc_remove_table_type remove_type,
TABLE *table;
TDC_element *element;
uint my_refs= 1;
+ bool res= false;
DBUG_ENTER("tdc_remove_table");
DBUG_PRINT("enter",("name: %s remove_type: %d", table_name, remove_type));
@@ -1122,7 +1123,7 @@ bool tdc_remove_table(THD *thd, enum_tdc_remove_table_type remove_type,
mysql_mutex_unlock(&LOCK_unused_shares);
tdc_delete_share_from_hash(element);
- DBUG_RETURN(true);
+ DBUG_RETURN(false);
}
mysql_mutex_unlock(&LOCK_unused_shares);
@@ -1188,10 +1189,16 @@ bool tdc_remove_table(THD *thd, enum_tdc_remove_table_type remove_type,
#endif
mysql_mutex_unlock(&element->LOCK_table_share);
}
+ else
+ {
+ mysql_mutex_lock(&element->LOCK_table_share);
+ res= element->ref_count > 1;
+ mysql_mutex_unlock(&element->LOCK_table_share);
+ }
tdc_release_share(element->share);
- DBUG_RETURN(true);
+ DBUG_RETURN(res);
}