Bug #43536 BACKUP with absolute path fails on invalid backupdir
Submitted: 10 Mar 2009 15:12 Modified: 20 Mar 2009 16:36
Reporter: Ingo Strüwing Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Backup Severity:S2 (Serious)
Version:6.0 OS:Any
Assigned to: Chuck Bell CPU Architecture:Any

[10 Mar 2009 15:12] Ingo Strüwing
Description:
SET @@global.backupdir= 'This_is_really_stupid/not/there/at/all';
BACKUP DATABASE bup_backupdir TO '$MYSQLTEST_VARDIR/bup_backupdir7.bak';
mysqltest: At line 183: query 'BACKUP DATABASE bup_backupdir TO
'$MYSQLTEST_VARDIR/bup_backupdir7.bak'' failed: 1733: The path specified for the system variable backupdir cannot be accessed or is invalid. ref: This_is_really_stupid/not/there/at/all

I report this as a bug, because I feel that this should work. A DBA, who can set the server variable, should not be able to block all backup attempts by other DBAs. Using an absoulte path would be a workaround until the variable is reset to a correct value.

However, it might also be a feature. Hence I assigned it to Chuck for verification or refusal.

How to repeat:
See description.
[17 Mar 2009 20:52] Chuck Bell
This is not a bug. It was discussed in the design work for the backupdir that this condition should force backup to fail.
[18 Mar 2009 8:30] Ingo Strüwing
Hi docs team,

please add a few sentences to the user manual regarding the server variable "backupdir":

If backupdir is set to a non-existent path, no BACKUP nor RESTORE statement can be executed. The same is true if backupdir references a symbolic link, which itself points at a non-existent path. Specifying the backup image file name as an absolute path name does not help.

If backupdir is set to an existent plain file or pipe, BACKUP and RESTORE can be done to absolute path names only. The same is true if backupdir references a symbolic link, which itself points at an existent plain file or pipe.
[18 Mar 2009 9:03] Ingo Strüwing
Hi docs team,

sorry the last paragraph is incomplete. It should read like this:

If backupdir is set to an existent plain file or pipe, BACKUP and RESTORE can not be done to a relative path name, unless it starts with "../". BACKUP and RESTORE can be done to absolute path names. The same is true if backupdir references a symbolic link, which itself points at an existent plain file or pipe.

After updating the manual, please return this bug report to the "not a bug" state.
[20 Mar 2009 16:36] Paul DuBois
I've updated the description of backupdir per Ingo's remarks.