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

REGEXP_REPLACE treats empty strings different than REPLACE in ORACLE mode

    XMLWordPrintable

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

            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.