Hi! <cut>
ALTER PARTITION shadow files: #sql-shadow-'original_table_name'
Please, add a thread_id here at the end. normally MDL should ensure that no two threads can have a shadow for the same table at the same time, but we have enough bugs as it is to introduce another vector when two threads can overwrite each other temp files.
That would make the file name even longer and I am not sure what happens if we table names goes much over NAME_LEN. I don't have time just now to check for possible name overruns (I think it should be save as most engines are using FN_REFLEN, but better safe than sorry.
Names from the temp pool: #sql-name-current_pid-pool_number
Would you mind if I drop temp pool completely in 10.5? It was added by Jeremy in January 2001 with the comment
Added --temp-pool option to mysqld. This will cause temporary files created to use a small set of filenames, to try and avoid problems in the Linux kernel.
And I doubt it's still an issue in 2020.
I think that reusing file names is still something that is a problem. We should do some tests for that before skipping this code. It's not a lot a code after all. Regard, Monty