Details

    • 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

          Activity

            bar Alexander Barkov created issue -
            bar Alexander Barkov made changes -
            Field Original Value New Value
            bar Alexander Barkov made changes -
            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 (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.


            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 (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.


            bar Alexander Barkov made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            bar Alexander Barkov made changes -
            Labels refactoring
            bar Alexander Barkov made changes -
            Component/s Stored routines [ 13905 ]
            Component/s OTHER [ 10125 ]
            bar Alexander Barkov made changes -
            Status In Progress [ 3 ] Stalled [ 10000 ]
            bar Alexander Barkov made changes -
            issue.field.resolutiondate 2017-07-31 20:52:37.0 2017-07-31 20:52:37.702
            bar Alexander Barkov made changes -
            Fix Version/s 10.3.1 [ 22532 ]
            Fix Version/s 10.3 [ 22126 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 81851 ] MariaDB v4 [ 152544 ]

            People

              bar Alexander Barkov
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.