diff options
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r-- | sql/set_var.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc index 697de9cda97..ec82b56d793 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1188,16 +1188,31 @@ bool sys_var_thd_ulong::check(THD *thd, set_var *var) bool sys_var_thd_ulong::update(THD *thd, set_var *var) { ulonglong tmp= var->save_result.ulonglong_value; + char buf[22]; + bool truncated= false; /* Don't use bigger value than given with --maximum-variable-name=.. */ if ((ulong) tmp > max_system_variables.*offset) + { + truncated= true; + llstr(tmp, buf); tmp= max_system_variables.*offset; + } #if SIZEOF_LONG == 4 /* Avoid overflows on 32 bit systems */ if (tmp > (ulonglong) ~(ulong) 0) + { + truncated= true; + llstr(tmp, buf); tmp= ((ulonglong) ~(ulong) 0); + } #endif + if (truncated) + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_TRUNCATED_WRONG_VALUE, + ER(ER_TRUNCATED_WRONG_VALUE), name, + buf); if (option_limits) tmp= (ulong) getopt_ull_limit_value(tmp, option_limits); |