Bug #32385 The test backup_no_data does not clean up after itself.
Submitted: 14 Nov 2007 19:15 Modified: 21 Aug 2008 19:15
Reporter: Chuck Bell Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Backup Severity:S3 (Non-critical)
Version:6.0 OS:Any
Assigned to: Rafal Somla CPU Architecture:Any

[14 Nov 2007 19:15] Chuck Bell
Description:
When you run the test backup_no_data more than once per test run, every other run fails. Data is not being cleaned up properly. 

How to repeat:
Run this: 

./mysql-test-run.pl backup_no_data  backup_no_data backup_no_data backup_no_data backup_no_data backup_no_data --force

and see this:

=======================================================

TEST                           RESULT         TIME (ms)
-------------------------------------------------------

main.backup_no_data            [ pass ]              0
main.backup_no_data            [ fail ]

cp: cannot stat `c:/source/c++/mysql-6.0_BUG_31383/mysql-test/var/master-data/te
st/t1.MYD': No such file or directory
cp: cannot stat `c:/source/c++/mysql-6.0_BUG_31383/mysql-test/var/master-data/te
st/t1.MYI': No such file or directory
mysqltest: At line 7: command "cp -rf $MYSQLTEST_VARDIR/master-data/test $MYSQLT
EST_VARDIR/test.orig" failed

The result from queries just before the failure was:
exec of 'cp -rf c:/source/c++/mysql-6.0_BUG_31383/mysql-test/var/master-data/tes
t c:/source/c++/mysql-6.0_BUG_31383/mysql-test/var/test.orig' failed, error: 1,
status: 1, errno: 0

More results from queries before failure can be found in c:\source\c++\mysql-6.0
_BUG_31383\mysql-test\var\log\backup_no_data.log

Stopping All Servers
Restoring snapshot of databases
Resuming Tests

main.backup_no_data            [ pass ]              0
main.backup_no_data            [ fail ]

cp: cannot stat `c:/source/c++/mysql-6.0_BUG_31383/mysql-test/var/master-data/te
st/t1.MYD': No such file or directory
cp: cannot stat `c:/source/c++/mysql-6.0_BUG_31383/mysql-test/var/master-data/te
st/t1.MYI': No such file or directory
mysqltest: At line 7: command "cp -rf $MYSQLTEST_VARDIR/master-data/test $MYSQLT
EST_VARDIR/test.orig" failed

The result from queries just before the failure was:
exec of 'cp -rf c:/source/c++/mysql-6.0_BUG_31383/mysql-test/var/master-data/tes
t c:/source/c++/mysql-6.0_BUG_31383/mysql-test/var/test.orig' failed, error: 1,
status: 1, errno: 0

More results from queries before failure can be found in c:\source\c++\mysql-6.0
_BUG_31383\mysql-test\var\log\backup_no_data.log

Stopping All Servers
Restoring snapshot of databases
Resuming Tests

Suggested fix:
Change the preamble of the test to setup the data correctly (may be ok asis) and fix the cleanup code to destroy only what is necessary. Also, the older methods are used e.g. cp, rm and should be changed to the new test commands.
[12 Dec 2007 20:28] Rafal Somla
This bug is fixed by the patch for BUG#33119.
[14 Dec 2007 16:26] Rafal Somla
Patch for BUG#33119 pushed into 6.0-backup tree.
[20 Aug 2008 14:28] Chuck Bell
Pushed to 6.0.5.
[21 Aug 2008 19:15] Paul DuBois
Pushed to 6.0.5, the same release when BACKUP DATABASE/RESTORE
originally appeared. So this bug is not in any released version; no
changelog entry needed.