[MDEV-4734] Adding ending / to a directory can fail when the directory ends with 0 Created: 2013-06-29 Updated: 2013-11-10 Resolved: 2013-11-10 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.0.3 |
| Fix Version/s: | 10.0.6 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Eric Bergen | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | tests | ||
| Environment: |
Fedora 18. bzr pull from lp:maria trunk |
||
| Attachments: |
|
| Description |
|
The rpl_binlog_index.test fails to clean up $tmpdir because files still exist. The files aren't cleaned up due to a missing slash in the tmpdir path.
|
| Comments |
| Comment by Elena Stepanova [ 2013-06-30 ] |
|
Just in case, I re-checked it on Fedora 18 64-bit with BUILD/compile-pentium64 (as discussed on IRC). As expected, still no failure. According to mysqltest code, the trailing slash should not be needed. The test fails to remove files in remove_files_wildcard 191: --echo # remove tmpdir But mysqltest in do_remove_files_wildcard explicitly adds a separator after a dirname: init_dynamic_string(&ds_file_to_remove, dirname, 1024, 1024); And FN_LIBCHAR is defined in my_global.h: #ifdef _WIN32 Since you are building from sources anyway, can you add a debugging print or run mysqltest under debugger to see what your FN_LIBCHAR is in mysqltest.cc:do_remove_files_wildcard ? Could you please also run the following test to see how it goes? --let $dirname= `SELECT uuid()` --list_files $MYSQLTEST_VARDIR/$dirname * --remove_files_wildcard $tmpdir *
Thanks. |
| Comment by Eric Bergen [ 2013-07-01 ] |
|
I dug a bit further into both the rpl_binlog_index test failure and the failure you sent me. They both fail on BUILD/compile-pentium64-debug. While it was in debug mode I was able to trace the problem down to some strange code in mysys/my_lib.c:102 it does a comparison against FN_LIBCHAR + 1 which seems to fail. Below that it would add a trailing slash if it succeeds. By removing the + 1 the test you gave me and rpl_binlog_index both succeed. The code in mysqltest.cc to add the trailing slash happens after the call to my_dir. |
| Comment by Elena Stepanova [ 2013-07-01 ] |
|
Thanks When I force a directory name to add with 0, it fails for me too. And I suppose for you the one below will pass (the only difference with the previous one is that I concatenate uuid() with '1': --let $dirname= `SELECT CONCAT(uuid(),'1')` --list_files $MYSQLTEST_VARDIR/$dirname * --remove_files_wildcard $tmpdir * |
| Comment by Eric Bergen [ 2013-07-01 ] |
|
I reworked directory_file_name to compare the ending character against '/' and it passes tests with my 0 uuid. The patch for this version is MDEV_4734_2.patch |
| Comment by Elena Stepanova [ 2013-07-01 ] |
|
Only 10.0 is affected, there was some refactoring in there. Test case for completion (be careful while copying it, make sure there are no leading or trailing spaces): --let $mydir= $MYSQLTEST_VARDIR/dir0 --remove_files_wildcard $mydir * --echo # All good See the patch proposed by Eric. |