summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2013-07-25 13:40:18 +0400
committerSergey Vojtovich <svoj@mariadb.org>2013-07-25 13:40:18 +0400
commite33e9825a4316164ce304c321985ba19ff98be7d (patch)
tree18dc04f890ee60d7f80ef7828f9c6a58530e1c03 /sql
parent9388822c5d952a1b36d3c675acb8f0c0775b6757 (diff)
downloadmariadb-git-e33e9825a4316164ce304c321985ba19ff98be7d.tar.gz
MDEV-4786 - merge 10.0-monty - 10.0
Fixed main.innodb_mysql_sync failure. TDC_RT_REMOVE_NOT_OWN_KEEP_SHARE is not same as TDC_RT_REMOVE_NOT_OWN_AND_MARK_NOT_USABLE. Comment in sql_table.cc says: Storage engine has requested exclusive lock only for prepare phase and we are not under LOCK TABLES. Don't mark TABLE_SHARE as old in this case, as this won't allow opening of table by other threads during main phase of in-place ALTER TABLE. At this moment we hold exclusive metadata lock, all we should do is purge unused TABLE objects. sql/sql_base.cc: Restore 5.6 behavior of TDC_RT_REMOVE_NOT_OWN_KEEP_SHARE. sql/sql_base.h: Restore 5.6 behavior of TDC_RT_REMOVE_NOT_OWN_KEEP_SHARE.
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_base.cc2
-rw-r--r--sql/sql_base.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 5baf05c7f38..c39786c7c45 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -9611,7 +9611,7 @@ void tdc_remove_table(THD *thd, enum_tdc_remove_table_type remove_type,
*/
if (remove_type == TDC_RT_REMOVE_NOT_OWN)
share->remove_from_cache_at_close();
- else
+ else if (remove_type != TDC_RT_REMOVE_NOT_OWN_KEEP_SHARE)
{
/* Ensure that no can open the table while it's used */
share->protect_against_usage();
diff --git a/sql/sql_base.h b/sql/sql_base.h
index a4f35b59ba9..cff7432d00f 100644
--- a/sql/sql_base.h
+++ b/sql/sql_base.h
@@ -61,8 +61,8 @@ enum find_item_error_report_type {REPORT_ALL_ERRORS, REPORT_EXCEPT_NOT_FOUND,
enum enum_tdc_remove_table_type {TDC_RT_REMOVE_ALL, TDC_RT_REMOVE_NOT_OWN,
TDC_RT_REMOVE_UNUSED,
- TDC_RT_REMOVE_NOT_OWN_AND_MARK_NOT_USABLE};
-#define TDC_RT_REMOVE_NOT_OWN_KEEP_SHARE TDC_RT_REMOVE_NOT_OWN_AND_MARK_NOT_USABLE
+ TDC_RT_REMOVE_NOT_OWN_AND_MARK_NOT_USABLE,
+ TDC_RT_REMOVE_NOT_OWN_KEEP_SHARE};
/* bits for last argument to remove_table_from_cache() */
#define RTFC_NO_FLAG 0x0000