Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-10764 PL/SQL parser - Phase 2
  3. MDEV-15664

sql_mode=ORACLE: Make TRIM return NULL instead of empty string

    XMLWordPrintable

Details

    • Technical task
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.3
    • 10.3.6
    • OTHER
    • None

    Description

      Earlier we made concatenation operator and SUBSTR translate empty results to NULL when running with sql_mode=ORACLE.

      Under terms of this task we'll change TRIM, LTRIM, RTRIM to do the same.

      The below scripts demonstrate Oracle's behavior:

      SELECT
        CASE
          WHEN TRIM('a' FROM 'aa') IS NULL THEN 'IS NULL'
          ELSE 'IS NOT NULL'
        END AS c
      FROM DUAL;
      

      C
      -----------
      IS NULL
      

      SELECT
        CASE
          WHEN LTRIM('  ') IS NULL THEN 'IS NULL'
          ELSE 'IS NOT NULL'
        END AS c
      FROM DUAL;
      

      C
      -----------
      IS NULL
      

      SELECT
        CASE
          WHEN RTRIM('  ') IS NULL THEN 'IS NULL'
          ELSE 'IS NOT NULL'
        END AS c
      FROM DUAL;
      

      C
      -----------
      IS NULL
      

      Attachments

        Issue Links

          Activity

            People

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