Bug #30988 have_multi_ndb.inc leaves test case connected to 'server1'and not 'default
Submitted: 12 Sep 2007 20:33 Modified: 1 Aug 2008 11:33
Reporter: Omer Barnir (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Tests Severity:S3 (Non-critical)
Version:5.1 OS:Any
Assigned to: Magnus Blåudd CPU Architecture:Any

[12 Sep 2007 20:33] Omer Barnir
Description:
When enabling mysql-test test cases for cluster using have_ndb.inc, the file makes use of the "have_multi_ndb.inc" file. That file, as a lat command, set the connection to 'server1'. As a result the test file execution starts using that connection. This is different from other have_XXX.inc files or a default use of mysql-test that uses the 'default' connection from the get go.

This can lead to inconsistencies in the behavior of test cases using multiple connections, as in the non-ndb case the tests will start in the 'default' connection and in the 'ndb' case they will start in the 'server1' connection.

How to repeat:
1) View the last line in mysql-test/include/have_multi_ndb.inc
2) This issue can also be demonstrated with the following test case:
   set @omer_var='Testing Value';
   connection default;
   select @omer_var;   

When running the test when 'have_ndb' is not used, the result of the select is
   @omer_var
   Testing Value
because the test started in the 'default' connection

When running the test when 'have_ndb' is used the result of the select is
   @omer_var
   NULL
because the initial setting if the variable is in the 'server1' connection and not the default one

Suggested fix:
have 'have_multi_ndb.inc' use 'default' as one of its connection and have it set to that one as its last line so test cases will behave the same when ndb is enabled and when it isn't
[24 Oct 2007 14:25] Magnus Blåudd
Only test cases that need to have _two_ mysqld master should use the include/have_multi_ndb.inc include file.
[1 Aug 2008 11:33] Magnus Blåudd
Fixed in mysql-5.1-telco-6.2