Commit 83dfeb24 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 1008fd89
...@@ -751,7 +751,7 @@ typedef SOCKET_SIZE_TYPE size_socket; ...@@ -751,7 +751,7 @@ typedef SOCKET_SIZE_TYPE size_socket;
#endif #endif
#define MY_NFILE 64 /* This is only used to save filenames */ #define MY_NFILE 64 /* This is only used to save filenames */
#ifndef OS_FILE_LIMIT #ifndef OS_FILE_LIMIT
#define OS_FILE_LIMIT 65535 #define OS_FILE_LIMIT UINT_MAX
#endif #endif
/* #define EXT_IN_LIBNAME */ /* #define EXT_IN_LIBNAME */
......
...@@ -72,7 +72,7 @@ static uint set_max_open_files(uint max_file_limit) ...@@ -72,7 +72,7 @@ static uint set_max_open_files(uint max_file_limit)
} }
#else #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 */ /* We don't know the limit. Return best guess */
return min(max_file_limit, OS_FILE_LIMIT); return min(max_file_limit, OS_FILE_LIMIT);
......
...@@ -183,6 +183,7 @@ parse_arguments() { ...@@ -183,6 +183,7 @@ parse_arguments() {
;; ;;
--nice=*) niceness="$val" ;; --nice=*) niceness="$val" ;;
--open-files-limit=*) open_files="$val" ;; --open-files-limit=*) open_files="$val" ;;
--open_files_limit=*) open_files="$val" ;;
--skip-kill-mysqld*) KILL_MYSQLD=0 ;; --skip-kill-mysqld*) KILL_MYSQLD=0 ;;
--syslog) want_syslog=1 ;; --syslog) want_syslog=1 ;;
--skip-syslog) want_syslog=0 ;; --skip-syslog) want_syslog=0 ;;
...@@ -397,10 +398,14 @@ then ...@@ -397,10 +398,14 @@ then
if test -n "$open_files" if test -n "$open_files"
then then
ulimit -n $open_files ulimit -n $open_files
append_arg_to_args "--open-files-limit=$open_files"
fi fi
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@}} safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}}
# Make sure that directory for $safe_mysql_unix_port exists # Make sure that directory for $safe_mysql_unix_port exists
mysql_unix_port_dir=`dirname $safe_mysql_unix_port` 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