Details
-
Technical task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.3(EOL)
-
10.2.2-3, 10.2.2-1, 10.2.2-2, 10.2.2-4, 10.1.18
Description
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.
Attachments
Issue Links
- blocks
-
MDEV-10591 Oracle-style packages
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Link |
This issue blocks |
Description |
Functions sp_load_for_information_schema() and show_create_sp() do a lot of strlen calls, e.g.: {code:cpp} 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) {code} {code:cpp} 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)) {code} {code:cpp} 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)) {code} This code is going to be shared by Oracle-style packages soon ( 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. |
Functions sp_load_for_information_schema() and show_create_sp() do a lot of strlen calls, e.g.:
{code:cpp} 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) {code} {code:cpp} 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)) {code} {code:cpp} 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)) {code} This code is going to be shared by Oracle-style packages soon ( 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. |
Status | Open [ 1 ] | In Progress [ 3 ] |
Labels | refactoring |
Component/s | Stored routines [ 13905 ] | |
Component/s | OTHER [ 10125 ] |
Status | In Progress [ 3 ] | Stalled [ 10000 ] |
issue.field.resolutiondate | 2017-07-31 20:52:37.0 | 2017-07-31 20:52:37.702 |
Fix Version/s | 10.3.1 [ 22532 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Workflow | MariaDB v3 [ 81851 ] | MariaDB v4 [ 152544 ] |