1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00
Fix compiler warnings,
  Fix help output - this fixes im test failures.
  Fix incomplete change of SET plugin vars to ulonglong.
  Allow ER() to work without crashing when errmsg.sys has not been loaded.


include/mysql/plugin.h:
  wl2936
    slip in const modifier for default values,
    this removes compiler warnings when assigning a string const as default value.
sql/derror.cc:
  WL2936
    Allow init_errmessage() to return upon failure.
    Initialize errmesg to an array of empty strings if it failed to load errmsg.sys
sql/mysqld.cc:
  wl2936
    Include Ingo's compiler-warnings fix.
    If init_errmessage() failed to load errmsg.sys, abort.
    Failure to set working directory not fatal when '--help' is specified, as
    server will terminate anyway after displaying help information.
sql/sql_plugin.cc:
  wl2936
    complete change of SET vars from ulong to ulonglong.
This commit is contained in:
unknown
2007-05-01 18:25:29 -07:00
parent 2203faa204
commit 6cb6bb8594
4 changed files with 33 additions and 21 deletions

View File

@ -1939,8 +1939,7 @@ static int check_func_set(THD *thd, struct st_mysql_sys_var *var,
char buff[STRING_BUFFER_USUAL_SIZE], *error= 0;
const char *strvalue= "NULL", *str;
TYPELIB *typelib;
long result;
ulonglong tmp;
ulonglong result;
uint error_len;
bool not_used;
int length;
@ -1966,18 +1965,17 @@ static int check_func_set(THD *thd, struct st_mysql_sys_var *var,
}
else
{
if (value->val_int(value, (long long *)&tmp))
if (value->val_int(value, (long long *)&result))
goto err;
if (unlikely((tmp >= (ULL(1) << typelib->count)) &&
if (unlikely((result >= (ULL(1) << typelib->count)) &&
(typelib->count < sizeof(long)*8)))
{
llstr(tmp, buff);
llstr(result, buff);
strvalue= buff;
goto err;
}
result= (long) tmp;
}
*(long*)save= result;
*(ulonglong*)save= result;
return 0;
err:
my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->name, strvalue);
@ -2887,7 +2885,7 @@ static int construct_options(MEM_ROOT *mem_root, struct st_plugin_int *tmp,
if (!opt->check)
opt->check= check_func_set;
if (!opt->update)
opt->update= update_func_long;
opt->update= update_func_longlong;
break;
default:
sql_print_error("Unknown variable type code 0x%x in plugin '%s'.",