Bug #46574 | Backup fails to return error ER_BACKUP_BINLOG | ||
---|---|---|---|
Submitted: | 5 Aug 2009 20:11 | Modified: | 28 Oct 2009 22:20 |
Reporter: | Chuck Bell | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Backup | Severity: | S3 (Non-critical) |
Version: | 5.4.4 | OS: | Any |
Assigned to: | Chuck Bell | CPU Architecture: | Any |
[5 Aug 2009 20:11]
Chuck Bell
[5 Aug 2009 20:14]
Chuck Bell
Once fixed, and WL#4722 has been pushed, the test case can be activated in backup_errors_debug_1.test using this test case: # Test for error ER_BACKUP_BINLOG. LET $caseno = 1; LET $errno = $ER_BACKUP_BINLOG; LET $errname = ER_BACKUP_BINLOG; LET $operation = BACKUP; --source suite/backup/include/test_for_error.inc
[7 Aug 2009 14:58]
Chuck Bell
Note: The code and test case are part of the patch for WL#4722. Once that is pushed, or made available, the test case can be enabled in backup_errors_debug_1.test and the code for the error condition insertion is active.
[27 Aug 2009 0:56]
Chuck Bell
Chuck steals another bug.
[27 Aug 2009 1:02]
Chuck Bell
The problem is the code does not detect when an error is returned from save_vp_info() in data_backup.cc. The following patch corrects the problem. This patch can be applied and the test case enabled once WL#4722 is pushed. Also, there are two test cases -- one with a database that has objects and another that does not have objects. Both test cases must be added to the tests in WL#4722. === modified file 'sql/backup/data_backup.cc' --- sql/backup/data_backup.cc 2009-05-21 13:17:37 +0000 +++ sql/backup/data_backup.cc 2009-08-27 01:01:31 +0000 @@ -470,7 +470,11 @@ */ if (mysql_bin_log.is_open()) { - if (mysql_bin_log.get_current_log(&binlog_start_pos)) + ret= mysql_bin_log.get_current_log(&binlog_start_pos); + + DBUG_EXECUTE_IF("ER_BACKUP_BINLOG", ret= TRUE;); + + if (ret) { info.m_log.report_error(ER_BACKUP_BINLOG); ret= TRUE; @@ -735,7 +739,8 @@ if (sch.lock()) // logs errors goto error; - save_vp_info(info); + if (save_vp_info(info)) + goto error; DEBUG_SYNC(thd, "before_backup_data_unlock"); if (sch.unlock() || log.report_killed()) // logs errors
[10 Sep 2009 16:04]
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/82963 2867 Chuck Bell 2009-09-10 BUG#46574 : Backup fails to return error ER_BACKUP_BINLOG The ER_BACKUP_BINLOG error is not detected in the current code. The WL#4722 patch provided a debug insertion test that revealed the error was not being handled correctly. This patch corrects the problem by detecting the error returned by the save_vp_info() method. @ mysql-test/suite/backup/r/backup_errors_debug_1.result Corrected result file that includes enabled test case. @ mysql-test/suite/backup/t/backup_errors_debug_1-master.opt Added option file to turn on binlog for test case. @ mysql-test/suite/backup/t/backup_errors_debug_1.test Enabled test case. @ sql/backup/data_backup.cc Add error detection for return of save_vp_info(). Corrected debug insertion code for ER_BACKUP_BINLOG.
[10 Sep 2009 17:58]
Ingo Strüwing
Approved.
[14 Sep 2009 18:15]
Jørgen Løland
Good to push
[14 Sep 2009 20:15]
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/83219 2868 Chuck Bell 2009-09-14 [merge] Local merge before push of BUG#46574.
[25 Oct 2009 13:38]
Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20091025133616-ca4inerav4vpdnaz) (version source revid:ingo.struewing@sun.com-20090921175031-i1ubh1ln575lh1di) (merge vers: 6.0.14-alpha) (pib:13)
[28 Oct 2009 22:20]
Paul DuBois
Noted in 6.0.14 changelog. If the binary log was open and unreadable, BACKUP DATABASE crashed rather than handling the error.