PL/SQL parser - Phase 2 (MDEV-10764)

[MDEV-15739] sql_mode=ORACLE: Make LPAD and RPLAD return NULL instead of empty string Created: 2018-03-30  Updated: 2018-04-03  Resolved: 2018-04-03

Status: Closed
Project: MariaDB Server
Component/s: OTHER
Affects Version/s: 10.3
Fix Version/s: 10.3.6

Type: Technical task Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: Compatibility

Issue Links:
Relates
relates to MDEV-15664 sql_mode=ORACLE: Make TRIM return NUL... Closed

 Description   

Earlier we made the concatenation operator and functions SUBSTR, TRIM, LTRIM, RTRIM translate empty results to NULL when running with sql_mode=ORACLE.

Under terms of this task we'll change LPAD and RPAD to do the same.

SELECT
  CASE
    WHEN LPAD('a', 0) IS NULL THEN 'IS NULL'
    ELSE 'IS NOT NULL'
  END AS c
FROM DUAL;

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

SELECT
  CASE
    WHEN RPAD('a', 0) IS NULL THEN 'IS NULL'
    ELSE 'IS NOT NULL'
  END AS c
FROM DUAL;

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


Generated at Thu Feb 08 08:23:39 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.