Details
Description
Description:
The mysql_show_var_func typedef for SHOW_FUNC callback handlers is
declared as returning "int", but at the two places where it gets called
in SHOW STATUS handling its return value is completely ignored.
Also the documentation mentions that it should return int (by showing
the typedef prototype) but doesn't mention what to return at all.
How to repeat:
Check ./include/mysql/plugin.h:
typedef int (*mysql_show_var_func)(MYSQL_THD, struct
st_mysql_show_var*, char *);
vs. sql/sql_show.cc
/*
if var->type is SHOW_FUNC, call the function.
Repeat as necessary, if new var is again SHOW_FUNC
*/
SHOW_VAR tmp;
for (; list->type == SHOW_FUNC; list= &tmp)
((mysql_show_var_func)(list->value))(thd, &tmp, value);
and
/*
if var->type is SHOW_FUNC or SHOW_SIMPLE_FUNC, call the function.
Repeat as necessary, if new var is again one of the above
*/
for (var=variables; var->type == SHOW_FUNC ||
var->type == SHOW_SIMPLE_FUNC; var= &tmp)
((mysql_show_var_func)(var->value))(thd, &tmp, buff);
Suggested fix:
The return value was probably meant to signal errors?
So implement actual error checking where mysql_show_var_func is called?
Gliffy Diagrams
Attachments
Issue Links
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
Also filed as http://bugs.mysql.com/74159