Bug #40475 my_open.c#my_open accepts space only and special characters as filenames
Submitted: 3 Nov 2008 9:03 Modified: 16 Feb 2009 9:15
Reporter: Jørgen Løland Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:6.0 OS:Any
Assigned to: CPU Architecture:Any
Triage: Triaged: D3 (Medium)

[3 Nov 2008 9:03] Jørgen Løland
Description:
my_open can be used to create files containing of only space or special characters. For cross-platform compatibility, it should be considered whether such file names are acceptable.

The symptoms were first seen in backup, see bug#34770.

How to repeat:
For special characters:
select 5 into outfile '__**))!@#$%^&*';

For space - call my_open with space file name:
char* mystr="/tmp/ ";
m_fd= my_open(mystr, m_flags, MYF(0));

In linux, both files are created successfully.
[3 Nov 2008 9:03] Jørgen Løland
Email from Peter G:
-------------------
Users should avoid odd characters for portability reasons,
but I'm unable to find a statement in the manual saying
"don't use these characters". And RESTORE works.
[3 Nov 2008 11:02] Sveta Smirnova
Thank you for the report.

As you noted in hidden comment there is no word in manual about having filename from only special characters is not allowed and it works. Why do you want this to be not allowed?

Regarding to spaces please indicate how user can create such a file and why it is problem.
[10 Nov 2008 13:53] Jørgen Løland
Special characters - as Peter G says: "for compatibility".

For space-only filenames, you'll have to look at the code sample pasted above. 

If file names

'#¤%&¤.bup' and ' ' are not considered problematic, this bug report can be closed as "Won't fix".
[16 Feb 2009 9:08] Jørgen Løland
Example compatibility problem:

When executing "backup database db to '*';"

On Linux: Creates a file named '*'
On Windows: Errors
[16 Feb 2009 9:15] Sveta Smirnova
Thank you for the feedback.

Verified as described: we should define and document if it is allowed or not.
[16 Feb 2009 9:51] Sergei Golubchik
why should it be disallowed ? perfectly valid file names.
[23 Feb 2009 11:33] Jørgen Løland
I'm saying "For cross-platform compatibility, it should be considered whether such file names are acceptable." If cross-platform compatibility is not a concern here, feel free to close the bug.