Bug #42522 MTR2: Necessity and completeness of s/MYSQLTEST_VARDIR/MYSQLD_DATADIR/ change
Submitted: 1 Feb 2009 21:13 Modified: 15 Feb 2010 14:02
Reporter: Sergey Petrunya Email Updates:
Status: Won't fix Impact on me:
None 
Category:Tools: MTR / mysql-test-run Severity:S3 (Non-critical)
Version:6.0 OS:Any
Assigned to: Bjørn Munch CPU Architecture:Any

[1 Feb 2009 21:13] Sergey Petrunya
Description:
[filing this as a bug per Joro's request]
After MTR2 push we see that there has been a sweep of replacements of
$MYSQLTEST_VARDIR with $MYSQLD_DATADIR.

Analysis of history shows that the changes were made in bulk with
explanation like this:

  sven@mysql.com-20080723175812-uxn2vzk30bedqun6
  post-merge fixes.
  test paths were changed in 6.0, so in all tests,
  $MYSQLTEST_VARDIR/master-data has to be replaced
  by the output of `SELECT @@datadir`.

They've added a lot of these

  let $MYSQLD_DATADIR= `SELECT @@datadir`

statements that way:

~/dev/mysql-6.0/mysql-test $ grep -r 'let.*MYSQLD_DATADIR=' * | wc -l
121

This begs for question, wasn't it possible not to write 121 LET statements
but have mysql-test-run populate $MYSQLD_DATADIR automatically instead?
Could you please share with us the rationale behind this change?

The second question is, why is the change incomplete? The main tree still has
66 occurrences of "MYSQLTEST_VARDIR/master-data":

~/dev/mysql-6.0/mysql-test $ grep -r 'MYSQLTEST_VARDIR/master-data' * | wc -l
66

Are there any cases where $MYQSLTEST_VARDIR/master-data should be used over
$MYSQLD_DATADIR?

How to repeat:
see above
[2 Feb 2009 12:25] MySQL Verification Team
Thank you for the bug report. Verified as described.
[19 Jun 2009 10:22] Bjørn Munch
Assigning to myself but haven't evaluated it yet
[15 Feb 2010 14:02] Bjørn Munch
Only a single ndb test is still using $MYQSLTEST_VARDIR/master-data. As for the MYSQLD_DATADIR, I'm not comfortable with trying to mess around with this now.