Bug #32834 backup_no_engine test forces failures on multiple runs
Submitted: 29 Nov 2007 4:28 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

[29 Nov 2007 4:28] Chuck Bell
Description:
If you run the backup tests multiple times in a test run, the backup_ddl_blocker test will fail with the following error:

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

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

main.backup                    [ pass ]              0
main.backup_commit_blocker     [ pass ]              0
main.backup_ddl_blocker        [ pass ]              0
main.backup_errors             [ pass ]              0
main.backup_fkey               [ pass ]              0
main.backup_no_data            [ pass ]              0
main.backup                    [ pass ]              0
main.backup_commit_blocker     [ pass ]              0
main.backup_ddl_blocker        [ fail ]

mysqltest: At line 1085: query 'RESTORE FROM "bup_ddl_blocker.bak"' failed: 1010
: Error dropping database (can't rmdir '.\test\', errno: 17)

The result from queries just before the failure was:
< snip >
con2: Completing DDL
con3: Completing DDL
con4: Completing DDL
con5: Completing DDL
backup_id
#

Verifying Test 4 results for backup.

con1: Showing databases after updates and backup
con1: bup_ddl_blocker_2 and bup_ddl_blocker_4 are not present
SHOW DATABASES LIKE 'bup_ddl_blocker_%';
Database (bup_ddl_blocker_%)
bup_ddl_blocker_1
bup_ddl_blocker_3
con1: Dropping the database tables
DROP DATABASE bup_ddl_blocker_1;
DROP DATABASE bup_ddl_blocker_3;
con1: Restoring the database
RESTORE FROM "bup_ddl_blocker.bak";

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

Warnings from just before the error:
Error 1010 Error dropping database (can't rmdir '.\test\', errno: 17)

How to repeat:
./mysql-test-run.pl backup backup_commit_blocker backup_ddl_blocker backup_errors backup_fkey backup_no_data backup_no_engine backup_progress backup_security backup_snapshot  backup backup_commit_blocker backup_ddl_blocker backup_errors backup_fkey backup_no_data backup_no_engine backup_progress backup_security backup_snapshot  backup backup_commit_blocker backup_ddl_blocker backup_errors backup_fkey backup_no_data backup_no_engine backup_progress backup_security backup_snapshot  backup backup_commit_blocker backup_ddl_blocker backup_errors backup_fkey backup_no_data backup_no_engine backup_progress backup_security backup_snapshot  backup backup_commit_blocker backup_ddl_blocker backup_errors backup_fkey backup_no_data backup_no_engine backup_progress backup_security backup_snapshot --force

Suggested fix:
This problem has been traced to the backup_no_data test. It is attempting to store the original contents of the test database and restore it using copy files commands:

# restore test database to the exact state from the beginning of this test
--exec rm -rf $MYSQLTEST_VARDIR/master-data/test/*
--exec cp -rf $MYSQLTEST_VARDIR/test.orig $MYSQLTEST_VARDIR/master-data/test
--exec rm -rf $MYSQLTEST_VARDIR/test.orig/*

This is causing the test database to loose the proper permissions on the folder making it impossible for the server to delete the test folder.

This should be changed to properly return the test folder and its contents to its original form.
[4 Dec 2007 17:49] Chuck Bell
Corrected status to verified.
[12 Dec 2007 20:27] Rafal Somla
This bug is fixed by the patch for BUG#33119.
[14 Dec 2007 16:27] Rafal Somla
Patch for BUG#33119 pushed into 6.0-backup tree.
[20 Aug 2008 14:27] 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.