diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2019-02-18 18:56:32 +0100 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2019-02-18 18:59:05 +0100 |
commit | 3a42926c88f8c3c582a7af7e482f6aded0c74f89 (patch) | |
tree | 9a4e292f32e3a34a3c428507b8c96d3455bf70b1 /client/mysqltest.cc | |
parent | 40b4f9c907e58a4b65677cc9e5b3f5deca8b7cb3 (diff) | |
download | mariadb-git-3a42926c88f8c3c582a7af7e482f6aded0c74f89.tar.gz |
MDEV-18204 Fix rocksdb incremental backup
Fix incremental prepare to copy #rocksdb subdirectory from the
incremental dir.
Diffstat (limited to 'client/mysqltest.cc')
-rw-r--r-- | client/mysqltest.cc | 59 |
1 files changed, 1 insertions, 58 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 00bea466912..1a6c22573e0 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -4019,63 +4019,6 @@ void do_mkdir(struct st_command *command) } -/* - Remove directory recursively. -*/ -static int rmtree(const char *dir) -{ - char path[FN_REFLEN]; - char sep[]={ FN_LIBCHAR, 0 }; - int err=0; - - MY_DIR *dir_info= my_dir(dir, MYF(MY_DONT_SORT | MY_WANT_STAT)); - if (!dir_info) - return 1; - - for (uint i= 0; i < dir_info->number_of_files; i++) - { - FILEINFO *file= dir_info->dir_entry + i; - /* Skip "." and ".." */ - if (!strcmp(file->name, ".") || !strcmp(file->name, "..")) - continue; - - strxnmov(path, sizeof(path), dir, sep, file->name, NULL); - - if (!MY_S_ISDIR(file->mystat->st_mode)) - { - err= my_delete(path, 0); -#ifdef _WIN32 - /* - On Windows, check and possible reset readonly attribute. - my_delete(), or DeleteFile does not remove theses files. - */ - if (err) - { - DWORD attr= GetFileAttributes(path); - if (attr != INVALID_FILE_ATTRIBUTES && - (attr & FILE_ATTRIBUTE_READONLY)) - { - SetFileAttributes(path, attr &~ FILE_ATTRIBUTE_READONLY); - err= my_delete(path, 0); - } - } -#endif - } - else - err= rmtree(path); - - if(err) - break; - } - - my_dirend(dir_info); - - if (!err) - err= rmdir(dir); - - return err; -} - /* SYNOPSIS @@ -4103,7 +4046,7 @@ void do_rmdir(struct st_command *command) DBUG_VOID_RETURN; DBUG_PRINT("info", ("removing directory: %s", ds_dirname.str)); - if (rmtree(ds_dirname.str)) + if (my_rmtree(ds_dirname.str, MYF(0))) handle_command_error(command, 1, errno); dynstr_free(&ds_dirname); |