mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Bug#31177: Server variables can't be set to their current values
5.1+ specific fixes (plugins etc.)
This commit is contained in:
parent
9598ea4f45
commit
56274466be
@@ -1874,11 +1874,20 @@ err:
|
||||
static int check_func_int(THD *thd, struct st_mysql_sys_var *var,
|
||||
void *save, st_mysql_value *value)
|
||||
{
|
||||
bool fixed;
|
||||
long long tmp;
|
||||
struct my_option options;
|
||||
value->val_int(value, &tmp);
|
||||
plugin_opt_set_limits(&options, var);
|
||||
*(int *)save= (int) getopt_ull_limit_value(tmp, &options);
|
||||
*(int *)save= (int) getopt_ull_limit_value(tmp, &options, &fixed);
|
||||
if (fixed)
|
||||
{
|
||||
char buf[22];
|
||||
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
||||
ER_TRUNCATED_WRONG_VALUE,
|
||||
ER(ER_TRUNCATED_WRONG_VALUE), var->name,
|
||||
ullstr(tmp, buf));
|
||||
}
|
||||
return (thd->variables.sql_mode & MODE_STRICT_ALL_TABLES) &&
|
||||
(*(int *)save != (int) tmp);
|
||||
}
|
||||
@@ -1887,24 +1896,42 @@ static int check_func_int(THD *thd, struct st_mysql_sys_var *var,
|
||||
static int check_func_long(THD *thd, struct st_mysql_sys_var *var,
|
||||
void *save, st_mysql_value *value)
|
||||
{
|
||||
bool fixed;
|
||||
long long tmp;
|
||||
struct my_option options;
|
||||
value->val_int(value, &tmp);
|
||||
plugin_opt_set_limits(&options, var);
|
||||
*(long *)save= (long) getopt_ull_limit_value(tmp, &options);
|
||||
*(long *)save= (long) getopt_ull_limit_value(tmp, &options, &fixed);
|
||||
if (fixed)
|
||||
{
|
||||
char buf[22];
|
||||
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
||||
ER_TRUNCATED_WRONG_VALUE,
|
||||
ER(ER_TRUNCATED_WRONG_VALUE), var->name,
|
||||
ullstr(tmp, buf));
|
||||
}
|
||||
return (thd->variables.sql_mode & MODE_STRICT_ALL_TABLES) &&
|
||||
(*(long *)save != (long) tmp);
|
||||
}
|
||||
|
||||
|
||||
static int check_func_longlong(THD *thd, struct st_mysql_sys_var *var,
|
||||
void *save, st_mysql_value *value)
|
||||
void *save, st_mysql_value *value)
|
||||
{
|
||||
bool fixed;
|
||||
long long tmp;
|
||||
struct my_option options;
|
||||
value->val_int(value, &tmp);
|
||||
plugin_opt_set_limits(&options, var);
|
||||
*(ulonglong *)save= getopt_ull_limit_value(tmp, &options);
|
||||
*(ulonglong *)save= getopt_ull_limit_value(tmp, &options, &fixed);
|
||||
if (fixed)
|
||||
{
|
||||
char buf[22];
|
||||
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
||||
ER_TRUNCATED_WRONG_VALUE,
|
||||
ER(ER_TRUNCATED_WRONG_VALUE), var->name,
|
||||
ullstr(tmp, buf));
|
||||
}
|
||||
return (thd->variables.sql_mode & MODE_STRICT_ALL_TABLES) &&
|
||||
(*(long long *)save != tmp);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user