From: Date: June 25 2008 3:40pm Subject: bzr commit into mysql-6.0-backup branch (oystein.grovlen:2642) Bug#36624 List-Archive: http://lists.mysql.com/commits/48490 X-Bug: 36624 Message-Id: <20080625134056.498CA194@fimafeng09.norway.sun.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit #At file:///home/og136792/mysql/shared/mysql-6.0-backup-1/ 2642 Oystein Grovlen 2008-06-25 BUG#36624 Backup stream library works wrong on 64bit platform. Restore failed on multi-block backup images on 64-bit platforms with 'Error when reading summary section of backup image'. Fixed by casting int to unsigned before performing shift left operation. I have verified that all shift-left operations in the backup directory are now based on unsigned ints. This is necessary to avoid problems with sign bit on 64-bit platforms. modified: mysql-test/lib/mtr_report.pl mysql-test/r/backup_multi_blocks.result mysql-test/t/backup_multi_blocks.test sql/backup/stream_v1_transport.c per-file messages: mysql-test/lib/mtr_report.pl No longer necessary to filter restore failures for backup_multi_blocks test. mysql-test/r/backup_multi_blocks.result Update result to reflect changes in test. mysql-test/t/backup_multi_blocks.test Change test to reflect that restore of multi block backup images now works. sql/backup/stream_v1_transport.c Shift-left operation needs to be based on unsigned ints to work on 64-bit platforms. === modified file 'mysql-test/lib/mtr_report.pl' --- a/mysql-test/lib/mtr_report.pl 2008-06-23 14:53:35 +0000 +++ b/mysql-test/lib/mtr_report.pl 2008-06-25 13:40:49 +0000 @@ -333,13 +333,7 @@ sub mtr_report_stats ($) { ( /Backup:/ or /Restore:/ or /Can't open the online backup progress tables/ ) or - - # Filter expected Restore error in backup_multi_blocks - ($testname eq 'main.backup_multi_blocks') and - ( - /Restore: Error when reading summary section of backup image/ - ) or - + # The tablespace test triggers error below on purpose ($testname eq 'main.backup_tablespace') and ( === modified file 'mysql-test/r/backup_multi_blocks.result' --- a/mysql-test/r/backup_multi_blocks.result 2008-06-23 14:53:35 +0000 +++ b/mysql-test/r/backup_multi_blocks.result 2008-06-25 13:40:49 +0000 @@ -29,12 +29,14 @@ backup_id DROP DATABASE mysqltest; Performing restore ... RESTORE FROM 'test.ba'; -ERROR HY000: Error when reading summary section of backup image +backup_id +#; Checking contents of restore ... SELECT LENGTH(a) FROM t1; LENGTH(a) +32768 CHECKSUM TABLE t1; Table Checksum -mysqltest.t1 0 +mysqltest.t1 3394496868 Clean-up DROP DATABASE mysqltest; === modified file 'mysql-test/t/backup_multi_blocks.test' --- a/mysql-test/t/backup_multi_blocks.test 2008-06-23 14:53:35 +0000 +++ b/mysql-test/t/backup_multi_blocks.test 2008-06-25 13:40:49 +0000 @@ -1,14 +1,7 @@ --source include/not_embedded.inc ---source include/have_debug.inc - -# Run test only on 64-bit platforms until BUG#36624 has been fixed. ---source include/have_64bit.inc - # Test that it is possible to restore backups of tables with more than -# a single block of data. Until BUG#36624 is fixed, restore will fail -# on 64-bit platforms. Test is temporarily modified to expect this -# failure. +# a single block of data. --disable_warnings DROP DATABASE IF EXISTS mysqltest; @@ -37,9 +30,9 @@ BACKUP DATABASE mysqltest TO 'test.ba'; DROP DATABASE mysqltest; -# Perform restore. Will fail on 64-bit platforms due to BUG#36224 +# Perform restore. --echo Performing restore ... ---error ER_BACKUP_READ_SUMMARY +--replace_column 1 #; RESTORE FROM 'test.ba'; --echo Checking contents of restore ... === modified file 'sql/backup/stream_v1_transport.c' --- a/sql/backup/stream_v1_transport.c 2008-06-23 14:53:35 +0000 +++ b/sql/backup/stream_v1_transport.c 2008-06-25 13:40:49 +0000 @@ -696,7 +696,7 @@ int load_buffer(backup_stream *s) for (i= 0; i<4; ++i) { block_size >>= 8; - block_size |= (*(s->buf.begin++)) << 3*8; + block_size |= ((unsigned long int) *(s->buf.begin++)) << 3 * 8; } /*