Commit efd91dff authored by unknown's avatar unknown

Fixes to merge.


mysql-test/r/maria.result:
  Fixed result file. The results will be fixed by Sergei's patch.
mysql-test/t/variables.test:
  Fixed result file. The results will be fixed by Sergei's patch.
mysys/my_getopt.c:
  Fixed a problem with manual merge.
sql/set_var.cc:
  Fixed a problem with manual merge.
sql/set_var.h:
  Fixed a problem with manual merge.
sql/sql_plugin.cc:
  Removed unneccessary function call. This was forgotten from
  a previous patch.
parent 389dcccb
...@@ -2051,10 +2051,10 @@ maria_block_size 8192 ...@@ -2051,10 +2051,10 @@ maria_block_size 8192
maria_checkpoint_interval 30 maria_checkpoint_interval 30
maria_log_file_size 4294959104 maria_log_file_size 4294959104
maria_log_purge_type immediate maria_log_purge_type immediate
maria_max_sort_file_size 9223372036853727232 maria_max_sort_file_size 9223372036854775807
maria_page_checksum ON maria_page_checksum ON
maria_pagecache_age_threshold 300 maria_pagecache_age_threshold 300
maria_pagecache_buffer_size 8384512 maria_pagecache_buffer_size 8388572
maria_pagecache_division_limit 100 maria_pagecache_division_limit 100
maria_repair_threads 1 maria_repair_threads 1
maria_sort_buffer_size 8388608 maria_sort_buffer_size 8388608
......
...@@ -141,9 +141,9 @@ set GLOBAL myisam_max_sort_file_size=2000000; ...@@ -141,9 +141,9 @@ set GLOBAL myisam_max_sort_file_size=2000000;
show global variables like 'myisam_max_sort_file_size'; show global variables like 'myisam_max_sort_file_size';
select * from information_schema.global_variables where variable_name like 'myisam_max_sort_file_size'; select * from information_schema.global_variables where variable_name like 'myisam_max_sort_file_size';
set GLOBAL myisam_max_sort_file_size=default; set GLOBAL myisam_max_sort_file_size=default;
--replace_result 2146435072 FILE_SIZE 9223372036853727232 FILE_SIZE --replace_result 2147483647 FILE_SIZE 9223372036854775807 FILE_SIZE
show variables like 'myisam_max_sort_file_size'; show variables like 'myisam_max_sort_file_size';
--replace_result 2146435072 FILE_SIZE 9223372036853727232 FILE_SIZE --replace_result 2147483647 FILE_SIZE 9223372036854775807 FILE_SIZE
select * from information_schema.session_variables where variable_name like 'myisam_max_sort_file_size'; select * from information_schema.session_variables where variable_name like 'myisam_max_sort_file_size';
set global net_retry_count=10, session net_retry_count=10; set global net_retry_count=10, session net_retry_count=10;
......
...@@ -27,10 +27,15 @@ typedef void (*init_func_p)(const struct my_option *option, uchar* *variable, ...@@ -27,10 +27,15 @@ typedef void (*init_func_p)(const struct my_option *option, uchar* *variable,
static void default_reporter(enum loglevel level, const char *format, ...); static void default_reporter(enum loglevel level, const char *format, ...);
my_error_reporter my_getopt_error_reporter= &default_reporter; my_error_reporter my_getopt_error_reporter= &default_reporter;
static int findopt(char *, uint, const struct my_option **, char **); static int findopt(char *optpat, uint length,
my_bool getopt_compare_strings(const char *, const char *, uint); const struct my_option **opt_res,
char **ffname);
my_bool getopt_compare_strings(const char *s,
const char *t,
uint length);
static longlong getopt_ll(char *arg, const struct my_option *optp, int *err); static longlong getopt_ll(char *arg, const struct my_option *optp, int *err);
static ulonglong getopt_ull(char *, const struct my_option *, int *); static ulonglong getopt_ull(char *arg, const struct my_option *optp,
int *err);
static double getopt_double(char *arg, const struct my_option *optp, int *err); static double getopt_double(char *arg, const struct my_option *optp, int *err);
static void init_variables(const struct my_option *options, static void init_variables(const struct my_option *options,
init_func_p init_one_value); init_func_p init_one_value);
...@@ -38,7 +43,8 @@ static void init_one_value(const struct my_option *option, uchar* *variable, ...@@ -38,7 +43,8 @@ static void init_one_value(const struct my_option *option, uchar* *variable,
longlong value); longlong value);
static void fini_one_value(const struct my_option *option, uchar* *variable, static void fini_one_value(const struct my_option *option, uchar* *variable,
longlong value); longlong value);
static int setval(const struct my_option *, uchar **, char *, my_bool); static int setval(const struct my_option *opts, uchar **value, char *argument,
my_bool set_maximum_value);
static char *check_struct_option(char *cur_arg, char *key_name); static char *check_struct_option(char *cur_arg, char *key_name);
/* /*
...@@ -861,7 +867,7 @@ ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp, ...@@ -861,7 +867,7 @@ ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp,
bool *fix) bool *fix)
{ {
bool adjusted= FALSE; bool adjusted= FALSE;
ulonglong old= num; ulonglong old= num, mod;
char buf1[255], buf2[255]; char buf1[255], buf2[255];
if ((ulonglong) num > (ulonglong) optp->max_value && if ((ulonglong) num > (ulonglong) optp->max_value &&
...@@ -886,6 +892,8 @@ ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp, ...@@ -886,6 +892,8 @@ ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp,
num= ((ulonglong) ULONG_MAX); num= ((ulonglong) ULONG_MAX);
adjusted= TRUE; adjusted= TRUE;
} }
#else
num= min(num, LONG_MAX);
#endif #endif
break; break;
default: default:
...@@ -951,41 +959,35 @@ static double getopt_double(char *arg, const struct my_option *optp, int *err) ...@@ -951,41 +959,35 @@ static double getopt_double(char *arg, const struct my_option *optp, int *err)
SYNOPSIS SYNOPSIS
init_one_value() init_one_value()
optp Option to initialize option Option to initialize
value Pointer to variable value Pointer to variable
*/ */
static void init_one_value(const struct my_option *optp, uchar* *variable, static void init_one_value(const struct my_option *option, uchar* *variable,
longlong value) longlong value)
{ {
DBUG_ENTER("init_one_value"); DBUG_ENTER("init_one_value");
switch ((optp->var_type & GET_TYPE_MASK)) { switch ((option->var_type & GET_TYPE_MASK)) {
case GET_BOOL: case GET_BOOL:
*((my_bool*) variable)= (my_bool) value; *((my_bool*) variable)= (my_bool) value;
break; break;
case GET_INT: case GET_INT:
*((int*) variable)= (int) getopt_ll_limit_value(value, optp, NULL); *((int*) variable)= (int) value;
break;
case GET_UINT:
*((uint*) variable)= (uint) getopt_ull_limit_value(value, optp, NULL);
break; break;
case GET_UINT: /* Fall through */
case GET_ENUM: case GET_ENUM:
*((uint*) variable)= (uint) value; *((uint*) variable)= (uint) value;
break; break;
case GET_LONG: case GET_LONG:
*((long*) variable)= (long) getopt_ll_limit_value(value, optp, NULL); *((long*) variable)= (long) value;
break; break;
case GET_ULONG: case GET_ULONG:
*((ulong*) variable)= (ulong) getopt_ull_limit_value(value, optp, NULL); *((ulong*) variable)= (ulong) value;
break; break;
case GET_LL: case GET_LL:
*((longlong*) variable)= (longlong) getopt_ll_limit_value(value, optp, *((longlong*) variable)= (longlong) value;
NULL);
break;
case GET_ULL:
*((ulonglong*) variable)= (ulonglong) getopt_ull_limit_value(value, optp,
NULL);
break; break;
case GET_ULL: /* Fall through */
case GET_SET: case GET_SET:
*((ulonglong*) variable)= (ulonglong) value; *((ulonglong*) variable)= (ulonglong) value;
break; break;
......
...@@ -331,10 +331,12 @@ static sys_var_thd_ulong sys_myisam_repair_threads(&vars, "myisam_repair_t ...@@ -331,10 +331,12 @@ static sys_var_thd_ulong sys_myisam_repair_threads(&vars, "myisam_repair_t
static sys_var_thd_ulong sys_myisam_sort_buffer_size(&vars, "myisam_sort_buffer_size", &SV::myisam_sort_buff_size); static sys_var_thd_ulong sys_myisam_sort_buffer_size(&vars, "myisam_sort_buffer_size", &SV::myisam_sort_buff_size);
static sys_var_bool_ptr sys_myisam_use_mmap(&vars, "myisam_use_mmap", static sys_var_bool_ptr sys_myisam_use_mmap(&vars, "myisam_use_mmap",
&opt_myisam_use_mmap); &opt_myisam_use_mmap);
static sys_var_thd_enum sys_myisam_stats_method(&vars, "myisam_stats_method", static sys_var_thd_enum sys_myisam_stats_method(&vars, "myisam_stats_method",
&SV::myisam_stats_method, &SV::myisam_stats_method,
&myisam_stats_method_typelib, &myisam_stats_method_typelib,
NULL); NULL);
static sys_var_thd_ulong sys_net_buffer_length(&vars, "net_buffer_length", static sys_var_thd_ulong sys_net_buffer_length(&vars, "net_buffer_length",
&SV::net_buffer_length); &SV::net_buffer_length);
static sys_var_thd_ulong sys_net_read_timeout(&vars, "net_read_timeout", static sys_var_thd_ulong sys_net_read_timeout(&vars, "net_read_timeout",
...@@ -387,10 +389,10 @@ static sys_var_thd_ulong sys_trans_alloc_block_size(&vars, "transaction_alloc_bl ...@@ -387,10 +389,10 @@ static sys_var_thd_ulong sys_trans_alloc_block_size(&vars, "transaction_alloc_bl
static sys_var_thd_ulong sys_trans_prealloc_size(&vars, "transaction_prealloc_size", static sys_var_thd_ulong sys_trans_prealloc_size(&vars, "transaction_prealloc_size",
&SV::trans_prealloc_size, &SV::trans_prealloc_size,
0, fix_trans_mem_root); 0, fix_trans_mem_root);
sys_var_thd_enum sys_thread_handling(&vars, "thread_handling", sys_var_enum_const sys_thread_handling(&vars, "thread_handling",
&SV::thread_handling, &SV::thread_handling,
&thread_handling_typelib, &thread_handling_typelib,
NULL); NULL);
#ifdef HAVE_QUERY_CACHE #ifdef HAVE_QUERY_CACHE
static sys_var_long_ptr sys_query_cache_limit(&vars, "query_cache_limit", static sys_var_long_ptr sys_query_cache_limit(&vars, "query_cache_limit",
...@@ -1229,6 +1231,13 @@ uchar *sys_var_enum::value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) ...@@ -1229,6 +1231,13 @@ uchar *sys_var_enum::value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
return (uchar*) enum_names->type_names[*value]; return (uchar*) enum_names->type_names[*value];
} }
uchar *sys_var_enum_const::value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base)
{
return (uchar*) enum_names->type_names[global_system_variables.*offset];
}
bool sys_var_thd_ulong::check(THD *thd, set_var *var) bool sys_var_thd_ulong::check(THD *thd, set_var *var)
{ {
return (get_unsigned(thd, var) || return (get_unsigned(thd, var) ||
...@@ -1982,7 +1991,6 @@ LEX_STRING default_key_cache_base= {(char *) "default", 7 }; ...@@ -1982,7 +1991,6 @@ LEX_STRING default_key_cache_base= {(char *) "default", 7 };
static KEY_CACHE zero_key_cache; static KEY_CACHE zero_key_cache;
KEY_CACHE *get_key_cache(LEX_STRING *cache_name) KEY_CACHE *get_key_cache(LEX_STRING *cache_name)
{ {
safe_mutex_assert_owner(&LOCK_global_system_variables); safe_mutex_assert_owner(&LOCK_global_system_variables);
...@@ -3701,7 +3709,6 @@ void sys_var_trust_routine_creators::warn_deprecated(THD *thd) ...@@ -3701,7 +3709,6 @@ void sys_var_trust_routine_creators::warn_deprecated(THD *thd)
"'log_bin_trust_function_creators'"); "'log_bin_trust_function_creators'");
} }
void sys_var_trust_routine_creators::set_default(THD *thd, enum_var_type type) void sys_var_trust_routine_creators::set_default(THD *thd, enum_var_type type)
{ {
warn_deprecated(thd); warn_deprecated(thd);
......
...@@ -305,6 +305,24 @@ public: ...@@ -305,6 +305,24 @@ public:
}; };
class sys_var_enum_const :public sys_var
{
ulong SV::*offset;
TYPELIB *enum_names;
public:
sys_var_enum_const(sys_var_chain *chain, const char *name_arg, ulong SV::*offset_arg,
TYPELIB *typelib, sys_after_update_func func)
:sys_var(name_arg,func), offset(offset_arg), enum_names(typelib)
{ chain_sys_var(chain); }
bool check(THD *thd, set_var *var) { return 1; }
bool update(THD *thd, set_var *var) { return 1; }
SHOW_TYPE show_type() { return SHOW_CHAR; }
bool check_update_type(Item_result type) { return 1; }
bool is_readonly() const { return 1; }
uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
};
class sys_var_thd :public sys_var class sys_var_thd :public sys_var
{ {
public: public:
......
...@@ -1937,7 +1937,6 @@ static int check_func_longlong(THD *thd, struct st_mysql_sys_var *var, ...@@ -1937,7 +1937,6 @@ static int check_func_longlong(THD *thd, struct st_mysql_sys_var *var,
struct my_option options; struct my_option options;
value->val_int(value, &tmp); value->val_int(value, &tmp);
plugin_opt_set_limits(&options, var); plugin_opt_set_limits(&options, var);
*(ulonglong *)save= getopt_ull_limit_value(tmp, &options, &fixed);
if (var->flags & PLUGIN_VAR_UNSIGNED) if (var->flags & PLUGIN_VAR_UNSIGNED)
*(ulonglong *)save= getopt_ull_limit_value((ulonglong) tmp, &options, *(ulonglong *)save= getopt_ull_limit_value((ulonglong) tmp, &options,
......
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