Functions sp_load_for_information_schema() and show_create_sp() do a lot of strlen calls, e.g.:
if (parse_user(definer, strlen(definer),
|
definer_user_name.str, &definer_user_name.length,
|
definer_host_name.str, &definer_host_name.length) &&
|
definer_user_name.length && !definer_host_name.length)
|
if (!show_create_sp(thd, &defstr,
|
type,
|
NULL, 0,
|
name->m_name.str, name->m_name.length,
|
params, strlen(params),
|
returns, strlen(returns),
|
body, strlen(body),
|
&chistics, definer_user_name, definer_host_name,
|
sql_mode))
|
if (!show_create_sp(thd, &defstr, type,
|
sp_db_str.str, sp_db_str.length,
|
sp_name_obj.m_name.str, sp_name_obj.m_name.length,
|
params, strlen(params),
|
returns, strlen(returns),
|
sp_body, strlen(sp_body),
|
&sp_chistics, &definer_user, &definer_host, sql_mode))
|
This code is going to be shared by Oracle-style packages soon (MDEV-10591). Before adding packages, it would be nice to get rid of strlen calls.
Under terms if this task we'll change API for these functions to accept LEX_CSTRING instead of const char * and fix the caller code accordingly.