Details

    Description

      Implement overloading in package functions and procedures, to make it possible to declare routines with the same name but with:

      • Different number of arguments
      • The same number of arguments, but with different argument types

      to make possible declarations like this:

      SET sql_mode=ORACLE;
      DELIMITER $$
      CREATE OR REPLACE PACKAGE pkg1
      AS
        FUNCTION f1() RETURN INT;
        FUNCTION f1(a INT) RETURN INT;
        FUNCTION f1(a TEXT) RETURN INT;
        FUNCTION f1(a INT, b TEXT) RETURN INT;
        FUNCTION f1(a TEXT, b INT) RETURN INT;
      END;
      $$
      

      Overloading will work in all sql_mode's using their respective syntax.

      The scope

      This task is only about overloading in package routines.

      Overloading in schema routines will be done separately, because it'll need more efforts:

      • Changes in mysql.proc.specific_name
      • Changes in INFORMATION_SCHEMA.ROUTINES.SPECIFIC_NAME.

      These coulumns should return something similar to C++ mangled function names - a combination of the name and the signature for parameters

      Relation to MDEV-18951

      This task does not duplicate any functionality described in MDEV-18951, which is not about overloading but is rather about template-style functions, similar to C++ templates.

      In terms of C++,

      • MDEV-18951 is very close to:

        template<typename X>
        bool lt(const X a, const X b)
        {
          return a < b;
        };
        

      • MDEV-34484 is about:

        bool lt(const double a, const double b)
        {
          return a < b;
        };
         
        bool lt(const int b, const int b)
        {
          return a < b;
        };
        

      Although, both approaches effectively implement the same functionality, they use different instrumentation to achieve it.

      Attachments

        Issue Links

          Activity

            No workflow transitions have been executed yet.

            People

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

              Dates

                Created:
                Updated:

                Git Integration

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