diff options
author | sayantan dutta <sayantan.dutta@oracle.com> | 2013-03-29 16:33:33 +0530 |
---|---|---|
committer | sayantan dutta <sayantan.dutta@oracle.com> | 2013-03-29 16:33:33 +0530 |
commit | 673a93efa1c38e9b57cb504f60c74f441c4bc145 (patch) | |
tree | a297643d578f2365c32c585bbbf71c7f852e45ed /client | |
parent | 002850707d9fef56f5831f4f4aee508cd0c3870a (diff) | |
download | mariadb-git-673a93efa1c38e9b57cb504f60c74f441c4bc145.tar.gz |
Bug #16402124 - MTR PROCESSES CERTAIN ASSIGNED VARDIR VALUES WRONG
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqltest.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 3d8fe85fb80..78dcdd77659 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -3326,8 +3326,12 @@ void do_remove_files_wildcard(struct st_command *command) /* Set default wild chars for wild_compare, is changed in embedded mode */ set_wild_chars(1); + uint length; + /* Storing the length of the path to the file, so it can be reused */ + length= ds_file_to_remove.length; for (i= 0; i < (uint) dir_info->number_off_files; i++) { + ds_file_to_remove.length= length; file= dir_info->dir_entry + i; /* Remove only regular files, i.e. no directories etc. */ /* if (!MY_S_ISREG(file->mystat->st_mode)) */ @@ -3337,8 +3341,10 @@ void do_remove_files_wildcard(struct st_command *command) if (ds_wild.length && wild_compare(file->name, ds_wild.str, 0)) continue; - ds_file_to_remove.length= ds_directory.length + 1; - ds_file_to_remove.str[ds_directory.length + 1]= 0; + /* Not required as the var ds_file_to_remove.length already has the + length in canonnicalized form */ + /* ds_file_to_remove.length= ds_directory.length + 1; + ds_file_to_remove.str[ds_directory.length + 1]= 0; */ dynstr_append(&ds_file_to_remove, file->name); DBUG_PRINT("info", ("removing file: %s", ds_file_to_remove.str)); error= my_delete(ds_file_to_remove.str, MYF(0)) != 0; |