Bug #40741 backup.backup test fails if blackhole engine is not available
Submitted: 14 Nov 2008 13:08 Modified: 13 Dec 2008 17:28
Reporter: John Embretsen Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Backup Severity:S2 (Serious)
Version:6.0.9-bzr OS:Any
Assigned to: Øystein Grøvlen CPU Architecture:Any

[14 Nov 2008 13:08] John Embretsen
Description:
=======================================================

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

backup.backup                  [ fail ]

--- /home/user/6.0-sandbox/mysql-test/suite/backup/r/backup.result  Tue Nov 11 19:17:35 2008
+++ /home/user/6.0-sandbox/mysql-test/suite/backup/r/backup.reject  Fri Nov 14 11:11:12 2008
@@ -33,6 +33,9 @@
 `project_number` char(9),
 `hours_worked` double(10,2)
 ) ENGINE=blackhole DEFAULT CHARSET=latin1;
+Warnings:
+Warning        1286    Unknown storage engine 'blackhole'
+Warning        1266    Using storage engine MyISAM for table 'tasking'
 INSERT INTO `tasking` VALUES ('333445555','405',23),('123763153','405',33.5),('921312388','601',44),('800122337','300',13),('820123637','300',9.5),('830132335','401',8.5),('333445555','300',11),('921312388','500',13),('800122337','300',44),('820123637','401',500.5),('830132335','400',12),('333445665','600',300.25),('123654321','607',444.75),('123456789','300',1000);
 backup: Activate synchronization points for BACKUP.
 Depending on the driver used, one of the sync points is used,
@@ -131,7 +134,7 @@
   `id` char(9) DEFAULT NULL,
   `project_number` char(9) DEFAULT NULL,
   `hours_worked` double(10,2) DEFAULT NULL
-) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
 SELECT validity_point_time = @vp_time FROM mysql.backup_history
 WHERE backup_id = @bid;
 validity_point_time = @vp_time

mysqltest: Result content mismatch

Aborting: backup.backup failed in default mode.

How to repeat:
Compile server without including the blackhole storage engine/plugin (i.e. no 'max' or --with-blackhole-storage-engine, --with-plugins=blakchole, etc.)

Run the backup test:

$ cd mysql-test/
$ perl ./mysql-test-run.pl --suite=backup backup

Suggested fix:
Make sure having the Blackhole storage engine is an explicit test requirement. Skip the test if the requirement is not met.

For example, the following patch implements the suggested fix _and_ makes sure that the message given to the user/tester is of value (outputs "Test requires the Blackhole storage engine" instead of "Test requires 'true'" if blackhole is missing from the build):

=== modified file 'mysql-test/include/have_blackhole.inc'
--- mysql-test/include/have_blackhole.inc       2008-07-04 18:48:25 +0000
+++ mysql-test/include/have_blackhole.inc       2008-11-14 09:01:56 +0000
@@ -1,4 +1,7 @@
 disable_query_log;
---require r/true.require
-select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'blackhole';
+let $have_blackhole=`select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'blackhole'`;
+if (!$have_blackhole)
+{
+  skip Test needs the Blackhole storage engine;
+}
 enable_query_log;

=== modified file 'mysql-test/suite/backup/t/backup.test'
--- mysql-test/suite/backup/t/backup.test       2008-10-07 17:15:44 +0000
+++ mysql-test/suite/backup/t/backup.test       2008-11-14 08:58:18 +0000
@@ -1,4 +1,5 @@
 --source include/have_innodb.inc
+--source include/have_blackhole.inc
 --source include/not_embedded.inc
 --source include/have_debug_sync.inc
 --source include/have_log_bin.inc
[20 Nov 2008 9:46] Sveta Smirnova
Thank you for the report.

Verified as described.
[5 Dec 2008 14:49] 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/60748

2740 oystein.grovlen@sun.com	2008-12-05
      Bug#40741 backup.backup test fails if blackhole engine is not available
      
       - Make sure test backup.backup only runs if blackhole engine is available.
       - Fixed have_blackhole.inc to give an informative message when a test is 
         skipped because the blackhole engine is missing
       - Some clean-up to backup.backup result file to cater for changes that has 
         happened while it was disabled.
[5 Dec 2008 20:13] Chuck Bell
Patch approved.
[8 Dec 2008 9:49] Rafal Somla
Good to push.
[8 Dec 2008 9:56] John Embretsen
Patch tested OK, thanks for fixing!
[8 Dec 2008 10:31] 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/60868

2732 oystein.grovlen@sun.com	2008-12-08
      Bug#40741 backup.backup test fails if blackhole engine is not available
      
       - Make sure test backup.backup only runs if blackhole engine is available.
       - Fixed have_blackhole.inc to give an informative message when a test is 
         skipped because the blackhole engine is missing
       - Some clean-up to backup.backup result file to cater for changes that has 
         happened while it was disabled.
[8 Dec 2008 10:45] Øystein Grøvlen
Patch pushed to mysql-6.0-backup with revision id
oystein.grovlen@sun.com-20081208103021-ljm9pabojqf9k3jf
[12 Dec 2008 6:25] Bugs System
Pushed into 6.0.9-alpha  (revid:oystein.grovlen@sun.com-20081208103021-ljm9pabojqf9k3jf) (version source revid:oystein.grovlen@sun.com-20081208103021-ljm9pabojqf9k3jf) (pib:5)
[13 Dec 2008 17:28] Paul DuBois
Test case changes. No changelog entry needed.