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

            bar Alexander Barkov created issue -
            bar Alexander Barkov made changes -
            Field Original Value New Value
            bar Alexander Barkov made changes -
            Description Let's extend the parser for sql_mode=ORACLE to ignore the NOCOPY keyword in the FUNCTION and PROCEDURE definition grammar:

            {code:sql}
            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]...)]
            {code}

            Note, this task is only to understand and ignire 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.
            Let's extend the parser for sql_mode=ORACLE to ignore the NOCOPY keyword in the FUNCTION and PROCEDURE definition grammar:

            {code:sql}
            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]...)]
            {code}

            Note, this task is only to understand and ignire 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.
            bar Alexander Barkov made changes -
            Description Let's extend the parser for sql_mode=ORACLE to ignore the NOCOPY keyword in the FUNCTION and PROCEDURE definition grammar:

            {code:sql}
            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]...)]
            {code}

            Note, this task is only to understand and ignire 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.
            Let's extend the parser for sql_mode=ORACLE to ignore the NOCOPY keyword in the FUNCTION and PROCEDURE definition grammar:

            {code:sql}
            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]...)]
            {code}

            Note, this task is only to understand and ignire 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.
            bar Alexander Barkov made changes -
            Description Let's extend the parser for sql_mode=ORACLE to ignore the NOCOPY keyword in the FUNCTION and PROCEDURE definition grammar:

            {code:sql}
            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]...)]
            {code}

            Note, this task is only to understand and ignire 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.
            Let's extend the parser for sql_mode=ORACLE to ignore the NOCOPY keyword in the FUNCTION and PROCEDURE definition grammar:

            {code:sql}
            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]...)]
            {code}

            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.
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            Issue Type Task [ 3 ] New Feature [ 2 ]
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            ralf.gebhardt Ralf Gebhardt made changes -
            Fix Version/s 11.6 [ 29515 ]
            TheLinuxJedi Andrew Hutchings (Inactive) made changes -
            Assignee Alexander Barkov [ bar ]
            TheLinuxJedi Andrew Hutchings (Inactive) made changes -
            Fix Version/s 11.7 [ 29815 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 11.8 [ 29921 ]
            Fix Version/s 11.7 [ 29815 ]
            nikitamalyavin Nikita Malyavin made changes -
            Assignee Alexander Barkov [ bar ] Nikita Malyavin [ nikitamalyavin ]

            PR #3517 was reviewed and merged.

            nikitamalyavin Nikita Malyavin added a comment - PR #3517 was reviewed and merged.
            serg Sergei Golubchik made changes -
            Fix Version/s 11.7 [ 29815 ]
            Fix Version/s 11.8 [ 29921 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 11.7.1 [ 29913 ]
            Fix Version/s 11.7 [ 29815 ]
            serg Sergei Golubchik made changes -
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Assignee Nikita Malyavin [ nikitamalyavin ] Elena Stepanova [ elenst ]
            Resolution Fixed [ 1 ]
            Status Closed [ 6 ] Stalled [ 10000 ]
            serg Sergei Golubchik made changes -
            Status Stalled [ 10000 ] Open [ 1 ]
            serg Sergei Golubchik made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            serg Sergei Golubchik made changes -
            Status In Progress [ 3 ] In Testing [ 10301 ]
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            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.
            elenst Elena Stepanova made changes -
            Status In Testing [ 10301 ] Stalled [ 10000 ]
            elenst Elena Stepanova made changes -
            Assignee Elena Stepanova [ elenst ] Sergei Golubchik [ serg ]
            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
            serg Sergei Golubchik made changes -
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]

            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.