Bug #85186 Ability to delete/modify files that are created by using SELECT INTO OUTFILE
Submitted: 26 Feb 2017 11:57 Modified: 30 Nov 2021 13:35
Reporter: Aleksey Filippov Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: DML Severity:S4 (Feature request)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any

[26 Feb 2017 11:57] Aleksey Filippov
Implement the ability to delete/modify files that are created by using SELECT INTO OUTFILE
At the moment, for security reasons in MySQL implemented the ability to create files only through SELECT INTO OUTFILE.
The ability to overwrite or delete files is missing. In the case of a large number of files you create, implementation of removal procedure possible only in non MySQL way.
It is proposed to implement the safe removal option for OUTFILEs. For example:
1. Allow only delete the files that exist in directories tmpdir, thus isolating the OS from the database.
2. Implement registration procedure for all files created using the OUTFILE, respectively delete and change only files passed the registration procedure.
3. Create a single global parameter specifies where OUTILEs will be created, and allows you to manipulate files only within this parameter.
4. Create a global parameter that will indicate the allowable operations for OUTFILEs (create, change, delete)
In MySQL really lacking quality file manipulation procedures.

How to repeat:
2. No way to remove that file using MySQL
[26 Feb 2017 18:51] MySQL Verification Team
i used to have to select into an outfile with .frm extension in the current database and use drop table/drop view to get rid of it. it's not very elegant..
[30 Nov 2021 13:35] MySQL Verification Team
Hello Aleksey,

Thank you for the reasonable feature request!