mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
MDEV-7832 Add status variables to track CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE
Pretend that CREATE TABLE and CREATE TEMPORARY TABLE are two different commands internally. The user doesn't need to know that they both are SQLCOM_CREATE_TABLE. Same for DROP [TEMPORARY] TABLE
This commit is contained in:
@ -3176,6 +3176,12 @@ mysql_execute_command(THD *thd)
|
||||
TABLE_LIST *create_table= first_table;
|
||||
TABLE_LIST *select_tables= lex->create_last_non_select_table->next_global;
|
||||
|
||||
if (lex->tmp_table())
|
||||
{
|
||||
status_var_decrement(thd->status_var.com_stat[SQLCOM_CREATE_TABLE]);
|
||||
status_var_increment(thd->status_var.com_create_tmp_table);
|
||||
}
|
||||
|
||||
/*
|
||||
Code below (especially in mysql_create_table() and select_create
|
||||
methods) may modify HA_CREATE_INFO structure in LEX, so we have to
|
||||
@ -4131,6 +4137,9 @@ end_with_restore_list:
|
||||
}
|
||||
else
|
||||
{
|
||||
status_var_decrement(thd->status_var.com_stat[SQLCOM_DROP_TABLE]);
|
||||
status_var_increment(thd->status_var.com_drop_tmp_table);
|
||||
|
||||
/* So that DROP TEMPORARY TABLE gets to binlog at commit/rollback */
|
||||
thd->variables.option_bits|= OPTION_KEEP_LOG;
|
||||
}
|
||||
|
Reference in New Issue
Block a user