[MDEV-19928] sql_mode=ORACLE: Add/Subtract numbers from date Created: 2019-07-02  Updated: 2019-07-04

Status: Open
Project: MariaDB Server
Component/s: PL/SQL
Affects Version/s: 10.4.6
Fix Version/s: 10.4

Type: Bug Priority: Major
Reporter: Wolfgang Draxler Assignee: Alexander Barkov
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Windows



 Description   

In the ORACLE-Mode there is a problem with subtract / add from dates to sysdate

e.g. in Oracle

select sysdate - 7 from dual;

I get the value, when today is the 02.07.2019:

25.06.19 16:25:28

When I try this in MariaDB

select sysdate() -7;

I get the text/number

+----------------+
| sysdate() -7   |
+----------------+
| 20190702162697 |
+----------------+
1 row in set (0.001 sec)

correct is

+---------------------+
| sysdate() -7        |
+---------------------+
| 2019-06-25 16:27:29 |
+---------------------+
1 row in set (0.001 sec)

The reason is that in Oracle subtractions the day is subtracted and not then seconds.


Generated at Thu Feb 08 08:55:26 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.