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

sql_mode=ORACLE: Make the concatenation operator ignore NULL arguments

Details

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

    Description

      The concatenation operator || in Oracle skips all NULL arguments and returns the result of concatenation of non-NULL arguments.
      NULL is returned only if all arguments were NULL.

      Under terms of this task we'll make the || operator work in Oracle style when sql_mode is ORACLE.

      Note, the function CONCAT won't be changed by this task.

      There is a contributed patch from Jérôme Brauge implementing this feature:

      https://lists.launchpad.net/maria-developers/msg10288.html

      It adds a new flag MODE_CONCAT_NULL_YIELDS_NULL_OFF.
      We'll probably won't add the flag and just perform the Oracle style concatenation when sql_mode & MODE_ORACLE is set.

      Attachments

        Issue Links

          Activity

            bar Alexander Barkov created issue -
            bar Alexander Barkov made changes -
            Field Original Value New Value
            Summary sql_mode=ORACLE: Make the concate operator treat NULL arguments as empty strings sql_mode=ORACLE: Make the concatenation operator treat NULL arguments as empty strings
            bar Alexander Barkov made changes -
            Summary sql_mode=ORACLE: Make the concatenation operator treat NULL arguments as empty strings sql_mode=ORACLE: Make the concatenation operator ignore NULL arguments
            bar Alexander Barkov made changes -
            Description The concatenation operator {{||}} in Oracle skips all {{NULL}} arguments and returns the result of concatenation of non-{{NULL}} arguments.
            {{NULL}} is returned only if all arguments were NULL.

            Under terms of this task we'll make the {{||}} operator work in Oracle style.

            Note, the function {{CONCAT}} won't be changed by this task.
            The concatenation operator {{||}} in Oracle skips all {{NULL}} arguments and returns the result of concatenation of non-{{NULL}} arguments.
            {{NULL}} is returned only if all arguments were NULL.

            Under terms of this task we'll make the {{||}} operator work in Oracle style when {{sql_mode}} is {{ORACLE}}.

            Note, the function {{CONCAT}} won't be changed by this task.
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -

            Code reviewed. Looks fine, with a few small fixes needed

            monty Michael Widenius added a comment - Code reviewed. Looks fine, with a few small fixes needed
            bar Alexander Barkov made changes -
            Description The concatenation operator {{||}} in Oracle skips all {{NULL}} arguments and returns the result of concatenation of non-{{NULL}} arguments.
            {{NULL}} is returned only if all arguments were NULL.

            Under terms of this task we'll make the {{||}} operator work in Oracle style when {{sql_mode}} is {{ORACLE}}.

            Note, the function {{CONCAT}} won't be changed by this task.
            The concatenation operator {{||}} in Oracle skips all {{NULL}} arguments and returns the result of concatenation of non-{{NULL}} arguments.
            {{NULL}} is returned only if all arguments were NULL.

            Under terms of this task we'll make the {{||}} operator work in Oracle style when {{sql_mode}} is {{ORACLE}}.

            Note, the function {{CONCAT}} won't be changed by this task.


            There is a contributed patch from Jérôme Brauge:

            https://lists.launchpad.net/maria-developers/msg10288.html
            bar Alexander Barkov made changes -
            Description The concatenation operator {{||}} in Oracle skips all {{NULL}} arguments and returns the result of concatenation of non-{{NULL}} arguments.
            {{NULL}} is returned only if all arguments were NULL.

            Under terms of this task we'll make the {{||}} operator work in Oracle style when {{sql_mode}} is {{ORACLE}}.

            Note, the function {{CONCAT}} won't be changed by this task.


            There is a contributed patch from Jérôme Brauge:

            https://lists.launchpad.net/maria-developers/msg10288.html
            The concatenation operator {{||}} in Oracle skips all {{NULL}} arguments and returns the result of concatenation of non-{{NULL}} arguments.
            {{NULL}} is returned only if all arguments were NULL.

            Under terms of this task we'll make the {{||}} operator work in Oracle style when {{sql_mode}} is {{ORACLE}}.

            Note, the function {{CONCAT}} won't be changed by this task.


            There is a contributed patch from Jérôme Brauge implementing this feature:

            https://lists.launchpad.net/maria-developers/msg10288.html

            It adds a new flag {{MODE_CONCAT_NULL_YIELDS_NULL_OFF}}.
            We'll probably won't add the flag and just perform the Oracle style concatenation when {{sql_mode & MODE_ORACLE}} is set.

            bar Alexander Barkov made changes -
            Assignee Alexander Barkov [ bar ] Michael Widenius [ monty ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            Assignee Michael Widenius [ monty ] Alexander Barkov [ bar ]

            Pushed to bb-10.2-compatibilty

            bar Alexander Barkov added a comment - Pushed to bb-10.2-compatibilty
            bar Alexander Barkov made changes -
            Component/s OTHER [ 10125 ]
            Fix Version/s 10.3.0 [ 22127 ]
            Fix Version/s 10.3 [ 22126 ]
            Resolution Fixed [ 1 ]
            Status In Review [ 10002 ] Closed [ 6 ]
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            Labels Compatibility
            bar Alexander Barkov made changes -
            Component/s Parser [ 10201 ]
            alvinr Alvin Richards (Inactive) made changes -
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 79325 ] MariaDB v4 [ 151588 ]

            People

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