Bug #54111 mysqltest command remove_files_wildcard does not work in embedded server
Submitted: 31 May 2010 16:13 Modified: 14 Oct 2010 15:35
Reporter: Ingo Strüwing Email Updates:
Status: Closed Impact on me:
None 
Category:Tools: MTR / mysql-test-run Severity:S3 (Non-critical)
Version:5.1.47 OS:Any
Assigned to: Bjørn Munch CPU Architecture:Any

[31 May 2010 16:13] Ingo Strüwing
Description:
The mysqltest command 'remove_files_wildcard' does not work as expected in
mysqltest_embedded. The wildcard characters '*' and '?' are not noticed as
wildcard characters. Instead, '%' and '_' have to be used.

The cause is that mysys/mf_wcomp.c uses the global variables wild_many and
wild_one, which receive different values from the server initialization.

The mysqltest command 'remove_files_wildcard' is not documented in
http://dev.mysql.com/doc/mysqltest/en/mysqltest-commands.html

How to repeat:
Create a file somewhere and try to remove it with --remove_files_wildcard.

Suggested fix:
Not sure, if this needs to be fixed. But at least it should be documented.

A possible workaround is to use two patterns:

--remove_files_wildcard $MYSQL_VARDIR/tmp/wcomp-test-?.*
--remove_files_wildcard $MYSQL_VARDIR/tmp/wcomp-test-_.%

The only problem here is that '_' is a pretty frequent character in
file names. Ambiguities are possible.
[9 Jun 2010 11:25] 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/110610

2911 Bjorn Munch	2010-06-09
      Bug #54111 mysqltest command remove_files_wildcard does not work in embedded server
      Wildcard chars are changed in embedded mode
      Temporarily reset the wild_* variable when doing wild_compare
[10 Jun 2010 11:41] Bjørn Munch
Um, this affects list_files too, revised patch will come
[10 Jun 2010 13:03] 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/110721

2911 Bjorn Munch	2010-06-10
      Bug #54111 mysqltest command remove_files_wildcard does not work in embedded server
      Wildcard chars are changed in embedded mode
      emporarily reset the wild_* variables before wild_compare, also for list_files
[15 Jun 2010 8:20] Magnus Blåudd
Make a note in  the comments saying that the when running the embedded server (i.e mysqltest_embedded) the global variables wild_* are modified by the embedded server and need to be set and reset.
[15 Jun 2010 8:22] Magnus Blåudd
Alternatively copy & paste the code form mf_wcomp into mysqltst.c ?
[15 Jun 2010 8:27] Bjørn Munch
OK I can add more to the comment. I think the code on mf_wcomp is a bit too much to copy-and-paste rather than reuse.
[15 Jun 2010 9:30] 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/111108

2914 Bjorn Munch	2010-06-15
      Bug #54111 mysqltest command remove_files_wildcard does not work in embedded server
      Wildcard chars are changed in embedded mode
      Temporarily reset the wild_* variables before wild_compare, also for list_files
[15 Jun 2010 11:10] Bjørn Munch
Pushed to 5.1-mtr, trunk-mtr, next-mr-mtr
[16 Aug 2010 6:29] Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@sun.com-20100816062701-qo9dpnk5tkt1pksb) (version source revid:alik@sun.com-20100816062603-xc16eftmv7rmktyq) (merge vers: 5.6.1-m4) (pib:20)
[16 Aug 2010 6:31] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100816062819-bluwgdq8q4xysmlg) (version source revid:alik@sun.com-20100816062612-enatdwnv809iw3s9) (pib:20)
[16 Aug 2010 17:06] Paul DuBois
Test suite changes. No changelog entry needed.
[28 Sep 2010 8:46] Bugs System
Pushed into mysql-5.1 5.1.52 (revid:sunanda.menon@sun.com-20100928083322-wangbv97uobu7g66) (version source revid:sunanda.menon@sun.com-20100928083322-wangbv97uobu7g66) (merge vers: 5.1.52) (pib:21)
[14 Oct 2010 8:26] Bugs System
Pushed into mysql-5.1-telco-7.0 5.1.51-ndb-7.0.20 (revid:martin.skold@mysql.com-20101014082627-jrmy9xbfbtrebw3c) (version source revid:martin.skold@mysql.com-20101014082627-jrmy9xbfbtrebw3c) (merge vers: 5.1.51-ndb-7.0.20) (pib:21)
[14 Oct 2010 8:41] Bugs System
Pushed into mysql-5.1-telco-6.3 5.1.51-ndb-6.3.39 (revid:martin.skold@mysql.com-20101014083757-5qo48b86d69zjvzj) (version source revid:martin.skold@mysql.com-20101014083757-5qo48b86d69zjvzj) (merge vers: 5.1.51-ndb-6.3.39) (pib:21)
[14 Oct 2010 8:56] Bugs System
Pushed into mysql-5.1-telco-6.2 5.1.51-ndb-6.2.19 (revid:martin.skold@mysql.com-20101014084420-y54ecj85j5we27oa) (version source revid:martin.skold@mysql.com-20101014084420-y54ecj85j5we27oa) (merge vers: 5.1.51-ndb-6.2.19) (pib:21)
[14 Oct 2010 15:35] Jon Stephens
Test only; returning to Closed.