Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-34316

sql_mode=ORACLE: Ignore the NOCOPY keyword in stored routine parameters

Details

    Description

      Let's extend the parser for sql_mode=ORACLE to ignore the NOCOPY keyword in the FUNCTION and PROCEDURE definition grammar:

      argument:= name [ IN | OUT | IN OUT ] [ NOCOPY ] datatype
       
      func:= CREATE [OR REPLACE] FUNCTION  [schema.] function  [( argument [, argument]...)]
       
      proc:= CREATE [OR REPLACE] PROCEDURE [schema.] procedure [( argument [, argument]...)] 
      

      Note, this task is only to understand and ignore the NOCOPY keyword. The optimization (pass-by-reference instead of pass-by-value) helping to avoid value copying will be done in a separate task when needed.

      Attachments

        Issue Links

          Activity

            PR #3517 was reviewed and merged.

            nikitamalyavin Nikita Malyavin added a comment - PR #3517 was reviewed and merged.
            elenst Elena Stepanova added a comment - - edited

            After MDEV-35229 was fixed, I don't see anything else that wouldn't allow the feature to remain in the main branch and be released with 11.7.1.

            Minor notes:

            • when keywords are added, it is customary to accompany them with a comment. It hasn't been done for NOCOPY:

              %token  <kwd>  GOTO_MARIADB_SYM              // Oracle-R
              %token  <kwd>  NOCOPY_SYM
              %token  <kwd>  OTHERS_MARIADB_SYM            // SQL-2011-N, PLSQL-R
              

              As was noted elsewhere, some of the existing comments are already wrong, so maybe the list needs a general cleanup, out of the scope of this task.

            • In Oracle NOCOPY is only allowed for OUT and IN OUT parameters, but not for IN parameters. MariaDB now allows them for all, as specified in the task description. Since the goal is Oracle => MariaDB compatibility, more relaxed rules shouldn't cause any harm.
            • To my understanding, in Oracle parameter attributes (including NOCOPY) in a package description and the package body must strictly match. In MariaDB they can be different; but it is already so for other parameter attributes and types.
            • MDEV-28248 is an unfortunate nuisance which now affects nocopy as well.
            elenst Elena Stepanova added a comment - - edited After MDEV-35229 was fixed, I don't see anything else that wouldn't allow the feature to remain in the main branch and be released with 11.7.1. Minor notes: when keywords are added, it is customary to accompany them with a comment. It hasn't been done for NOCOPY : %token <kwd> GOTO_MARIADB_SYM // Oracle-R %token <kwd> NOCOPY_SYM %token <kwd> OTHERS_MARIADB_SYM // SQL-2011-N, PLSQL-R As was noted elsewhere, some of the existing comments are already wrong, so maybe the list needs a general cleanup, out of the scope of this task. In Oracle NOCOPY is only allowed for OUT and IN OUT parameters, but not for IN parameters. MariaDB now allows them for all, as specified in the task description. Since the goal is Oracle => MariaDB compatibility, more relaxed rules shouldn't cause any harm. To my understanding, in Oracle parameter attributes (including NOCOPY ) in a package description and the package body must strictly match. In MariaDB they can be different; but it is already so for other parameter attributes and types. MDEV-28248 is an unfortunate nuisance which now affects nocopy as well.
            serg Sergei Golubchik added a comment - - edited

            NOCOPY is not a reserved word in Oracle, so Oracle-R is strictly speaking incorrect, but we don't have Oracle-N anywhere, even non-reserved words are marked with Oracle-R. I'm hesitant to fix these labels as a part of this MDEV

            serg Sergei Golubchik added a comment - - edited NOCOPY is not a reserved word in Oracle, so Oracle-R is strictly speaking incorrect, but we don't have Oracle-N anywhere, even non-reserved words are marked with Oracle-R . I'm hesitant to fix these labels as a part of this MDEV

            People

              serg Sergei Golubchik
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              5 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.