summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysys/my_getopt.c4
-rw-r--r--mysys/typelib.c5
-rw-r--r--sql/sql_plugin.cc6
3 files changed, 11 insertions, 4 deletions
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c
index b6eb6dac54f..5e81dbf2ee2 100644
--- a/mysys/my_getopt.c
+++ b/mysys/my_getopt.c
@@ -1012,9 +1012,11 @@ static void init_one_value(const struct my_option *option, uchar* *variable,
*((longlong*) variable)= (longlong) getopt_ll_limit_value((longlong) value, option, NULL);
break;
case GET_ULL:
- case GET_SET:
*((ulonglong*) variable)= (ulonglong) getopt_ull_limit_value((ulonglong) value, option, NULL);
break;
+ case GET_SET:
+ *((ulonglong*) variable)= (ulonglong) value;
+ break;
case GET_DOUBLE:
*((double*) variable)= (double) value;
break;
diff --git a/mysys/typelib.c b/mysys/typelib.c
index 92ffe9316ff..a0fe8a96a89 100644
--- a/mysys/typelib.c
+++ b/mysys/typelib.c
@@ -182,7 +182,10 @@ my_ulonglong find_typeset(char *x, TYPELIB *lib, int *err)
{
(*err)++;
i= x;
- while (*x && *x != field_separator) x++;
+ while (*x && *x != field_separator)
+ x++;
+ if (x[0] && x[1]) // skip separator if found
+ x++;
if ((find= find_type(i, lib, 2 | 8) - 1) < 0)
DBUG_RETURN(0);
result|= (ULL(1) << find);
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index b411d5e3095..bafc601d142 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -2066,7 +2066,7 @@ static int check_func_set(THD *thd, struct st_mysql_sys_var *var,
const char *strvalue= "NULL", *str;
TYPELIB *typelib;
ulonglong result;
- uint error_len;
+ uint error_len= 0; // init as only set on error
bool not_used;
int length;
@@ -2665,7 +2665,9 @@ uchar* sys_var_pluginvar::value_ptr(THD *thd, enum_var_type type,
{
if (!(value & mask))
continue;
- str.append(typelib->type_names[i], typelib->type_lengths[i]);
+ str.append(typelib->type_names[i], typelib->type_lengths
+ ? typelib->type_lengths[i]
+ : strlen(typelib->type_names[i]));
str.append(',');
}