[MDEV-13863] sql_mode=ORACLE: DECODE does not treat two NULLs as equivalent Created: 2017-09-22 Updated: 2020-08-25 Resolved: 2017-09-23 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | OTHER |
| Affects Version/s: | 10.3 |
| Fix Version/s: | 10.3.2 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Compatibility | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
This script returns 2:
DECODE is internally implemented using Item_func_case, which treats two NULL values as not equal, so therefore the default value 2 is returned. Oracle database works differently:
The above query returns 1 in Oracle:
This script demonstrates the same problem, now using a table column instead of an explicit NULL literal:
MariaDB returns:
Oracle database returns:
DECODE should be fixed to treat two NULL values as equivalent. |
| Comments |
| Comment by Alexander Barkov [ 2017-09-23 ] |
|
Pushed to bb-10.2-ext and 10.3 |