30#ifndef detail_fil_open_files_limit_h
31#define detail_fil_open_files_limit_h
92 return "innodb_open_files_limit";
97 return "innodb_set_open_files_limit";
108 "SUPER or SYSTEM_VARIABLES_ADMIN");
111 long long new_value_ll = *((
long long *)args->
args[0]);
117 ". New limit value can't be smaller than " +
122 if (new_value_ll > std::numeric_limits<int32_t>::max()) {
132 size_t new_value =
static_cast<size_t>(new_value_ll);
135 if (new_value == 0) {
142 ". Cannot update innodb_open_files to "
143 "this value. Not enough files could be closed in last 5 seconds "
144 "or a number of files that cannot be closed would exceed 90% of "
145 "the new limit. Consider setting it above " +
161 if (args->
args[0] ==
nullptr) {
163 "First argument must not be null.");
#define SUPER_ACL
Definition: auth_acls.h:65
A set of THD members describing the current authenticated user.
Definition: sql_security_ctx.h:52
bool check_access(ulong want_access, const std::string &db_name="", bool match_any=false)
Check permission against m_master_access.
Definition: sql_security_ctx.cc:321
std::pair< bool, bool > has_global_grant(const char *priv, size_t priv_len)
Checks if the Current_user has the asked dynamic privilege.
Definition: sql_security_ctx.cc:699
Security_context * security_context() const
Definition: sql_class.h:1278
Definition: open_files_limit.h:84
std::string get_module_name() const override
Definition: open_files_limit.h:91
static bool innodb_set_open_files_limit_init(UDF_INIT *, UDF_ARGS *args, char *message)
Initialize dynamic procedure innodb_set_open_files_limit.
Definition: open_files_limit.h:155
static long long innodb_set_open_files_limit(UDF_INIT *, UDF_ARGS *args, unsigned char *, unsigned char *)
Definition: open_files_limit.h:100
std::vector< srv::dynamic_procedure_data_t > get_procedures() const override
Definition: open_files_limit.h:86
static std::string get_procedure_name()
Definition: open_files_limit.h:96
static void innodb_set_open_files_limit_deinit(UDF_INIT *)
Deinitialize dynamic procedure innodb_set_open_files_limit.
Definition: open_files_limit.h:174
Definition: open_files_limit.h:42
std::atomic_flag m_is_change_in_progress
Atomic flag stating if a change of the limit is in progress.
Definition: open_files_limit.h:191
std::atomic< size_t > m_limit
The maximum limit for opened files.
Definition: open_files_limit.h:183
void revert_desired_limit()
Definition: open_files_limit.h:74
Dynamic_procedures m_dynamic_procedures
Definition: open_files_limit.h:177
static constexpr int MINIMUM_VALID_VALUE
Definition: open_files_limit.h:194
void commit_desired_limit()
Definition: open_files_limit.h:68
size_t get_limit() const
Definition: open_files_limit.h:55
~Open_files_limit()
Definition: open_files_limit.h:50
Open_files_limit(size_t limit)
Definition: open_files_limit.h:44
bool set_desired_limit(size_t desired)
Definition: open_files_limit.h:56
size_t m_old_limit
The old value of the limit when a change is in progress.
Definition: open_files_limit.h:187
Definition: srv0dynamic_procedures.h:89
void unregister()
Unregister dynamic SQL procedure.
Definition: srv0dynamic_procedures.h:137
bool register_procedures()
Register dynamic SQL procedure.
Definition: srv0dynamic_procedures.h:98
thread_local THD * current_thd
Definition: current_thd.cc:25
void my_error(int nr, myf MyFlags,...)
Fill in and print a previously registered error message.
Definition: my_error.cc:215
#define DEBUG_SYNC_C(_sync_point_name_)
Definition: my_sys.h:213
static std::string to_string(const LEX_STRING &str)
Definition: lex_string.h:49
#define MYF(v)
Definition: my_inttypes.h:96
#define MYSQL_ERRMSG_SIZE
Max length of a error message.
Definition: mysql_com.h:886
Definition: ut0tuple.h:56
Definition: open_files_limit.h:39
bool fil_open_files_limit_update(size_t &new_max_open_files)
Definition: fil0fil.cc:3619
Helper for managing dynamic SQL procedures.
#define STRING_WITH_LEN(X)
Definition: string_with_len.h:28
Definition: udf_registration_types.h:47
char ** args
Pointer to argument.
Definition: udf_registration_types.h:50
enum Item_result * arg_type
Pointer to item_results.
Definition: udf_registration_types.h:49
unsigned int arg_count
Number of arguments.
Definition: udf_registration_types.h:48
Information about the result of a user defined function.
Definition: udf_registration_types.h:65
@ INT_RESULT
double
Definition: udf_registration_types.h:42
#define ut_a(EXPR)
Abort execution if EXPR does not evaluate to nonzero.
Definition: ut0dbg.h:92