1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Make all #sql temporary table names uniform

The reason for this is to make all temporary file names similar and
also to be able to figure out from where a #sql-xxx name orginates.

New format is for most cases:
'#sql-name-current_pid-thread_id[-increment]'
Where name is one of subselect, alter, exchange, temptable or backup

The exceptions are:
ALTER PARTITION shadow files:
'#sql-shadow-thread_id-'original_table_name'

Names used with temp pool:
'#sql-name-current_pid-pool_number'
This commit is contained in:
Monty
2020-04-09 16:52:59 +03:00
parent eca5c2c67f
commit f40ca33bbc
16 changed files with 140 additions and 119 deletions

View File

@ -600,8 +600,8 @@ bool Sql_cmd_alter_table_exchange_partition::
swap_table_list->db.str,
swap_table_list->table_name.str,
"", 0);
/* create a unique temp name #sqlx-nnnn_nnnn, x for eXchange */
my_snprintf(temp_name, sizeof(temp_name), "%sx-%lx_%llx",
/* create a unique temp name */
my_snprintf(temp_name, sizeof(temp_name), "%s-exchange-%lx-%llx",
tmp_file_prefix, current_pid, thd->thread_id);
if (lower_case_table_names)
my_casedn_str(files_charset_info, temp_name);