Bug #40645 Test main.federated_innodb does not always clean up after itself
Submitted: 11 Nov 2008 16:57 Modified: 8 Dec 2008 16:06
Reporter: Patrick Crews Email Updates:
Status: Closed Impact on me:
None 
Category:Tests: Server Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: Patrick Crews CPU Architecture:Any
Tags: federated, innodb, pushbuild, test, test failure

[11 Nov 2008 16:57] Patrick Crews
Description:
The test main.federated_innodb has a situation where it can leave a database in existence after the test exits.

This extra database causes failures on tests that poll existing databases (main.information_schema).

We saw this in Pushbuild for the 5.1.30 release build

How to repeat:
Run the test suite with the following options:

./mysql-test-run.pl --skip-innodb --force

You will observer main.information_schema will fail as follows:

***************
*** 14,19 ****
--- 14,20 ----
  select schema_name from information_schema.schemata;
  schema_name
  information_schema
+ federated
  mysql
  test
  show databases like 't%';
***************

Suggested fix:
This failure occurs because of the combination of the --skip-innodb option and the placement of the call to have_innodb within the federated_innodb.test file.

We call federated.inc BEFORE testing to see if we have innodb as an engine, as a result, we create the federated database, realize we don't have innodb, then exit the test without the cleanup that occurs at the end of the test.

We fix this by placing the test for innodb BEFORE anything else in the test.
[11 Nov 2008 17:38] 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/58480

2705 Patrick Crews	2008-11-11
      Bug#40645 Test main.federated does not always clean up after itself
      Placed call to have_innodb.inc BEFORE anything else in the test to prevent any orphan databases
      being left around to corrupt other test results.
      
      When --skip-innodb was used with mtr, we called federated.inc (and created some db's),
      then called have_innodb.inc, realized we didn't have the engine available, then left without
      cleaning up after federated.inc.  Was causing rare failures on Pushbuild.
[11 Nov 2008 19:21] Matthias Leich
ok to push

I vote for starting the fix in 5.0 because there
is the same problem.
[13 Nov 2008 21:01] 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/58704

2713 Patrick Crews	2008-11-13
      Bug#40645 Test main.federated_innodb does not always clean up after itself
      
      Reordered include files so that no mess will be left if this test is run without InnoDB
      Previously, this test would leave a database named 'federated' in such a case and would
      cause tests that examined existing databases to fail.
[2 Dec 2008 13:00] Bugs System
Pushed into 5.0.74  (revid:patrick.crews@sun.com-20081113210101-gsd52g7fvxlk48ab) (version source revid:patrick.crews@sun.com-20081113210101-gsd52g7fvxlk48ab) (pib:5)
[2 Dec 2008 18:13] Paul DuBois
Test case change. No changelog entry needed.

Setting report to NDI pending push into 5.1.x, 6.0.x.
[8 Dec 2008 10:22] Bugs System
Pushed into 5.1.31  (revid:patrick.crews@sun.com-20081113210101-gsd52g7fvxlk48ab) (version source revid:azundris@mysql.com-20081114081134-pswy3m5go7r64m1p) (pib:5)
[8 Dec 2008 11:31] Bugs System
Pushed into 6.0.9-alpha  (revid:patrick.crews@sun.com-20081113210101-gsd52g7fvxlk48ab) (version source revid:ingo.struewing@sun.com-20081121151447-dtf2ofz2ys0zqed1) (pib:5)
[8 Dec 2008 16:06] Paul DuBois
Test case changes. No changelog entry needed.
[19 Jan 2009 11:32] Bugs System
Pushed into 5.1.31-ndb-6.2.17 (revid:tomas.ulin@sun.com-20090119095303-uwwvxiibtr38djii) (version source revid:tomas.ulin@sun.com-20090108105244-8opp3i85jw0uj5ib) (merge vers: 5.1.31-ndb-6.2.17) (pib:6)
[19 Jan 2009 13:09] Bugs System
Pushed into 5.1.31-ndb-6.3.21 (revid:tomas.ulin@sun.com-20090119104956-guxz190n2kh31fxl) (version source revid:tomas.ulin@sun.com-20090119104956-guxz190n2kh31fxl) (merge vers: 5.1.31-ndb-6.3.21) (pib:6)
[19 Jan 2009 16:15] Bugs System
Pushed into 5.1.31-ndb-6.4.1 (revid:tomas.ulin@sun.com-20090119144033-4aylstx5czzz88i5) (version source revid:tomas.ulin@sun.com-20090119144033-4aylstx5czzz88i5) (merge vers: 5.1.31-ndb-6.4.1) (pib:6)