diff options
author | Tor Didriksen <tor.didriksen@oracle.com> | 2013-12-18 11:05:18 +0100 |
---|---|---|
committer | Tor Didriksen <tor.didriksen@oracle.com> | 2013-12-18 11:05:18 +0100 |
commit | ba22c3f29a1b3277ac9b1094f13b9efcf39b05fb (patch) | |
tree | 799f10a187f6a64433df060f0b46fa02e11eb886 /mysys | |
parent | 11c0805e1d4ab1ba3e3b83aa5c041d69a6efa831 (diff) | |
download | mariadb-git-ba22c3f29a1b3277ac9b1094f13b9efcf39b05fb.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.c | 4 | ||||
-rw-r--r-- | mysys/mf_tempfile.c | 4 |
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; |