Bug #41648 mysqld_restart.inc to be server-change-proof
Submitted: 19 Dec 2008 17:08
Reporter: Andrei Elkin Email Updates:
Status: Verified Impact on me:
None 
Category:Tests Severity:S4 (Feature request)
Version: OS:Any
Assigned to: Assigned Account CPU Architecture:Any
Triage: Triaged: D3 (Medium)

[19 Dec 2008 17:08] Andrei Elkin
Description:
mysqld_restart.inc is started being used widely by tests. But it has a flaw in that a file the macro communicates with mtr can change in future if the server
will modify names of sections in my.cnf the server configuration files.

How to repeat:
Compare mysqld_restart.inc and check_expected_crash_and_restart() of mtr.
the latter builds a path to the file named eventually by the server's convention.
there is no sql-interface to query the server about a name of the convention.

Suggested fix:
To find way not to involve mysqld indirectly generate the expect file name.

To add a stored procedure 'mtr.expect_crash()' that would write to a file
named as `mysqld.[server-id].expect' that mtr.pl would read from
instead of $expect_file= "$opt_vardir/tmp/".$mysqld->name().".expect" as currently.
Or to add a line in my.cnf naming the expect file for mtr and for the test.
Or to pass the server_id unique identifier (or the unique file name composing 
with the id) from the test to mtr and to work coherently with the file on either
the mtr or the test side.