Bug #31398 problems with mysql-test-run
Submitted: 4 Oct 2007 14:24 Modified: 25 Oct 2007 1:39
Reporter: Jani Tolonen 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

[4 Oct 2007 14:24] Jani Tolonen
Description:
mysql-test-run createsome files under sql/share directory while running. By default it should not create files anywhere else than under it's own directory mysql-test/ and in /tmp if needed. One should be able to run mysql-test-run without having write or execute permissions in other directories.

Another problem is that mysql-test-run creates .reject files under var/log, while it would be better to store the files under r/, where the result files are. This used to be the default behavior and is easier to work with than having
to check the reject files from another directory. Best option would in my opinion be to have .test, .result and even .reject files all in the t/ -directory. They belong to same group, are always being worked together, and I see no reason for them to be in separate directories. If they all were under the same directory one could quickly see any tests that have a corresponding .reject file, seeing the .result and .test file all at once, much more convenient than having to look each from a separate directory.

How to repeat:
Remove your permissions from writing to sql/share/ directory under the source tree and run:

./mysql-test-run --force

Logging: ./mysql-test-run --force
071003 17:00:38 [Warning] Can't create test file /home/my/mysql-5.1/sql/share/english/hynda.lower-test
071003 17:00:38 [Warning] Can't create test file /home/my/mysql-5.1/sql/share/english/hynda.lower-test
[4 Oct 2007 14:32] Jani Tolonen
A clarification to the above -

If you are in the source distribution the reject files should go by default into result (r/) directory and if it's an installed distribution, then the reject files should go in var/log by default, because in the latter case one should assume not being able to write in r/. Both behaviours should be changeable via option.
[5 Oct 2007 15:37] Magnus Blåudd
The code that writes to sql/share is when we run "mysqld --help --verbose", apparently mysqld must chdir and do the lowercase test in that dir also when we just want the help text. Annoying.

  #
  # Execute "mysqld --help --verbose" to get a list
  # list of all features and settings
  #
  # --no-defaults and --skip-grant-tables are to avoid loading
  # system-wide configs and plugins
  #
  # --datadir must exist, mysqld will chdir into it
  #
  my $list= `$exe_mysqld --no-defaults --datadir=$path_language --language=$path_language --skip-grant-tables --verbose --help`;
[5 Oct 2007 15:54] 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/34988

ChangeSet@1.2531, 2007-10-05 17:54:19+02:00, msvensson@shellback.(none) +1 -0
  Bug#31398 problems with mysql-test-run
   - "mysqld --verbose --help" need to be started in a writable directory
[5 Oct 2007 16:19] 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/34994

ChangeSet@1.2532, 2007-10-05 18:18:50+02:00, msvensson@shellback.(none) +1 -0
  Bug#31398 problems with mysql-test-run, part2
  Write .reject file to r/ if it's writable else use opt_logdir
[18 Oct 2007 21:36] Bugs System
Pushed into 5.1.23-beta
[18 Oct 2007 21:38] Bugs System
Pushed into 5.0.52
[25 Oct 2007 1:39] Paul DuBois
Noted in 5.0.52, 5.1.23 changelogs.

mysql-test-run.pl tried to create files in a directory where it could
not be expected to have write permission. mysqltest created .reject
files in a directory other than the one where test results go.