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

CONCAT behavior with NULL is different to Oracle

    XMLWordPrintable

    Details

      Description

      Problem

      Given the following statement

      SELECT CONCAT('TDSMGR',NULL) 
      

      In MariaDB this returns NULL, in Oracle this returns 'TDSMGR'.

      In SQL_MODE='Oracle' this different behavior causes significant problems.

      Background

      CONCAT Function is different implemented.

      https://www.techonthenet.com/mariadb/functions/concat.php
      https://www.techonthenet.com/oracle/functions/concat.php

      Reproduce

      See above

      Workaround

      SELECT CONCAT_WS(', ',
      concat_ws('',"TDSMGR",null)
      );
      

      or

      SELECT CONCAT('TDSMGR',IFNULL(NULL,''));
      

      Solution

      For SQL_MODE = 'Oracle' ensure that CONCAT exhibits the Oracle behaviour.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bar Alexander Barkov
              Reporter:
              alvinr Alvin Richards (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: