Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
N/A
-
None
Description
In Oracle, capitalization of the format elements matters. It is documented and actually holds truth:
SELECT TO_CHAR(SYSDATE, 'MONTH') FROM DUAL |
MAY
|
|
SELECT TO_CHAR(SYSDATE, 'Month') FROM DUAL |
May
|
|
SELECT TO_CHAR(SYSDATE, 'month') FROM DUAL |
may
|
In MariaDB implementation it is not so. All variants are accepted, but the same result is returned for any of them:
a04ef8a3cb90 |
MariaDB [test]> SELECT TO_CHAR(SYSDATE, 'MONTH') FROM DUAL; |
+---------------------------+ |
| TO_CHAR(SYSDATE, 'MONTH') | |
+---------------------------+ |
| May |
|
+---------------------------+ |
1 row in set (0.001 sec) |
|
MariaDB [test]> SELECT TO_CHAR(SYSDATE, 'Month') FROM DUAL; |
+---------------------------+ |
| TO_CHAR(SYSDATE, 'Month') | |
+---------------------------+ |
| May |
|
+---------------------------+ |
1 row in set (0.001 sec) |
|
MariaDB [test]> SELECT TO_CHAR(SYSDATE, 'month') FROM DUAL; |
+---------------------------+ |
| TO_CHAR(SYSDATE, 'month') | |
+---------------------------+ |
| May |
|
+---------------------------+ |
1 row in set (0.001 sec) |
I haven't found anything in MDEV-20017 description or comments that would suggest it is intentional. It says that only MONTH is supported (which is not true, as shown above), but even if it were true, it would mean that it returns a different value comparing to Oracle.
Attachments
Issue Links
- relates to
-
MDEV-20017 Implement TO_CHAR() Oracle compatible function
- Closed