Details
Description
The REPLACE function has special treatment for cases where the 3rd parameter is NULL in ORACLE sql_mode, REGEXP_REPLACE on the other hand always returns NULL when the 3rd parameter is NULL, or an empty string converted to NULL due to empty_string_is_null sql_mode.
When calling both functions with parameters ('x-x', '-', empty string or NULL) the results are as follows
3rd param REPLACE REGEXP_REPLACE sql_mode
|
---------------------------------------------------------------
|
'' xx xx ORACLE
|
NULL xx NULL ORACLE
|
'' xx NULL ORACLE,empty_string_is_null
|
NULL xx NULL ORACLE,empty_string_is_null
|
Attachments
Issue Links
- is blocked by
-
MDEV-27744 LPAD in vcol created in ORACLE mode makes table corrupted in non-ORACLE
- Closed
- relates to
-
MDEV-13003 Oracle compatibility : Replace function (PR: #401)
- Closed