Skip to content

Commit 092834c

Browse files
committed
Removed kill_delayed_threads_for_table()
After 7fb9d64 it is used only by ALTER/DROP SERVER, which most probably wasn't intentional as Federated never supported delayed inserts anyway. If delayed inserts will ever become an issue with ALTER/DROP SERVER, we should kill them by acquiring X-lock instead. Part of MDEV-17882 - Cleanup refresh version
1 parent 0aa807d commit 092834c

13 files changed

+27
-80
lines changed

sql/rpl_gtid.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ rpl_slave_state::truncate_state_table(THD *thd)
425425
if (!(err= open_and_lock_tables(thd, &tlist, FALSE, 0)))
426426
{
427427
tdc_remove_table(thd, TDC_RT_REMOVE_UNUSED, "mysql",
428-
rpl_gtid_slave_state_table_name.str, false);
428+
rpl_gtid_slave_state_table_name.str);
429429
err= tlist.table->file->ha_truncate();
430430

431431
if (err)

sql/sql_admin.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1158,7 +1158,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
11581158
else if (open_for_modify || fatal_error)
11591159
{
11601160
tdc_remove_table(thd, TDC_RT_REMOVE_UNUSED,
1161-
table->db.str, table->table_name.str, FALSE);
1161+
table->db.str, table->table_name.str);
11621162
/*
11631163
May be something modified. Consequently, we have to
11641164
invalidate the query cache.

sql/sql_base.cc

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ bool close_cached_tables(THD *thd, TABLE_LIST *tables,
450450

451451
for (TABLE_LIST *table= tables; table; table= table->next_local)
452452
tdc_remove_table(thd, TDC_RT_REMOVE_ALL, table->db.str,
453-
table->table_name.str, false);
453+
table->table_name.str);
454454
}
455455
DBUG_RETURN(false);
456456
}
@@ -717,7 +717,7 @@ bool close_cached_connection_tables(THD *thd, LEX_CSTRING *connection)
717717
for (TABLE_LIST *table= argument.tables; table; table= table->next_local)
718718
res|= tdc_remove_table(thd, TDC_RT_REMOVE_UNUSED,
719719
table->db.str,
720-
table->table_name.str, TRUE);
720+
table->table_name.str);
721721

722722
/* Return true if we found any open connections */
723723
DBUG_RETURN(res);
@@ -846,12 +846,9 @@ close_all_tables_for_name(THD *thd, TABLE_SHARE *share,
846846
prev= &table->next;
847847
}
848848
}
849+
/* Remove the table share from the cache. */
849850
if (skip_table == NULL)
850-
{
851-
/* Remove the table share from the cache. */
852-
tdc_remove_table(thd, TDC_RT_REMOVE_ALL, db, table_name,
853-
FALSE);
854-
}
851+
tdc_remove_table(thd, TDC_RT_REMOVE_ALL, db, table_name);
855852
}
856853

857854

@@ -1414,8 +1411,7 @@ bool wait_while_table_is_used(THD *thd, TABLE *table,
14141411
DBUG_RETURN(TRUE);
14151412

14161413
tdc_remove_table(thd, TDC_RT_REMOVE_NOT_OWN,
1417-
table->s->db.str, table->s->table_name.str,
1418-
FALSE);
1414+
table->s->db.str, table->s->table_name.str);
14191415
/* extra() call must come only after all instances above are closed */
14201416
if (function != HA_EXTRA_NOT_USED)
14211417
(void) table->file->extra(function);
@@ -1456,8 +1452,7 @@ void drop_open_table(THD *thd, TABLE *table, const LEX_CSTRING *db_name,
14561452
table->file->extra(HA_EXTRA_PREPARE_FOR_DROP);
14571453
close_thread_table(thd, &thd->open_tables);
14581454
/* Remove the table share from the table cache. */
1459-
tdc_remove_table(thd, TDC_RT_REMOVE_ALL, db_name->str, table_name->str,
1460-
FALSE);
1455+
tdc_remove_table(thd, TDC_RT_REMOVE_ALL, db_name->str, table_name->str);
14611456
/* Remove the table from the storage engine and rm the .frm. */
14621457
quick_rm_table(thd, table_type, db_name, table_name, 0);
14631458
}
@@ -3046,8 +3041,7 @@ static bool auto_repair_table(THD *thd, TABLE_LIST *table_list)
30463041
tdc_release_share(share);
30473042
/* Remove the repaired share from the table cache. */
30483043
tdc_remove_table(thd, TDC_RT_REMOVE_ALL,
3049-
table_list->db.str, table_list->table_name.str,
3050-
FALSE);
3044+
table_list->db.str, table_list->table_name.str);
30513045
end_free:
30523046
my_free(entry);
30533047
return result;
@@ -3219,7 +3213,7 @@ Open_table_context::recover_from_failed_open()
32193213
break;
32203214

32213215
tdc_remove_table(m_thd, TDC_RT_REMOVE_ALL, m_failed_table->db.str,
3222-
m_failed_table->table_name.str, FALSE);
3216+
m_failed_table->table_name.str);
32233217

32243218
m_thd->get_stmt_da()->clear_warning_info(m_thd->query_id);
32253219
m_thd->clear_error(); // Clear error message
@@ -3255,7 +3249,7 @@ Open_table_context::recover_from_failed_open()
32553249
break;
32563250

