1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Bug#31177: Server variables can't be set to their current values

5.1+ specific fixes (plugins etc.)


include/my_getopt.h:
  make both ull and ll global
mysql-test/r/index_merge_myisam.result:
  we throw warnings to the client, yea, verily
mysql-test/r/innodb.result:
  we throw warnings to the client, yea, verily
mysql-test/r/variables.result:
  we throw warnings to the client, yea, verily
mysql-test/t/variables.test:
  correct result, is multiple of variable's block_size now
mysys/my_getopt.c:
  export getopt_ll_limit_value(), check for integer wrap-around
  in it, same as in ull variant.  Only print warnings to reporter
  when caller didn't ask for diagnostics, otherwise assume caller
  will handle any warnings (id est, throw them client-wards)
sql/mysqld.cc:
  correct signedness of "concurrent-insert"
sql/sql_plugin.cc:
  Throw sys-var out-of-range warnings client-wards for
  plugins, too.
This commit is contained in:
unknown
2007-12-01 19:55:06 +01:00
parent 54ad7d88d0
commit 58f10e554a
8 changed files with 104 additions and 26 deletions

View File

@@ -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);
}