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

REGEXP_REPLACE treats empty strings different than REPLACE in ORACLE mode

Details

    Description

      The REPLACE function has special treatment for cases where the 3rd parameter is NULL in ORACLE sql_mode, REGEXP_REPLACE on the other hand always returns NULL when the 3rd parameter is NULL, or an empty string converted to NULL due to empty_string_is_null sql_mode.

      When calling both functions with parameters ('x-x', '-', empty string or NULL) the results are as follows

      3rd param  REPLACE  REGEXP_REPLACE  sql_mode
      ---------------------------------------------------------------
      ''           xx           xx        ORACLE
      NULL         xx          NULL       ORACLE
      ''           xx          NULL       ORACLE,empty_string_is_null
      NULL         xx          NULL       ORACLE,empty_string_is_null
      

      Attachments

        Issue Links

          Activity

            Transition Time In Source Status Execution Times
            Alexander Barkov made transition -
            Open In Progress
            498d 17h 33m 1
            Alexander Barkov made transition -
            In Progress In Review
            31s 1
            Alexander Barkov made transition -
            Stalled In Review
            5d 20h 36m 1
            Sergei Golubchik made transition -
            In Review Stalled
            54d 13h 1m 2
            Alexander Barkov made transition -
            Stalled Closed
            12h 24m 1

            People

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