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
maria_checkpoint_interval 30
maria_log_file_size 4294959104
maria_log_purge_type immediate
maria_max_sort_file_size 9223372036853727232
maria_max_sort_file_size 9223372036854775807
maria_page_checksum ON
maria_pagecache_age_threshold 300
maria_pagecache_buffer_size 8384512
maria_pagecache_buffer_size 8388572
maria_pagecache_division_limit 100
maria_repair_threads 1
maria_sort_buffer_size 8388608
......
......@@ -141,9 +141,9 @@ set GLOBAL myisam_max_sort_file_size=2000000;
show global variables 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;
--replace_result 2146435072 FILE_SIZE 9223372036853727232 FILE_SIZE
--replace_result 2147483647 FILE_SIZE 9223372036854775807 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';
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,
static void default_reporter(enum loglevel level, const char *format, ...);
my_error_reporter my_getopt_error_reporter= &default_reporter;
static int findopt(char *, uint, const struct my_option **, char **);
my_bool getopt_compare_strings(const char *, const char *, uint);
static int findopt(char *optpat, uint length,
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 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 void init_variables(const struct my_option *options,
init_func_p init_one_value);
......@@ -38,7 +43,8 @@ static void init_one_value(const struct my_option *option, uchar* *variable,
longlong value);
static void fini_one_value(const struct my_option *option, uchar* *variable,
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);
/*
......@@ -861,7 +867,7 @@ ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp,
bool *fix)
{
bool adjusted= FALSE;
ulonglong old= num;
ulonglong old= num, mod;
char buf1[255], buf2[255];
if ((ulonglong) num > (ulonglong) optp->max_value &&
......@@ -886,6 +892,8 @@ ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp,
num= ((ulonglong) ULONG_MAX);
adjusted= TRUE;
}
#else
num= min(num, LONG_MAX);
#endif
break;
default:
......@@ -951,41 +959,35 @@ static double getopt_double(char *arg, const struct my_option *optp, int *err)
SYNOPSIS
init_one_value()
optp Option to initialize
option Option to initialize
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)
{
DBUG_ENTER("init_one_value");
switch ((optp->var_type & GET_TYPE_MASK)) {
switch ((option->var_type & GET_TYPE_MASK)) {
case GET_BOOL:
*((my_bool*) variable)= (my_bool) value;
break;
case GET_INT:
*((int*) variable)= (int) getopt_ll_limit_value(value, optp, NULL);
break;
case GET_UINT:
*((uint*) variable)= (uint) getopt_ull_limit_value(value, optp, NULL);
*((int*) variable)= (int) value;
break;
case GET_UINT: /* Fall through */
case GET_ENUM:
*((uint*) variable)= (uint) value;
break;
case GET_LONG:
*((long*) variable)= (long) getopt_ll_limit_value(value, optp, NULL);
*((long*) variable)= (long) value;
break;
case GET_ULONG:
*((ulong*) variable)= (ulong) getopt_ull_limit_value(value, optp, NULL);
*((ulong*) variable)= (ulong) value;
break;
case GET_LL:
*((longlong*) variable)= (longlong) getopt_ll_limit_value(value, optp,
NULL);
break;
case GET_ULL:
*((ulonglong*) variable)= (ulonglong) getopt_ull_limit_value(value, optp,
NULL);
*((longlong*) variable)= (longlong) value;
break;
case GET_ULL: /* Fall through */
case GET_SET:
*((ulonglong*) variable)= (ulonglong) value;
break;
......
......@@ -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_bool_ptr sys_myisam_use_mmap(&vars, "myisam_use_mmap",
&opt_myisam_use_mmap);
static sys_var_thd_enum sys_myisam_stats_method(&vars, "myisam_stats_method",
&SV::myisam_stats_method,
&myisam_stats_method_typelib,
NULL);
static sys_var_thd_ulong sys_net_buffer_length(&vars, "net_buffer_length",
&SV::net_buffer_length);
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
static sys_var_thd_ulong sys_trans_prealloc_size(&vars, "transaction_prealloc_size",
&SV::trans_prealloc_size,
0, fix_trans_mem_root);
sys_var_thd_enum sys_thread_handling(&vars, "thread_handling",
&SV::thread_handling,
&thread_handling_typelib,
NULL);
sys_var_enum_const sys_thread_handling(&vars, "thread_handling",
&SV::thread_handling,
&thread_handling_typelib,
NULL);
#ifdef HAVE_QUERY_CACHE
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)
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)
{
return (get_unsigned(thd, var) ||
......@@ -1982,7 +1991,6 @@ LEX_STRING default_key_cache_base= {(char *) "default", 7 };
static KEY_CACHE zero_key_cache;
KEY_CACHE *get_key_cache(LEX_STRING *cache_name)
{
safe_mutex_assert_owner(&LOCK_global_system_variables);
......@@ -3701,7 +3709,6 @@ void sys_var_trust_routine_creators::warn_deprecated(THD *thd)
"'log_bin_trust_function_creators'");
}
void sys_var_trust_routine_creators::set_default(THD *thd, enum_var_type type)
{
warn_deprecated(thd);
......
......@@ -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
{
public:
......
......@@ -1937,7 +1937,6 @@ static int check_func_longlong(THD *thd, struct st_mysql_sys_var *var,
struct my_option options;
value->val_int(value, &tmp);
plugin_opt_set_limits(&options, var);
*(ulonglong *)save= getopt_ull_limit_value(tmp, &options, &fixed);
if (var->flags & PLUGIN_VAR_UNSIGNED)
*(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