summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2017-08-28 18:28:07 +0000
committerVladislav Vaintroub <wlad@mariadb.com>2017-08-28 18:28:07 +0000
commitdda40b930498b70bb5546f857b27744039a5649d (patch)
treefc68ae13dcbd984ac7f662dadfcb6d74ffa7fa61 /client
parent11352d52cd35f89b1d573405fca92932e112cba9 (diff)
downloadmariadb-git-dda40b930498b70bb5546f857b27744039a5649d.tar.gz
AWS Key Management : Introduce "mock" variable, available in debug build.
If this variable is set, skip actual AWS calls, and fake/mock both generation and encryption of the keys. The advantage of having a mock mode is that more aws_key_management tests can be enabled on buildbot.
Diffstat (limited to 'client')
-rw-r--r--client/mysqltest.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 99e4e4dfc66..155d0c4c092 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -4024,7 +4024,25 @@ static int rmtree(const char *dir)
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);