Commit f671a9de authored by Monty's avatar Monty Committed by Sergei Golubchik

Replace find_temporary_table() with is_temporary_table()

DROP TABLE opens all temporary tables at start, but then
uses find_temporary_table() to check if a table is temporary
instead of is_temporary_table() which is much faster.

This patch fixes this issue.
parent 949d10be
...@@ -4930,7 +4930,7 @@ mysql_execute_command(THD *thd) ...@@ -4930,7 +4930,7 @@ mysql_execute_command(THD *thd)
{ {
if (!lex->tmp_table() && if (!lex->tmp_table() &&
(!thd->is_current_stmt_binlog_format_row() || (!thd->is_current_stmt_binlog_format_row() ||
!thd->find_temporary_table(table))) !is_temporary_table(table)))
{ {
WSREP_TO_ISOLATION_BEGIN(NULL, NULL, all_tables); WSREP_TO_ISOLATION_BEGIN(NULL, NULL, all_tables);
break; break;
......
...@@ -2131,8 +2131,7 @@ bool mysql_rm_table(THD *thd,TABLE_LIST *tables, bool if_exists, ...@@ -2131,8 +2131,7 @@ bool mysql_rm_table(THD *thd,TABLE_LIST *tables, bool if_exists,
{ {
LEX_CSTRING db_name= table->db; LEX_CSTRING db_name= table->db;
LEX_CSTRING table_name= table->table_name; LEX_CSTRING table_name= table->table_name;
if (table->open_type == OT_BASE_ONLY || if (!is_temporary_table(table))
!thd->find_temporary_table(table))
(void) delete_statistics_for_table(thd, &db_name, &table_name); (void) delete_statistics_for_table(thd, &db_name, &table_name);
} }
} }
......
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