To make it actually work, the user should have the hard limit set to unlimited. I don't know if it happens, I've never seen it so far.
mysqld_safe executes "ulimit -n $open_files". The manual says that this does set both the hard and soft limit.
When setting new limits, if neither '-H' nor '-S' is supplied, both the hard and soft limits are set.
https://ss64.com/bash/ulimit.html
But even if it does, would someone really want to allow such access for mysqld?
I think that it's reasonable to assume that MariaDB can manage file descriptors well enough, and that it's reasonable to set the open file limit to unlimited to guarantee that MariaDB can't run out of file descriptors.
Anyway, it's probably pointless because it looks like the server itself won't allow an infinite limit right now. It sets the its own limit with setrlimit:
https://github.com/MariaDB/server/blob/5abc79dd7ab2fccb4b05ca38a512ec816d2f8e52/mysys/my_file.c#L42
And it sets a maximum limit of OS_FILE_LIMIT on that limit:
https://github.com/MariaDB/server/blob/5abc79dd7ab2fccb4b05ca38a512ec816d2f8e52/mysys/my_file.c#L102
And OS_FILE_LIMIT is defined as UINT_MAX (4294967295):
https://github.com/MariaDB/server/blob/8dc460b844dcb8a8ef70396bfaf932010076b9a3/include/my_global.h#L695
Whereas RLIMIT_INFINITY seems to be defined as ULLONG_MAX on my system:
$ grep "RLIM_INFINITY" /usr/include/bits/resource.h
|
# define RLIM_INFINITY ((__rlim_t) -1)
|
# define RLIM_INFINITY 0xffffffffffffffffuLL
|
#define RLIM_SAVED_MAX RLIM_INFINITY
|
#define RLIM_SAVED_CUR RLIM_INFINITY
|
So OS_FILE_LIMIT and the maximum value of the server's open_files_limit variable would probably have to be increased to ULLONG_MAX to really set the limit to infinite:
https://github.com/MariaDB/server/blob/78829a5780d3e48da376c1ca4e62731da450c551/sql/sys_vars.cc#L2434
But it probably doesn't matter. open_files_limit=4294967295 might be effectively "unlimited"
Does it make sense, realistically?
To make it actually work, the user should have the hard limit set to unlimited. I don't know if it happens, I've never seen it so far. But even if it does, would someone really want to allow such access for mysqld?