Commit e33e9825 authored by Sergey Vojtovich's avatar Sergey Vojtovich

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.
parent 9388822c
......@@ -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();
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment