diff options
author | unknown <tnurnberg@white.intern.koehntopp.de> | 2007-12-02 03:19:07 +0100 |
---|---|---|
committer | unknown <tnurnberg@white.intern.koehntopp.de> | 2007-12-02 03:19:07 +0100 |
commit | 70cb41a240268ace3d6a8a75c28b7d9ae2a04079 (patch) | |
tree | 9c97f7a03204559208c97b73dfdb1d270657c44a /sql/sql_plugin.cc | |
parent | 25886c069e8aa9828396f92d2028c983147bdf75 (diff) | |
parent | 58f10e554aa2ce340e853be1006e1f411f89f09d (diff) | |
download | mariadb-git-70cb41a240268ace3d6a8a75c28b7d9ae2a04079.tar.gz |
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
Diffstat (limited to 'sql/sql_plugin.cc')
-rw-r--r-- | sql/sql_plugin.cc | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index ef4c63381e2..08b33c4502c 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -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); } |