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.