PL/SQL parser (MDEV-10142)

[MDEV-11880] sql_mode=ORACLE: Make the concatenation operator ignore NULL arguments Created: 2017-01-23  Updated: 2018-08-31  Resolved: 2017-02-01

Status: Closed
Project: MariaDB Server
Component/s: OTHER, Parser
Affects Version/s: 10.3
Fix Version/s: 10.3.0

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

Issue Links:
Blocks
is blocked by MDEV-11848 Automatic statement repreparation cha... Closed
Duplicate
is duplicated by MDEV-11516 Support of opérator || for string con... Closed
Relates
relates to MDEV-12143 sql_mode=ORACLE: Make the CONCAT func... Closed
relates to MDEV-10574 sql_mode=ORACLE: IS NULL and empty st... Open
Sprint: 10.2.2-3, 10.2.2-1, 10.2.2-2, 10.2.2-4, 10.1.18

 Description   

The concatenation operator || in Oracle skips all NULL arguments and returns the result of concatenation of non-NULL arguments.
NULL is returned only if all arguments were NULL.

Under terms of this task we'll make the || operator work in Oracle style when sql_mode is ORACLE.

Note, the function CONCAT won't be changed by this task.

There is a contributed patch from Jérôme Brauge implementing this feature:

https://lists.launchpad.net/maria-developers/msg10288.html

It adds a new flag MODE_CONCAT_NULL_YIELDS_NULL_OFF.
We'll probably won't add the flag and just perform the Oracle style concatenation when sql_mode & MODE_ORACLE is set.



 Comments   
Comment by Michael Widenius [ 2017-01-30 ]

Code reviewed. Looks fine, with a few small fixes needed

Comment by Alexander Barkov [ 2017-02-01 ]

Pushed to bb-10.2-compatibilty

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