-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MDEV-35889 set information_schema.system_variables NUMERIC_MIN_VALUE for the innodb_buffer_pool_size system variable based on innodb_page_size #3777
base: 10.5
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -315,6 +315,7 @@ class sys_var_pluginvar: public sys_var, public Sql_alloc | |
st_plugin_int *p, st_mysql_sys_var *plugin_var_arg, | ||
const char *substitute); | ||
sys_var_pluginvar *cast_pluginvar() override { return this; } | ||
virtual const struct st_mysql_sys_var *cast_mysql_sys_var() const override { return plugin_var; } | ||
uchar* real_value_ptr(THD *thd, enum_var_type type) const; | ||
TYPELIB* plugin_var_typelib(void) const; | ||
const uchar* do_value_ptr(THD *thd, enum_var_type type, const LEX_CSTRING *base) const; | ||
|
@@ -3683,14 +3684,22 @@ bool sys_var_pluginvar::global_update(THD *thd, set_var *var) | |
|
||
#define OPTION_SET_LIMITS(type, options, opt) \ | ||
options->var_type= type; \ | ||
assert((opt)->def_val >= (opt)->min_val); \ | ||
assert((opt)->def_val <= (opt)->max_val); \ | ||
options->def_value= (opt)->def_val; \ | ||
assert((opt)->min_val <= (opt)->max_val); \ | ||
options->min_value= (opt)->min_val; \ | ||
options->max_value= (opt)->max_val; \ | ||
assert((opt)->blk_sz == 0 || ((opt)->min_val % (opt)->blk_sz) == 0); \ | ||
assert((opt)->blk_sz == 0 || ((opt)->max_val % (opt)->blk_sz) == 0); \ | ||
options->block_size= (long) (opt)->blk_sz | ||
|
||
#define OPTION_SET_LIMITS_DOUBLE(options, opt) \ | ||
options->var_type= GET_DOUBLE; \ | ||
assert((opt)->def_val >= (opt)->min_val); \ | ||
assert((opt)->def_val <= (opt)->max_val); \ | ||
options->def_value= (longlong) getopt_double2ulonglong((opt)->def_val); \ | ||
assert((opt)->min_val <= (opt)->max_val); \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's the server code, you could use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note, might need to drop the max divisible by block size - myisam_max_sort_file_size fails this as would other with a max value divisible by a power of two value.
|
||
options->min_value= (longlong) getopt_double2ulonglong((opt)->min_val); \ | ||
options->max_value= getopt_double2ulonglong((opt)->max_val); \ | ||
options->block_size= (long) (opt)->blk_sz; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you need that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
During plugin initialization the
mysq_sys_var
is copied tovar->option
giving the value of 2M for the variable:When InnoDB initializes, it changes it min_value because the innodb_page_size in this case is 64k.
Performing and information_schema select returns the original 2M value, despite the current situtation that the minimum is now 20M.
At some point to make information_schema.sysvars correct we need to pull the new mysql_sysvar_buffer_pool_size.min_value into the options used by the information schema. As the innodb_buffer_pool_size is dynamic, it makes sense to have a value in the information_schema that reflects its current value.