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

    Details

    • Type: Technical task
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.3
    • Fix Version/s: 10.3.6
    • Component/s: OTHER
    • Labels:
      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

              • Assignee:
                bar Alexander Barkov
                Reporter:
                bar Alexander Barkov
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: