summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorTor Didriksen <tor.didriksen@oracle.com>2013-12-18 11:05:18 +0100
committerTor Didriksen <tor.didriksen@oracle.com>2013-12-18 11:05:18 +0100
commita3c97756577c135219d7e6eaa34d8d49d4b12acc (patch)
tree799f10a187f6a64433df060f0b46fa02e11eb886 /mysys
parent42be8c16f5cc1d4d18adec946e9d993bd3ab1ebb (diff)
downloadmariadb-git-a3c97756577c135219d7e6eaa34d8d49d4b12acc.tar.gz
Bug#16316074 RFE: MAKE TMPDIR A BUILD-TIME CONFIGURABLE OPTION
Bug#68338 RFE: make tmpdir a build-time configurable option Background: Some distributions use tmpfs for mounting /tmp by default, which has some advantages, but brings also new issues. Fedora started using tmpfs on /tmp in version 18 for example. If not configured otherwise in my.cnf, MySQL uses system's constant P_tmpdir expanded to /tmp on Linux. This can introduce some problems with limited space in /tmp and also some data loss in case of replication slave [1]. In case distributions would like to use /var/tmp, which should be better for MySQL purposes, then we have to patch the source or change tmpdir option in my.cnf, which is however not updated in case it has already existed. Thus, it would be useful to be able to specify default tmpdir path using a configure option, while using P_tmpdir in case it is not defined explicitly. Based on a contribution from Honza Horak
Diffstat (limited to 'mysys')
-rw-r--r--mysys/mf_tempdir.c4
-rw-r--r--mysys/mf_tempfile.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/mysys/mf_tempdir.c b/mysys/mf_tempdir.c
index eceb90bb619..34b469b4066 100644
--- a/mysys/mf_tempdir.c
+++ b/mysys/mf_tempdir.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010, 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
@@ -43,7 +43,7 @@ my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist)
pathlist=getenv("TMP");
#endif
if (!pathlist || !pathlist[0])
- pathlist=(char*) P_tmpdir;
+ pathlist= DEFAULT_TMPDIR;
}
do
{
diff --git a/mysys/mf_tempfile.c b/mysys/mf_tempfile.c
index 15482075c39..62b3e09747f 100644
--- a/mysys/mf_tempfile.c
+++ b/mysys/mf_tempfile.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010, 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
@@ -111,7 +111,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix,
sizeof(prefix_buff)-7),"XXXXXX") -
prefix_buff);
if (!dir && ! (dir =getenv("TMPDIR")))
- dir=P_tmpdir;
+ dir= DEFAULT_TMPDIR;
if (strlen(dir)+ pfx_len > FN_REFLEN-2)
{
errno=my_errno= ENAMETOOLONG;