31#ifndef detail_fil_open_files_limit_h
32#define detail_fil_open_files_limit_h
93 return "innodb_open_files_limit";
98 return "innodb_set_open_files_limit";
109 "SUPER or SYSTEM_VARIABLES_ADMIN");
112 long long new_value_ll = *((
long long *)args->
args[0]);
118 ". New limit value can't be smaller than " +
123 if (new_value_ll > std::numeric_limits<int32_t>::max()) {
133 size_t new_value =
static_cast<size_t>(new_value_ll);
136 if (new_value == 0) {
143 ". Cannot update innodb_open_files to "
144 "this value. Not enough files could be closed in last 5 seconds "
145 "or a number of files that cannot be closed would exceed 90% of "
146 "the new limit. Consider setting it above " +
162 if (args->
args[0] ==
nullptr) {
164 "First argument must not be null.");
#define SUPER_ACL
Definition: auth_acls.h:69
A set of THD members describing the current authenticated user.
Definition: sql_security_ctx.h:54
bool check_access(Access_bitmask want_access, const std::string &db_name="", bool match_any=false)
Check permission against m_master_access.
Definition: sql_security_ctx.cc:322
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:702
Security_context * security_context() const
Definition: sql_class.h:1329
Definition: open_files_limit.h:85
std::string get_module_name() const override
Definition: open_files_limit.h:92
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:156
static long long innodb_set_open_files_limit(UDF_INIT *, UDF_ARGS *args, unsigned char *, unsigned char *)
Definition: open_files_limit.h:101
std::vector< srv::dynamic_procedure_data_t > get_procedures() const override
Definition: open_files_limit.h:87
static std::string get_procedure_name()
Definition: open_files_limit.h:97
static void innodb_set_open_files_limit_deinit(UDF_INIT *)
Deinitialize dynamic procedure innodb_set_open_files_limit.
Definition: open_files_limit.h:175
Definition: open_files_limit.h:43
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:192
std::atomic< size_t > m_limit
The maximum limit for opened files.
Definition: open_files_limit.h:184
void revert_desired_limit()
Definition: open_files_limit.h:75
Dynamic_procedures m_dynamic_procedures
Definition: open_files_limit.h:178
static constexpr int MINIMUM_VALID_VALUE
Definition: open_files_limit.h:195
void commit_desired_limit()
Definition: open_files_limit.h:69
size_t get_limit() const
Definition: open_files_limit.h:56
~Open_files_limit()
Definition: open_files_limit.h:51
Open_files_limit(size_t limit)
Definition: open_files_limit.h:45
bool set_desired_limit(size_t desired)
Definition: open_files_limit.h:57
size_t m_old_limit
The old value of the limit when a change is in progress.
Definition: open_files_limit.h:188
Definition: srv0dynamic_procedures.h:90
void unregister()
Unregister dynamic SQL procedure.
Definition: srv0dynamic_procedures.h:138
bool register_procedures()
Register dynamic SQL procedure.
Definition: srv0dynamic_procedures.h:99
thread_local THD * current_thd
Definition: current_thd.cc:26
void my_error(int nr, myf MyFlags,...)
Fill in and print a previously registered error message.
Definition: my_error.cc:216
#define DEBUG_SYNC_C(_sync_point_name_)
Definition: my_sys.h:211
static std::string to_string(const LEX_STRING &str)
Definition: lex_string.h:50
#define MYF(v)
Definition: my_inttypes.h:97
#define MYSQL_ERRMSG_SIZE
Max length of a error message.
Definition: mysql_com.h:881
Definition: ut0tuple.h:57
Definition: open_files_limit.h:40
bool fil_open_files_limit_update(size_t &new_max_open_files)
Definition: fil0fil.cc:3593
Helper for managing dynamic SQL procedures.
#define STRING_WITH_LEN(X)
Definition: string_with_len.h:29
Definition: udf_registration_types.h:48
char ** args
Pointer to argument.
Definition: udf_registration_types.h:51
enum Item_result * arg_type
Pointer to item_results.
Definition: udf_registration_types.h:50
unsigned int arg_count
Number of arguments.
Definition: udf_registration_types.h:49
Information about the result of a user defined function.
Definition: udf_registration_types.h:66
@ INT_RESULT
double
Definition: udf_registration_types.h:43
#define ut_a(EXPR)
Abort execution if EXPR does not evaluate to nonzero.
Definition: ut0dbg.h:93