Bug #44905 MTR adds incorrect parameter for startup options in combinations file
Submitted: 15 May 2009 14:46 Modified: 16 May 2009 23:55
Reporter: Chuck Bell Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Tests Severity:S3 (Non-critical)
Version:6.0.11 OS:Any
Assigned to: CPU Architecture:Any

[15 May 2009 14:46] Chuck Bell
Description:
When you specify the following as a combinations file for a test suite, MTR will sometimes add "=YES" for server startup.

(from backup_ptr suite)

[row]
binlog-format=row
new

[stmt]
binlog-format=statement
new

[mix]
binlog-format=mixed
new

However, as we can see from an attempt to use --new=YES, the server complains:

c:\mysql\bin>mysqld --console -uroot --new=yes
090515 10:34:06 [Warning] mysqld: ignoring option '--new' due to invalid value '
yes'

This is a problem because once I added the --new option to the combinations files, pushbuild failed for many backup tests because MTR added the '=yes'. I have attempted to circumvent this problem by changing the combinations file to the following.

[row]
binlog-format=row
new=1

[stmt]
binlog-format=statement
new=1

[mix]
binlog-format=mixed
new=1

How to repeat:
See mysql-6.0-backup pushbuild.
[15 May 2009 21:36] Chuck Bell
Note that the workaround described above (--new=1) did *not* work and pushbuild and pushbuild2 are still failing backup tests. 

What is very strange is only some of the test suites are failing. The most notable are backup_ptr and the rpl_backup* tests.

This problem needs to be fixed ASAP so backup can be pushed to main.
[15 May 2009 23:00] Chuck Bell
A data point for analysis: If you clone the tree and do this:

./mysql-test-run.pl --suite=backup_ptr --timer --force --ps-protocol

MTR works and the --new is read from the combinations file. 

...
backup_ptr.backup_ptr 'row'              [ pass ]   5023
...

However, if you do this (like what is done in PB):

./mysql-test-run.pl --suite-backup_ptr --timer --force --ps-protocol --mysqld=--binlog-format=statement

...
backup_ptr.backup_ptr                    [ fail ]
        Test ended at 2009-05-15 18:59:00

CURRENT_TEST: backup_ptr.backup_ptr
mysqltest: At line 163: Error running query 'BACKUP DATABASE ptr TO 'ptr.bak'':
1780 The MySQL Backup system is disabled in this release. Use --new on server st
artup to enable.
...

The tests fail like they do in PB. 

Is there any way we can use this combinations file and have it pickup the --new option and not ignore it like it does now? Is it a matter of formatting the combinations file differently? Help!
[16 May 2009 14:23] Chuck Bell
Observation: I may have found where the problem lies. In MTR in the file mtr_cases.pm @ line#440 is this logic:

	  # Skip this combination if the values it provides
	  # already are set in master_opt or slave_opt
	  if (My::Options::is_set($test->{master_opt}, $comb->{comb_opt}) &&
	      My::Options::is_set($test->{slave_opt}, $comb->{comb_opt}) ){
	    next;
	  }

Which forces the code to skip the combinations file contents if the options provided from the command line are also in the combinations file. Thus, specifying --mysqld=--binlog-format=statement and having binlog-format= as part of the suite combinations means the combinations file is skipped. Thus, no --new=1 is passed to the test run and thus backup tests will fail.
[16 May 2009 23:56] Chuck Bell
It turns out MTR will ignore the combinations file if the combinations file contains any (even just one) options that are also included on the MTR command line via the --mysqld= parameter.

Thus, when the PB machines execute "MTR --mysqld=binlog-format=statement" or some such, the combinations file for the backup suite was being ignored and therefore not passing the --new=1 option to the server.

Aha we say. Aha indeed. What I needed was a way to pass that --new=1 to the server regardless of what was on the MTR command line. The way to do that is using configuration files. I devised a mechanism not unlike some other tests to create a configuration file for each of the backup suites. 

So...this is not a bug and works as designed. Much to this developer's surprise and consternation. :|