Commit 17a21c4f authored by Georgi Kodinov's avatar Georgi Kodinov

Bug #47095: Can't open_files_limit really be larger than 65535?

Several problems addressed:

1. The maximum value for --open_files_limit on non-windows boxes
is now raised to UINT_MAX (the maximum possible without significant
changes in the code). The maximum value on windows is kept to be
2048 due to a known limitation (bug 24509).

2. mysqld_safe now supports --open_files_limit=xx in addition to 
--open-files-limit=xx

3. mysqld_safe always passes through --open[_-]files[_-]limit
to the underlying mysqld. It used to pass it through only if it 
the user running the script has access to the root directory or
there was an --user argument specified.

4. Fixed a prototype in my_file.c to match its counterpart in 
the other #ifdef branch.
parent 24a9fb55
......@@ -751,7 +751,7 @@ typedef SOCKET_SIZE_TYPE size_socket;
#endif
#define MY_NFILE 64 /* This is only used to save filenames */
#ifndef OS_FILE_LIMIT
#define OS_FILE_LIMIT 65535
#define OS_FILE_LIMIT UINT_MAX
#endif
/* #define EXT_IN_LIBNAME */
......
......@@ -72,7 +72,7 @@ static uint set_max_open_files(uint max_file_limit)
}
#else
static int set_max_open_files(uint max_file_limit)
static uint set_max_open_files(uint max_file_limit)
{
/* We don't know the limit. Return best guess */
return min(max_file_limit, OS_FILE_LIMIT);
......
......@@ -183,6 +183,7 @@ parse_arguments() {
;;
--nice=*) niceness="$val" ;;
--open-files-limit=*) open_files="$val" ;;
--open_files_limit=*) open_files="$val" ;;
--skip-kill-mysqld*) KILL_MYSQLD=0 ;;
--syslog) want_syslog=1 ;;
--skip-syslog) want_syslog=0 ;;
......@@ -397,10 +398,14 @@ then
if test -n "$open_files"
then
ulimit -n $open_files
append_arg_to_args "--open-files-limit=$open_files"
fi
fi
if test -n "$open_files"
then
append_arg_to_args "--open-files-limit=$open_files"
fi
safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}}
# Make sure that directory for $safe_mysql_unix_port exists
mysql_unix_port_dir=`dirname $safe_mysql_unix_port`
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment