Details
-
Technical task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.3(EOL)
-
10.2.2-3, 10.2.2-1, 10.2.2-2, 10.2.2-4, 10.1.18
Description
When running with sql_mode=ORACLE, MariaDB should treat the second argument (the position) to "substr" in Oracle way: If position is 0, then it is treated as 1.
Currently MariaDB returns an empty string in case when the position is 0:
select substr('abc',0,3);
|
+-------------------+
|
| substr('abc',0,3) |
|
+-------------------+
|
| |
|
+-------------------+
|
This screenshot from an Oracle session demonstrates that 0 is translated to 1:
SQL> select substr('abc',0,3) from dual;
|
|
SUB
|
---
|
abc
|
Attachments
Issue Links
- blocks
-
MDEV-10342 Providing compatibility for basic SQL built-in functions
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Link |
This issue blocks |
Fix Version/s | 10.3.3 [ 22644 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
Parent | MDEV-10764 [ 57940 ] |
|
Labels | Compatibility |
Workflow | MariaDB v3 [ 82941 ] | MariaDB v4 [ 152945 ] |