[MDEV-29095] REGEXP_REPLACE treats empty strings different than REPLACE in ORACLE mode Created: 2022-07-13 Updated: 2024-01-24 Resolved: 2024-01-24 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | OTHER |
| Affects Version/s: | 10.3.35, 10.4.25, 10.5.16, 10.6.8, 10.7.4, 10.8.3 |
| Fix Version/s: | 10.4.33, 10.5.24, 10.6.17, 10.11.7, 11.0.5, 11.1.4, 11.2.3, 11.3.2 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Hartmut Holzgraefe | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||
| 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
|
| Comments |
| Comment by Alexander Barkov [ 2023-04-24 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Oracle 11g works as follows:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2023-04-24 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MariaDB-10.4-28:
Obvervation:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2023-06-27 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Because it depends on Instead of adding yet another function with the _ORACLE suffix, REGEX_REPLACE_ORACLE, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2023-11-24 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hello, serg, please review this patch: https://github.com/MariaDB/server/commit/9d6de9212d54b586b3c3434201abf833512190dc Thanks. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2024-01-16 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hello serg, Please review a new patch version: https://github.com/MariaDB/server/commit/94fff9671daff70137bc806723363e9b507a5034 Also, comments sent by email. Thanks. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2024-01-23 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
94fff9671daff70137bc806723363e9b507a5034 is ok to push |