diff options
author | unknown <acurtis/antony@xiphis.org/ltamd64.xiphis.org> | 2007-05-01 18:25:29 -0700 |
---|---|---|
committer | unknown <acurtis/antony@xiphis.org/ltamd64.xiphis.org> | 2007-05-01 18:25:29 -0700 |
commit | 6cb6bb85942a6dd9600b4167ecd5decd1f4615ca (patch) | |
tree | 1df07565eb5375479d3b4f10b9372c76d7bce56e /sql/sql_plugin.cc | |
parent | 2203faa204085eab17283f0e59835012b4b37e63 (diff) | |
download | mariadb-git-6cb6bb85942a6dd9600b4167ecd5decd1f4615ca.tar.gz |
WL#2936
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.
Diffstat (limited to 'sql/sql_plugin.cc')
-rw-r--r-- | sql/sql_plugin.cc | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index a9816eb4f98..590fee82027 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -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'.", |