Bug #59922 No value to backup-dir option uses the current work dir as backup dir
Submitted: 3 Feb 2011 16:11 Modified: 8 Feb 2011 0:03
Reporter: Hema Sridharan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Enterprise Backup Severity:S3 (Non-critical)
Version:MEB 3.6 OS:Linux
Assigned to: CPU Architecture:Any

[3 Feb 2011 16:11] Hema Sridharan
Description:
When running MEB using 3.6 version, we need to specify the --backup-dir option 
so that contents and files are copied to that directory. 
But if no value is mentioned, backup-dir takes the current working directory as 
backup directory and copies the files there.

As per design, --backup-dir should not take any default value and copy files 
there. Instead it should issue an error message as "Backup directory name 
missing" or something similar. 

I used the latest MEB 3.6 version from "bzrroot/meb/sbin-repo/single-bin" repo

How to repeat:
I executed the test from 
/export/home/tmp/mysql-5.1-meb-testing/mysql-test$
$MYSQLBACKUP --port=13000 --protocol=tcp --user=root --backup-dir=  backup

The above command will pass and backup logs will be produced where it specifies that "Existing backup dir '/export/home2/tmp/mysql-5.1-meb-testing/mysql-test/' will be reused"

If you notice above, the current working directory or from the place where the 
test is executed is taken as backup directory if no value is mentioned for 
backup-dir option.

The contents are copied in mysql-test dir 

backup-my.cnf db1 mtr 
ibbackup_logfile  
ibdata1          
ibdata2
...
...

Suggested fix:
Ideally if no value is specified, backup should error out and not take the 'pwd' as backup directory.
[5 Feb 2011 12:33] Sveta Smirnova
Thank you for the report.

Verified as described.
[8 Feb 2011 0:03] Thava Alagu
The fix for this has been pushed. Hence closing the bug.