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