Bug #50844 BACKPORT: The test backup_misc is failing on Windows machines
Submitted: 2 Feb 2010 18:16 Modified: 25 Feb 2010 1:45
Reporter: Chuck Bell Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Backup Severity:S3 (Non-critical)
Version:5.4.4, 6.0 OS:Microsoft Windows
Assigned to: Anurag Shekhar CPU Architecture:Any

[2 Feb 2010 18:16] Chuck Bell
Description:
The test backup_misc is failing on Windows PB machines in both the mysql-6.0-backup and mysql-backport-backup tree. 

NOTE: The solution for this bug *must* be merged and/or pushed to all backup trees as it affects both 5.X and 6.0 code.

The failure is:

backup.backup_misc                       [ fail ]
        Test ended at 2010-01-29 22:28:34

CURRENT_TEST: backup.backup_misc
mysqltest: At line 21: query 'BACKUP DATABASE test TO '$FILE_NAME'' failed: 1: Can't create/write to file 'G:\pb2\test\sb_1-1263359-1264797460.9\mysql-6.0.14-alpha-win-x86_64-test\mysql-test\var\mysqld.1\data\X12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234' (Errcode: 2)

The result from queries just before the failure was:
call mtr.add_suppression("Backup: Can't write");
#
# Bug#34065 Backup: file names may be too short
#
# Append one char to make FILE_NAME too long to create
# Show that FILE_NAME is 255 chars
SELECT length('X12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234') AS length;
length
255

Warnings from just before the error:
Error 1 Can't create/write to file 'G:\pb2\test\sb_1-1263359-1264797460.9\mysql-6.0.14-alpha-win-x86_64-test\mysql-test\var\mysqld.1\data\X12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234' (Errcode: 2) 
Error 1656 Can't write to backup location 'X123456789012345678901234567890123456789012345678901234567890123'

 - saving 'G:/pb2/test/sb_1-1263359-1264797460.9/mysql-6.0.14-alpha-win-x86_64-test/mysql-test/var/log/backup.backup_misc/' to 'G:/pb2/test/sb_1-1263359-1264797460.9/mysql-6.0.14-alpha-win-x86_64-test/mysql-test/var/log/backup.backup_misc/'

Retrying test, attempt(2/3)...

How to repeat:
./mysql-test-run.pl backup_misc

Suggested fix:
The cause of the error is a file name that is too long for the Windows platform. The fix should take this limitation into consideration and reduce the length of the name of the file or create a new test specifically for Windows. The verifier prefers the former.
[3 Feb 2010 10:40] 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/99033

3826 Anurag Shekhar	2010-02-03
      Bug #50844 BACKPORT: The test backup_misc is failing on Windows machines
      
      Windows has a limit of 255 chars on filename lenght but this limit
      includes the length of path too.
      
      Reducing the file name length in case to lower value fixes this problem. 
     @ mysql-test/suite/backup/r/backup_misc.result
        Updated result file.
     @ mysql-test/suite/backup/t/backup_misc.test
        Reduced the length of file name to 125 chars.
        INVALID_FILE_NAME length is still 256 toensure that
        it fails on all platforms.
[3 Feb 2010 15:37] Chuck Bell
Patch approved pending changes -- see commit email. Only 1 reviewer needed.
[4 Feb 2010 9:23] 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/99217

3826 Anurag Shekhar	2010-02-04
      Bug #50844 BACKPORT: The test backup_misc is failing on Windows machines
      
      Windows has a limit of 255 chars on filename length but this limit
      includes the length of path too.
      
      Reducing the file name length lower length fixes this problem. 
     @ mysql-test/suite/backup/r/backup_misc.result
        Updated result file.
     @ mysql-test/suite/backup/t/backup_misc.test
        Reduced the length of file name to 125 chars.
        INVALID_FILE_NAME length is still 256 to ensure that
        it fails on all platforms.
[20 Feb 2010 9:17] Bugs System
Pushed into 6.0.14-alpha (revid:ingo.struewing@sun.com-20100218152520-s4v1ld76bif06eqn) (version source revid:anurag.shekhar@sun.com-20100204092313-75wcxj23uh95f2pp) (merge vers: 6.0.14-alpha) (pib:16)
[25 Feb 2010 1:45] Paul DuBois
Changes to test case. No changelog entry needed.