Bug #34754 | Backup: Invalid error message for incorrect path name while performing backup | ||
---|---|---|---|
Submitted: | 22 Feb 2008 2:10 | Modified: | 13 Dec 2008 17:14 |
Reporter: | Hema Sridharan | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Backup | Severity: | S3 (Non-critical) |
Version: | mysql-6.0-backup | OS: | Linux |
Assigned to: | Øystein Grøvlen | CPU Architecture: | Any |
[22 Feb 2008 2:10]
Hema Sridharan
[22 Feb 2008 14:26]
MySQL Verification Team
Thank you for the bug report.
[26 Mar 2008 0:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".
[27 Mar 2008 19:05]
Hema Sridharan
MTR test for the Bug#34754 --error 0,1 --remove_file $MYSQLTEST_VARDIR/master-data/try.bak #Create Database --disable_warnings DROP DATABASE IF EXISTS try; --enable_warnings CREATE DATABASE try; USE try; #Create table and load with data. --echo Creating table CREATE TABLE t1(name char(10), id int)ENGINE=MYISAM; CREATE TABLE t2(city varchar(20), state char(10))ENGINE=MYISAM; --echo loading data INSERT INTO t1 VALUES('aa',1),('bb',2); INSERT INTO t2 VALUES('austin','TX'),('sfo','CA'); #selecting data SELECT * FROM t1; SELECT * FROM t2; #Backup and restore data. --echo backup data BACKUP DATABASE try TO 'try.bak'; #In doing BACKUP give invalid path name and check for error message. #BUG#34754 #I get the error message saying that "can't write backup to a location as file already exists". Here the file already exists shouldn't be the message, as there is no such file.This error message is misleading. #Instead the message should be "invalid path name" or "No such directory". #Also the error message given here is invalid as you can always backup the same database many times by giving different destination file name, but the path should be valid. --error 1628 BACKUP DATABASE try TO '/data2/heman/buju/kuju'; ERROR HY000: Can't write to backup location '/data2/heman/buju/kuju' (file already exists?) Verified using test framework as described.
[14 Nov 2008 7:54]
Øystein Grøvlen
Just to be clear: The error message is the same regardles of whether a successful backup was performed first.
[18 Nov 2008 14:21]
Øystein Grøvlen
The error message for SELECT ... INTO OUTFILE is not more specific either when path is invalid: select * from t into outfile '/home/hema/a.txt'; ERROR 1 (HY000): Can't create/write to file '/home/hema/a.txt' (Errcode: 2)
[24 Nov 2008 16:06]
Øystein Grøvlen
Stream::open() calls my_open() with flags MYF(0). This will not generate an error message on errors. Instead, MYF(MY_WME) should be used. In addition, my_create() should be used instead of my_open() to get "Can't create/write to file '%s' (Errcode: %d)", which is more appropriate than "File '%s' not found (Errcode: %d)" reported by my_open()
[26 Nov 2008 14:08]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/59937 2736 oystein.grovlen@sun.com 2008-11-26 BUG#34754 Backup: Invalid error message for incorrect path name while performing backup Will now use error messages generated by my_create (BACKUP) and my_open (RESTORE) when failing to create/open a file since these message are more specific as to the cause of the failure. Note that the backup-specific errors will still be pushed on the error stack and it is still the backup-specific errors that are recorded in the the backup history log and in the error file.
[3 Dec 2008 14:52]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/60494 2737 oystein.grovlen@sun.com 2008-12-03 BUG#34754 Backup: Invalid error message for incorrect path name while performing backup Will now use error messages generated by my_create (BACKUP) and my_open (RESTORE) when failing to create/open a file since these message are more specific as to the cause of the failure. Note that the backup-specific errors will still be pushed on the error stack, and it is still these errors that are recorded in the backup history log and in the error file.
[3 Dec 2008 15:04]
Øystein Grøvlen
Just to clarify one of my previous comments. In order to get appropriate error messages, my_create() should be used when creating the file for the backup image, and my_open() should be used when opening the backup image on restore.
[3 Dec 2008 16:39]
Chuck Bell
Patch approved.
[8 Dec 2008 9:22]
Rafal Somla
Approved.
[8 Dec 2008 11:25]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/60879 2733 oystein.grovlen@sun.com 2008-12-08 BUG#34754 Backup: Invalid error message for incorrect path name while performing backup Will now use error messages generated by my_create (BACKUP) and my_open (RESTORE) when failing to create/open a file since these message are more specific as to the cause of the failure. Note that the backup-specific errors will still be pushed on the error stack, and it is still these errors that are recorded in the backup history log and in the error file.
[8 Dec 2008 11:35]
Øystein Grøvlen
Patch pushed to mysql-6.0-backup with revision id oystein.grovlen@sun.com-20081208112451-9bw0jy4xvlllitg2
[12 Dec 2008 6:25]
Bugs System
Pushed into 6.0.9-alpha (revid:oystein.grovlen@sun.com-20081208112451-9bw0jy4xvlllitg2) (version source revid:oystein.grovlen@sun.com-20081208112451-9bw0jy4xvlllitg2) (pib:5)
[13 Dec 2008 17:14]
Paul DuBois
Noted in 6.0.9 changelog. BACKUP DATABASE produced an incorrect error message when the backup image filename contained a nonexistent directory.