diff options
author | unknown <jani@a88-113-38-195.elisa-laajakaista.fi> | 2008-03-13 23:35:52 +0200 |
---|---|---|
committer | unknown <jani@a88-113-38-195.elisa-laajakaista.fi> | 2008-03-13 23:35:52 +0200 |
commit | 6ef32fd0a91148b9758acaa1e2ebde3110e96781 (patch) | |
tree | 45d9abbd3b89bec4d4880130013f666463dccb90 /sql/sql_plugin.cc | |
parent | abf07615394340cf8100afdb192b37d518cf3910 (diff) | |
parent | 269ebe54211cf96c4e64fa7268a1414588ca1de8 (diff) | |
download | mariadb-git-6ef32fd0a91148b9758acaa1e2ebde3110e96781.tar.gz |
Merge a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-main
into a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-marvel
client/mysqldump.c:
Auto merged
include/my_global.h:
Auto merged
mysql-test/lib/mtr_report.pl:
Auto merged
sql/handler.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/log.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_plugin.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/table.h:
Auto merged
mysys/my_create.c:
SCCS merged
Diffstat (limited to 'sql/sql_plugin.cc')
-rw-r--r-- | sql/sql_plugin.cc | 38 |
1 files changed, 8 insertions, 30 deletions
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index df408d0e61f..ddaf7bccbc1 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -210,6 +210,8 @@ static void reap_plugins(void); /* declared in set_var.cc */ extern sys_var *intern_find_sys_var(const char *str, uint length, bool no_error); +extern bool throw_bounds_warning(THD *thd, bool fixed, bool unsignd, + const char *name, longlong val); #ifdef EMBEDDED_LIBRARY /* declared in sql_base.cc */ @@ -1891,16 +1893,8 @@ static int check_func_int(THD *thd, struct st_mysql_sys_var *var, else *(int *)save= (int) getopt_ll_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); + return throw_bounds_warning(thd, fixed, var->flags & PLUGIN_VAR_UNSIGNED, + var->name, (longlong) tmp); } @@ -1919,16 +1913,8 @@ static int check_func_long(THD *thd, struct st_mysql_sys_var *var, else *(long *)save= (long) getopt_ll_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); + return throw_bounds_warning(thd, fixed, var->flags & PLUGIN_VAR_UNSIGNED, + var->name, (longlong) tmp); } @@ -1947,16 +1933,8 @@ static int check_func_longlong(THD *thd, struct st_mysql_sys_var *var, else *(longlong *)save= getopt_ll_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); + return throw_bounds_warning(thd, fixed, var->flags & PLUGIN_VAR_UNSIGNED, + var->name, (longlong) tmp); } static int check_func_str(THD *thd, struct st_mysql_sys_var *var, |