mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into mysql.com:/misc/mysql/31177/51-31177 client/mysql.cc: Auto merged mysql-test/r/index_merge_myisam.result: Auto merged mysql-test/r/innodb_mysql.result: Auto merged mysql-test/r/ps.result: Auto merged mysql-test/r/subselect.result: Auto merged mysql-test/r/type_bit.result: Auto merged mysql-test/t/variables.test: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/set_var.cc: Auto merged sql/sql_plugin.cc: Auto merged
This commit is contained in:
@@ -1875,11 +1875,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);
|
||||
}
|
||||
@@ -1888,24 +1897,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