Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-10142 PL/SQL parser
  3. MDEV-13528

Add LEX::sp_body_finalize_{procedure|function}

    XMLWordPrintable

Details

    • 10.2.2-3, 10.2.2-1, 10.2.2-2, 10.2.2-4, 10.1.18

    Description

      This change is done under terms of a separate MDEV, to reduce the patch size for MDEV-10591.

      In order to save some duplicate code in sql_yacc.yy and sql_yacc_ora.yy, between

      • FUNCTION
      • PROCEDURE
      • Package FUNCTION (coming soon in MDEV-10591)
      • Package PROCEDURE (coming soon in MDEV-10591)
        we'll introduce two new methods:

      bool LEX::sp_body_finalize_procedure(THD *thd)
      {
        if (sphead->check_unresolved_goto())
          return true;
        sphead->set_stmt_end(thd);
        sphead->restore_thd_mem_root(thd);
        return false;
      }
       
      bool LEX::sp_body_finalize_function(THD *thd)
      {
        if (sphead->is_not_allowed_in_function("function"))
          return true;
        if (!(sphead->m_flags & sp_head::HAS_RETURN))
        {
          my_error(ER_SP_NORETURN, MYF(0), ErrConvDQName(sphead).ptr());
          return true;
        }
        if (sp_body_finalize_procedure(thd))
          return true;
        (void) is_native_function_with_warn(thd, &sphead->m_name);
        return false;
      }
      

      and use these methods in *.yy files.

      Attachments

        Issue Links

          Activity

            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.