32573251
tdc_remove_table(m_thd, TDC_RT_REMOVE_ALL, m_failed_table->db.str,
3258-
m_failed_table->table_name.str, FALSE);
3252+
m_failed_table->table_name.str);
32593253

32603254
result= auto_repair_table(m_thd, m_failed_table);
32613255
/*

sql/sql_db.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "sql_acl.h" // SELECT_ACL, DB_ACLS,
3232
// acl_get, check_grant_db
3333
#include "log_event.h" // Query_log_event
34-
#include "sql_base.h" // lock_table_names, tdc_remove_table
34+
#include "sql_base.h" // lock_table_names
3535
#include "sql_handler.h" // mysql_ha_rm_tables
3636
#include "sql_class.h"
3737
#include <mysys_err.h>

sql/sql_partition_admin.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ bool Sql_cmd_alter_table_truncate_partition::execute(THD *thd)
826826
DBUG_RETURN(TRUE);
827827

828828
tdc_remove_table(thd, TDC_RT_REMOVE_NOT_OWN, first_table->db.str,
829-
first_table->table_name.str, FALSE);
829+
first_table->table_name.str);
830830

831831
partition= (ha_partition*) first_table->table->file;
832832
/* Invoke the handler method responsible for truncating the partition. */

sql/sql_reload.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ bool flush_tables_with_read_lock(THD *thd, TABLE_LIST *all_tables)
545545
/* Request removal of table from cache. */
546546
tdc_remove_table(thd, TDC_RT_REMOVE_UNUSED,
547547
table_list->db.str,
548-
table_list->table_name.str, FALSE);
548+
table_list->table_name.str);
549549
/* Reset ticket to satisfy asserts in open_tables(). */
550550
table_list->mdl_request.ticket= NULL;
551551
}

sql/sql_rename.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ do_rename(THD *thd, TABLE_LIST *ren_table, const LEX_CSTRING *new_db,
287287
{
288288
DBUG_ASSERT(!thd->locked_tables_mode);
289289
tdc_remove_table(thd, TDC_RT_REMOVE_ALL,
290-
ren_table->db.str, ren_table->table_name.str, false);
290+
ren_table->db.str, ren_table->table_name.str);
291291

292292
if (hton != view_pseudo_hton)
293293
{

sql/sql_table.cc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2470,8 +2470,8 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists,
24702470
table->table= 0;
24712471
}
24722472
else
2473-
tdc_remove_table(thd, TDC_RT_REMOVE_ALL, table->db.str, table->table_name.str,
2474-
false);
2473+
tdc_remove_table(thd, TDC_RT_REMOVE_ALL, table->db.str,
2474+
table->table_name.str);
24752475

24762476
/* Check that we have an exclusive lock on the table to be dropped. */
24772477
DBUG_ASSERT(thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db.str,
@@ -7626,8 +7626,7 @@ static bool mysql_inplace_alter_table(THD *thd,
76267626
goto cleanup;
76277627

76287628
tdc_remove_table(thd, TDC_RT_REMOVE_NOT_OWN_KEEP_SHARE,
7629-
table->s->db.str, table->s->table_name.str,
7630-
false);
7629+
table->s->db.str, table->s->table_name.str);
76317630
}
76327631

76337632
/*
@@ -7821,7 +7820,7 @@ static bool mysql_inplace_alter_table(THD *thd,
78217820
{
78227821
// Remove TABLE and TABLE_SHARE for old name from TDC.
78237822
tdc_remove_table(thd, TDC_RT_REMOVE_ALL,
7824-
alter_ctx->db.str, alter_ctx->table_name.str, false);
7823+
alter_ctx->db.str, alter_ctx->table_name.str);
78257824

78267825
if (mysql_rename_table(db_type, &alter_ctx->db, &alter_ctx->table_name,
78277826
&alter_ctx->new_db, &alter_ctx->new_alias, 0))

sql/sql_truncate.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ bool Sql_cmd_truncate_table::lock_table(THD *thd, TABLE_LIST *table_ref,
361361
{
362362
/* Table is already locked exclusively. Remove cached instances. */
363363
tdc_remove_table(thd, TDC_RT_REMOVE_ALL, table_ref->db.str,
364-
table_ref->table_name.str, FALSE);
364+
table_ref->table_name.str);
365365
}
366366

367367
DBUG_RETURN(FALSE);

sql/sql_view.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,8 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
646646
*/
647647

648648
if (!res)
649-
tdc_remove_table(thd, TDC_RT_REMOVE_ALL, view->db.str, view->table_name.str, false);
649+
tdc_remove_table(thd, TDC_RT_REMOVE_ALL, view->db.str,
650+
view->table_name.str);
650651

651652
if (!res && mysql_bin_log.is_open())
652653
{
@@ -1866,8 +1867,8 @@ bool mysql_drop_view(THD *thd, TABLE_LIST *views, enum_drop_mode drop_mode)
18661867
For a view, there is a TABLE_SHARE object.
18671868
Remove it from the table definition cache, in case the view was cached.
18681869
*/
1869-
tdc_remove_table(thd, TDC_RT_REMOVE_ALL, view->db.str, view->table_name.str,
1870-
FALSE);
1870+
tdc_remove_table(thd, TDC_RT_REMOVE_ALL, view->db.str,
1871+
view->table_name.str);
18711872
query_cache_invalidate3(thd, view, 0);
18721873
sp_cache_invalidate();
18731874
}

0 commit comments

Comments
 (0)